diff options
author | Dirk von Suchodoletz | 2007-06-01 00:29:30 +0200 |
---|---|---|
committer | Dirk von Suchodoletz | 2007-06-01 00:29:30 +0200 |
commit | b081d2a92eca9b7180eea0d357b867999b76de76 (patch) | |
tree | 9cf81f27e8a62642e327da70f984ddf40a59c7cf /initramfs/initrd-stuff/etc/functions | |
parent | Change in pcitable (see #100) eepro100 -> e100. Changeback of silly (diff) | |
download | core-b081d2a92eca9b7180eea0d357b867999b76de76.tar.gz core-b081d2a92eca9b7180eea0d357b867999b76de76.tar.xz core-b081d2a92eca9b7180eea0d357b867999b76de76.zip |
Stuff for WLAN boot (all testing).
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1125 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs/initrd-stuff/etc/functions')
-rw-r--r-- | initramfs/initrd-stuff/etc/functions | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions index d645adc9..23f2a6c3 100644 --- a/initramfs/initrd-stuff/etc/functions +++ b/initramfs/initrd-stuff/etc/functions @@ -153,7 +153,7 @@ local netdev="eth${vifnum}" local pdev="p${netdev}" local vdev="veth${vifnum}" local vif0="vif0.${vifnum}" -# fixme: that is the mac address of eth0 device +# fixme: that is the mac address of main ethernet device local mac=$macaddr brctl addbr ${bridge} @@ -180,6 +180,21 @@ else fi } ############################################################################# +# definition of wlan interface name and wireless connect +wlanlinksetup () { +if=$(iwconfig 2>/dev/null|sed -n "/ESSID:/p"|sed "s/ .*//") +if [ -n "$if" ] ; then + ip link set dev $if up + if iwconfig $if mode managed essid "${essid}"; then + nwif=$if + else + error "$init_nowlan" + fi +else + error "$init_nowlan" +fi +} +############################################################################# # nfs mounter for root filesystem and other sources nfsmnt () { @@ -281,7 +296,7 @@ else # ensure the interface is up - might produce conflicts - nbd could # fail!! [ -n "$noipyet" ] && \ - ip link set dev eth0 up + ip link set dev $nwif up [ -f /lib/modules/@@@KERNVER@@@/kernel/net/packet/af_packet.ko ] && \ modprobe ${MODPRV} af_packet echo "Starting $dhcp for configuration" @@ -293,14 +308,14 @@ case $dhcp in mkdhclconf $vci ln -s /bin/dhcpmkconfig /bin/dhclient-script dhclient -cf /etc/dhclient.conf -lf /var/lib/dhcp/dhclient.leases \ - -q eth0 >/dev/null 2>&1 || error "$error_dhclient" + -q $nwif >/dev/null 2>&1 || error "$error_dhclient" ;; # udhcpc is a busybox applet udhcpc) [ -n $vci ] && vci="-V $vci" testmkd /usr/share/udhcpc ln -s /bin/dhcpmkconfig /usr/share/udhcpc/default.script - udhcpc -b -q $vci -s /usr/share/udhcpc/default.script -i eth0 2>/dev/null + udhcpc -b -q $vci -s /usr/share/udhcpc/default.script -i $nwif 2>/dev/null ;; esac echo "dhcp finished at $(sysup)" > /tmp/dhcp-done |