From b081d2a92eca9b7180eea0d357b867999b76de76 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Thu, 31 May 2007 22:29:30 +0000 Subject: Stuff for WLAN boot (all testing). git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1125 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/initrd-stuff/etc/functions | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'initramfs/initrd-stuff/etc/functions') 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 -- cgit v1.2.3-55-g7522