diff options
author | Matthias Hentges <oe@hentges.net> | 2005-08-15 08:12:04 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2005-08-15 08:12:04 +0000 |
commit | c3e8dd99251f1207443bff6a0d85dd9c55006bc9 (patch) | |
tree | 18af5a1b6f6f2f1c780b39096f36aa3e6e776381 /packages/altboot/files | |
parent | e977ce6a276892932a2b3961289d51013d404f38 (diff) |
altboot: Do not use a fixed time to wait for WLAN on NFS boot. Ping the NFS host and continue once the network is up.
Diffstat (limited to 'packages/altboot/files')
-rw-r--r-- | packages/altboot/files/altboot-menu/Advanced/40-bootNFS | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/packages/altboot/files/altboot-menu/Advanced/40-bootNFS b/packages/altboot/files/altboot-menu/Advanced/40-bootNFS index feedfc769b..33e869bbe1 100644 --- a/packages/altboot/files/altboot-menu/Advanced/40-bootNFS +++ b/packages/altboot/files/altboot-menu/Advanced/40-bootNFS @@ -29,7 +29,7 @@ run_module() { /etc/init.d/portmap start >/dev/tty1 2>&1 || die "/etc/init.d/portmap start failed!" # For some reason NFS mounts hang if /e/i/networking is not run. - # For the time beeing I'm to lazy to investigate ;) + # For the time beeing I'm too lazy to investigate ;) /etc/init.d/networking start || die "/etc/init.d/networking start failed!" sleep 2 @@ -37,14 +37,44 @@ run_module() { # After the PCMCIA service is started, an inserted WLAN card should automatically # activate itself. /etc/init.d/pcmcia start || die "/etc/init.d/pcmcia/start failed!" - - # Give WLAN time to login into the network - echo "Waiting for WLAN..." - sleep 8 - + + nfs_host="`cat /etc/fstab | grep -v ^# | grep nfs | awk '{print $1}'|sed -n "s/\(.*\)\:\(.*\)/\1/p" `" nfs_mounts="`cat /etc/fstab | grep -v ^# | grep nfs | awk '{print $1}'`" nfs_mountpoints="`cat /etc/fstab | grep -v ^# | grep nfs | awk '{print $2}'`" + + # WLAN with DHCP needs some time to get a lease, set up the routing, etc. + echo -n "Waiting for WLAN" + cnt=0 + while true + do + if (ping -c 1 $nfs_host) >/dev/null 2>&1 + then + echo " found" + break + else + if test "$cnt" = 30 -o "$cnt" = 60 + then + echo "" + echo "WARNING: WLAN didn't activate in $cnt seconds!" + + if test "$cnt" = 30 + then + echo "Restarting udhcpc" + killall udhcpc + udhcpc -i wlan0 -H `cat /etc/hostname` + else + die "Failed to activate WLAN!" + break + fi + else + echo -n "." + let cnt=$cnt+1 + fi + fi + sleep 1 + done + if test "` echo "$nfs_mountpoints" |wc -l | tr -d " "`" -gt 1 then echo -e "Please select your NFS root:\n" |