From 5275a6d485f2be9a5f1683ad335c25f9179d4638 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Sun, 1 Jul 2007 16:16:30 +0000 Subject: Fix for nfsmnt in init, more code cleanups ... git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1203 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/initrd-stuff/init | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'initramfs/initrd-stuff/init') diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init index f0907b55..483f6327 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -333,9 +333,9 @@ macaddr=$(ip link show dev $nwif|sed -n "/ether [0-9e-f]\{2\}:.*/p" \ # of it into several variables if [ -n "$ipinfo" ] ; then getip () { - local val="$ipinfo:"; i=$(expr $1 - 1); + local val="$ipinfo:"; i=$(($1 - 1)); while [ $i -gt 0 ] ; do - val=${val#*:} ; i=$(expr $i - 1); + val=${val#*:} ; i=$(($i - 1)); done; echo $val|sed "s/:.*//"; } clientip=$(getip 1) @@ -411,12 +411,13 @@ if [ -n "${nbdmod}" ] ; then i=0 while [ "x$nbdhost" != "x" ]; do echo $nbdhost $nbdport > /sys/block/vnbd0/server${i}/sock - i=$(expr $i + 1) + i=$(($i + 1)) rootfs=${rootfs#* } nbdsp=$(echo ${rootfs}|sed "s, .*,,") nbdhost=$(uri_token $nbdsp server) nbdport=$(uri_token $nbdsp port) done + # quickhack, should be read in from URI echo 1 > /sys/block/vnbd0/config/vid echo 1 > /sys/block/vnbd0/config/rid echo noop > /sys/block/vnbd0/queue/scheduler @@ -424,10 +425,9 @@ if [ -n "${nbdmod}" ] ; then while [ $(cat /sys/block/vnbd0/config/running) != 1 ] ; do echo 1 > /sys/block/vnbd0/config/running usleep 5000 - i=$(expr $i + 1) + i=$(($i + 1)) if [ $i -ge 1000 ] ; then - error "$init_dnbd2s" - break + error "$init_dnbd2s"; break fi done # echo "0" > /sys/block/vnbd0/queue/read_ahead_kb @@ -525,7 +525,10 @@ if [ -z "${nbdmod}" -a -z "${nbdserver}" ] ; then # the root_path should contain server ip and path in nfsroot notation nfsroot=${root_path} fi - nfsmnt ${nfsroot} || error "$init_nfs" + for proto in tcp udp fail; do + [ $proto = "fail" ] && { error "$init_nfs"; break; } + mount -n -t nfs -o ro,nolock,${proto} ${nfsroot} /mnt && break + done [ $DEBUGLEVEL -eq 20 ] && echo "** finished nfs mount at $(sysup)" fi @@ -688,14 +691,14 @@ else error "$init_infldcfg" nonfatal fi # wait a while for hardware setup to complete and copy stuff to stage4 -waitfor /tmp/hwcfg 30000 || error "$init_errhw" +waitfor /tmp/hwcfg 10000 || error "$init_errhw" [ -f /tmp/scanner-udev ] && cat /tmp/scanner-udev \ >> /mnt/etc/udev/rules.d/04-scanner.rules # wait for completion of Xorg configuration and finalize it -waitfor /tmp/xready 20000 || error "$init_errxorg" nonfatal +waitfor /tmp/xready 10000 || error "$init_errxorg" nonfatal mv /etc/xorg.conf /mnt/${D_XF86CONFFILE} # wait a while for services setup to complete -waitfor /tmp/svcfg 20000 || error "$init_errsw" +waitfor /tmp/svcfg 10000 || error "$init_errsw" # IP configuration is complete and should not be updated automatically killall -9 dhcpcd dhclient udhcpc 2>/dev/null # copy machine configuration file into stage4 filesystem -- cgit v1.2.3-55-g7522