summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--initramfs/initrd-stuff/etc/functions2
-rwxr-xr-xinitramfs/initrd-stuff/init23
2 files changed, 14 insertions, 11 deletions
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions
index 8815ffe6..7b00c092 100644
--- a/initramfs/initrd-stuff/etc/functions
+++ b/initramfs/initrd-stuff/etc/functions
@@ -439,7 +439,7 @@ local count=0
[ -z $file ] && return 0
[ -z $maxwait ] && maxwait=5000
while [ ! -e $file ] ; do
- echo "waiting ........." > /dev/null
+ usleep 1000
count=$(($count + 1))
[ $count -gt $maxwait ] && return 1
done
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