diff options
author | a.hoppe | 2010-02-08 19:58:28 +0100 |
---|---|---|
committer | a.hoppe | 2010-02-08 19:58:28 +0100 |
commit | f00b265a1950d0b4f2d53d7bcdf18e516ef149f5 (patch) | |
tree | f50449032a8825971663b63f00dd51ad112b57f9 /boot-env/preboot | |
parent | seems to be the solution for non loading firmware. Assiciated to Feature #342 (diff) | |
download | core-f00b265a1950d0b4f2d53d7bcdf18e516ef149f5.tar.gz core-f00b265a1950d0b4f2d53d7bcdf18e516ef149f5.tar.xz core-f00b265a1950d0b4f2d53d7bcdf18e516ef149f5.zip |
some improvements for wlan-boot (recognition of wlan interface and essid settings)
Diffstat (limited to 'boot-env/preboot')
-rwxr-xr-x | boot-env/preboot/uclib-rootfs/init | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/boot-env/preboot/uclib-rootfs/init b/boot-env/preboot/uclib-rootfs/init index f240d65d..ab2f9ca0 100755 --- a/boot-env/preboot/uclib-rootfs/init +++ b/boot-env/preboot/uclib-rootfs/init @@ -14,7 +14,7 @@ fetchip () { # we expect to get an ip address within 10++ seconds -( sleep 6 ; killall udhcpc >/dev/null 2>&1 ) & +( sleep 10 ; killall udhcpc >/dev/null 2>&1 ) & for i in 1 2 ; do udhcpc -f -n -q $vci -s /usr/share/udhcpc/default.script -i $nwif 2>/dev/null if grep "ip=" /tmp/ipstuff >/dev/null 2>&1 ; then @@ -141,6 +141,25 @@ fi if [ -n "${SSID}" ] ; then # WLAN setup will most probably change the network interface name stored in # nwif (to wlan0 or something like that) + [ $DEBUGLEVEL -gt 0 ] && echo "set essid to ${essid}"; + #value of essid unchecked yet + # load network adaptor modules + cd /lib/modules/$(ls /lib/modules/)/kernel/drivers/net/wireless + for mod in $(find . | grep .ko | sed 's,.*/\([^/]*\).ko,\1',); do + echo "Mod:"; + echo $mod; + modprobe $mod || echo "module $mod did not load for some reason" + usleep 10000 + done + cd / + wlanif=$(iwconfig 2>/dev/null|sed -n "/ESSID:/p"|sed "s/ .*//") + [ $DEBUGLEVEL -gt 0 ] && echo "wlancard recognized as ${wlanif}"; + ip link set dev ${wlanif} up + if iwconfig ${wlanif} mode managed essid "${essid}"; then + nwif=${wlanif} + else + error " Unable to configure the WLAN interface." + fi : else # check here for the active Ethernet link |