Finalisation Wifi selon tests concluants du HP-Mini
authorgobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Thu, 10 Mar 2011 17:34:55 +0000 (17:34 +0000)
committergobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Thu, 10 Mar 2011 17:34:55 +0000 (17:34 +0000)
config/packages-list
config/sysinfos.default
config/sysinfos.hp-mini
stage2/bootscripts/ifdown
stage2/bootscripts/ifup
stage2/hv-install-2
stage2/install-bootscripts
stage2/misc/wireless [deleted file]
stage2/packages-update
stage2/pkg/firmware-b43-lpphy [new file with mode: 0644]
stage2/pkg/wireless-tools

index 4ec3513..b1a89f1 100644 (file)
@@ -82,6 +82,7 @@ FFMPEG="ffmpeg-svn-20539"
 FIREFOX="firefox-3.6.13"
 FILE_PKG="file-5.04"
 FINDUTILS="findutils-4.4.2"
+FIRMWARE_B43_LPPHY="broadcom-wl-4.178.10.4"
 FLAC="flac-1.2.1"
 FLEX="flex-2.5.35"
 FONTCONFIG="fontconfig-2.7.3"
index 88ea103..2bc1701 100644 (file)
@@ -44,6 +44,10 @@ DVDROM="yes"
 # Sound card support: yes or no
 SOUND_CARD="yes"
 
+# Wifi support
+#WIFI_SUPPORT="no"
+#FIRMWARE_B43_LPPHY="yes"
+
 # Keyboard mapping (example: us, cf)
 KEYBOARD="us"
 
index b8586b6..2cd2ff8 100644 (file)
@@ -26,8 +26,11 @@ XORG_VIDEO_DRIVER="intel"
 # Removable media drives. Comment if your system doesn't have one.
 DVDROM="no"
 
+WIFI_SUPPORT="yes"
+FIRMWARE_B43_LPPHY="yes"
+
 # General network settings
-INTERFACES="eth0"
+INTERFACES="eth0 wlan0"
 MACHINE_NAME="gresimuth"
 DOMAIN="mongol.com"
 LAN_NETWORK_MASK="192.168.1.0/24" # Utilise par sane in stage3
@@ -35,5 +38,8 @@ LAN_NETWORK_MASK="192.168.1.0/24" # Utilise par sane in stage3
 # Network interface card eth0 settings
 BOOTPROTO[0]="dhcp"
 
+# Network interface card wlan0 settings
+BOOTPROTO[1]="wifi"
+
 # Samba support
 USE_SAMBA="no"
index 115c488..a6fabf9 100755 (executable)
@@ -24,14 +24,13 @@ check_brctl()
 }
 
 # First make sure interface is available
-if ! ip link show ${DEVICE} ; then
+if ! ip link show ${DEVICE} 1> /dev/null 2>&1 ; then
     echo "Interface ${DEVICE} not available"
     exit ${EXIT_CODE_WARNING}
 fi
 
-if [ "x${BOOTPROTO}" = "xdhcp" ]; then
+if [ "x${BOOTPROTO}" = "xdhcp" -o "x${BOOTPROTO}" = "xwifi" ]; then
     # DHCP configuration
-
     # Load DHCP client parameters
     source /etc/sysconfig/network/dhcp-client
 
@@ -42,17 +41,21 @@ if [ "x${BOOTPROTO}" = "xdhcp" ]; then
     cmd_run_log ${DHCP_PROG} ${DHCP_STOP} ${DEVICE} || exit ${EXIT_CODE_FAILURE}
 elif [ x${BOOTPROTO} = "xstatic" ]; then
     # Static configuration
-    cmd_run_log ip addr flush ${DEVICE} &&
-    cmd_run_log ip link set ${DEVICE} down || exit ${EXIT_CODE_FAILURE}
+    cmd_run_log ip addr flush ${DEVICE} || exit ${EXIT_CODE_FAILURE}
 elif [ x${BOOTPROTO} = "xpppoe" ]; then
     # PPPoE configuration
     cmd_run_log pppoe-stop
-    cmd_run_log ip addr flush ${DEVICE} &&
-    cmd_run_log ip link set ${DEVICE} down || exit ${EXIT_CODE_FAILURE}
+    cmd_run_log ip addr flush ${DEVICE} || exit ${EXIT_CODE_FAILURE}
 else
     exit 1
 fi
 
+if [ "x${BOOTPROTO}" = "xwifi" ]; then
+    killall wpa_supplicant
+fi
+
+cmd_run_log ip link set ${DEVICE} down || exit ${EXIT_CODE_FAILURE}
+
 # Determining if the interface is part of a bridge:
 if [ -n "${BRIDGE_TO}" ]; then
     check_brctl
index b8fc5e8..b363046 100755 (executable)
@@ -23,23 +23,54 @@ check_brctl()
     fi
 }
 
-# First make sure interface is available
-if ! ip link show ${DEVICE} ; then
-    echo "Interface ${DEVICE} not available"
+# Make sure interface is available
+if ! ip link show ${DEVICE} > /dev/null 2>&1; then
+    echo "Interface ${1} not found"
     exit ${EXIT_CODE_WARNING}
 fi
 
 # Determining if the interface is a bridge:
 if [ "x${BRIDGE}" = "xyes" ]; then
     check_brctl
-    cmd_run_log ${BRCTL} addbr ${1} &&
-    cmd_run_log ${BRCTL} stp ${1} off || exit 1
+    cmd_run_log ${BRCTL} addbr ${DEVICE} &&
+    cmd_run_log ${BRCTL} stp ${DEVICE} off || exit 1
 fi
 
 # Determining if the interface is part of a bridge:
 if [ -n "${BRIDGE_TO}" ]; then
     check_brctl
-    cmd_run_log ${BRCTL} addif ${BRIDGE_TO} ${1} || exit 1
+    cmd_run_log ${BRCTL} addif ${BRIDGE_TO} ${DEVICE} || exit 1
+fi
+
+if [ "x${BOOTPROTO}" = "xwifi" ]; then
+    # Bring interface up
+    link_status=$(ip link show ${DEVICE})
+    if [ -n "${link_status}" ]; then
+        if ! echo "${link_status}" | grep -q UP; then
+            cmd_run_log ip link set ${DEVICE} up
+        fi
+    fi
+
+    if [ -f /var/run/wpa_supplicant/${DEVICE} ]; then
+        echo "Stopping previous wpa_supplicant"
+        killall wpa_supplicant
+        rm /var/run/wpa_supplicant/${DEVICE}
+    fi
+
+    wpa_supplicant -B -c /etc/wpa_supplicant.conf -i wlan0
+    count=0
+    while ! wpa_cli -i wlan0 status | grep "wpa_state=COMPLETED"; do
+        echo "Waiting for wpa_supplicant to complete"
+        sleep 1
+
+        let count=count+1
+        if [ $count -gt 10 ]; then
+            echo "wpa_supplicant failure"
+            exit ${EXIT_CODE_WARNING}
+        fi
+    done
+
+    BOOTPROTO=dhcp
 fi
 
 if [ "x${BOOTPROTO}" = "xdhcp" ]; then
index 12de7aa..7b4c8ad 100755 (executable)
@@ -36,9 +36,17 @@ ipkg ${UDEV}
 ipkg -m noac ${UDEV_CONFIG}
 ipkg ${GRUB}
 ipkg -m acnb ${DHCP}
-PREFIX=/usr ipkg -m noac -s wireless-tools ${WIRELESS_TOOLS}
-ipkg -m noac ${WPA_SUPPLICANT}
-PREFIX=/usr ipkg -m noac ${B43_FWCUTTER}
+
+if [ -n "${WIFI_SUPPORT}" ]; then
+    PREFIX=/usr ipkg -m noac -s wireless-tools ${WIRELESS_TOOLS}
+    ipkg -m noac ${WPA_SUPPLICANT}
+
+    if [ -n "${FIRMWARE_B43_LPPHY}" ]; then
+        PREFIX=/usr ipkg -m noac ${B43_FWCUTTER}
+        ipkg -s firmware-b43-lpphy ${FIRMWARE_B43_LPPHY}
+    fi
+fi
+
 ipkg ${NANO}
 
 rscr once "Installing HV-utilities" install-hv-utilities
index f0a45a3..63415ee 100755 (executable)
@@ -22,7 +22,8 @@ for nic_device in ${INTERFACES}; do
     echo "IFSCOPE=\"\"" >> ${file}
     echo "GATEWAY=\"${GATEWAY[${LOOP_INDEX}]}\"" >> ${file}
 
-    if [ "x${BOOTPROTO[${LOOP_INDEX}]}" = "xdhcp" ]; then
+    if [ "x${BOOTPROTO[${LOOP_INDEX}]}" = "xdhcp" -o \
+        "x${BOOTPROTO[${LOOP_INDEX}]}" = "xwifi" ]; then
        DHCP_USED="yes"
     fi
 
diff --git a/stage2/misc/wireless b/stage2/misc/wireless
deleted file mode 100755 (executable)
index c48ce2d..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#!/bin/sh
-########################################################################
-# Begin $network_devices/services/wireless
-#
-# Description : Wireless Handler
-#
-# Authors     : Joe Ciccone - joeciccone@crazyeyesoft.com
-#
-# Version     : 00.00
-#
-# Notes       :
-#
-########################################################################
-
-. /etc/sysconfig/rc 
-. ${rc_functions} 
-. ${IFCONFIG}
-
-if [ ! -d "${network_devices}/ssid" ]; then
-       boot_mesg "${network_devices}/ssid does not exist, cannot continue." ${FAILURE}
-       echo_failure
-       exit 1
-fi
-
-case "${2}" in
-       up)
-               if [ "${ESSID}" = "scan" ]; then
-                       for wnet in `iwlist ${1} scan | grep ESSID | cut -d: -f2 | cut -d'"' -f2` \
-                       `iwlist ${1} scan | grep Address | awk '{print $5}'`; do
-                               if [ -f "${network_devices}/ssid/${wnet}" ]; then
-                                       ESSID=${wnet}
-                                       break
-                               fi
-                       done
-               fi
-               
-               if [ -n "${OVERRIDE_ESSID}" ]; then
-                       ESSID=${OVERRIDE_ESSID}
-               fi
-               
-               if [ "${ESSID:-scan}" = "scan" ]; then
-                       boot_mesg "Could not find a configurable ssid for ${1}, cannot continue." ${FAILURE}
-                       echo_failure
-                       exit 1
-               else
-                       if [ ! -f "${network_devices}/ssid/${ESSID}" ]; then
-                               boot_mesg "Unable to open ${network_devices}/ssid/${ESSID}, cannot continue." ${FAIURE}
-                               echo_failure
-                               exit 1
-                       fi
-                       source ${network_devices}/ssid/${ESSID}
-               fi
-               
-               args1="essid ${ESSID}"
-               
-               if [ -n "${MODE}" ]; then
-                       args1="${args1} mode ${MODE}"
-               fi
-               
-               if [ -n "${FREQ}" ]; then
-                       args1="${args1} freq ${FREQ}"
-               fi
-               
-               if [ -n "${RATE}" ]; then
-                       args1="${args1} rate ${RATE}"
-               fi
-               
-               boot_mesg "Configuring ${1} for essid ${ESSID}"
-               iwconfig ${1} ${args1}
-               evaluate_retval
-
-               boot_mesg "Setting up ${TYPE} on ${1} ..."
-               case "${TYPE}" in
-                       wep)
-                               args2=""
-                               if [ -n "${KEY1}" ]; then
-                                       args2="key ${KEY1}"
-                               fi
-
-                               if [ -n "${KEY2}" ]; then
-                                       args2="${args2} key ${KEY2}"
-                               fi
-
-                               if [ -n "${KEY3}" ]; then
-                                       args2="${args2} key ${KEY3}"
-                               fi
-
-                               if [ -n "${KEY4}" ]; then
-                                       args2="${args2} key ${KEY4}"
-                               fi
-
-                               iwconfig ${1} ${args2}
-                               evaluate_retval
-                       ;;
-                       wpa)
-                               wpa_supplicant -Bw -c/etc/wpa_supplicant.conf -i${1}
-                       ;;
-                       *)
-                               boot_mesg "Unknown Type ${TYPE}, cannot continue." ${FAILURE}
-                               echo_failure
-                               exit 1
-                       ;;
-               esac
-               evaluate_retval
-       ;;
-       
-       down)
-       ;;
-       
-       *)
-               echo "Usage: ${0} [interface] {up|down}"
-               exit 1
-       ;;
-esac
-
-# End $network_devices/services/wireless
index bfe5154..479ffb8 100755 (executable)
@@ -66,10 +66,17 @@ fpkg -m gnu ${AUTOMAKE}
 fpkg -m gnu ${GROFF}
 fpkg ${IPROUTE2} \
     "http://devresources.linux-foundation.org/dev/iproute2/download"
-fpkg -e "tar.gz" ${WIRELESS_TOOLS} \
-    "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux"
-fpkg -e "tar.gz" ${WPA_SUPPLICANT} "http://hostap.epitest.fi/releases"
-fpkg ${B43_FWCUTTER} "http://bu3sch.de/b43/fwcutter"
+
+if [ -n "${WIFI_SUPPORT}" ]; then
+    fpkg -e "tar.gz" ${WIRELESS_TOOLS} \
+        "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux"
+    fpkg -e "tar.gz" ${WPA_SUPPLICANT} "http://hostap.epitest.fi/releases"
+
+    if [ -n "${FIRMWARE_B43_LPPHY}" ]; then
+        fpkg ${B43_FWCUTTER} "http://bu3sch.de/b43/fwcutter"
+        fpkg ${FIRMWARE_B43_LPPHY} "http://downloads.openwrt.org/sources"
+    fi
+fi
 
 fpkg -s "linux/utils/kbd" ${KBD} ${KERNEL_URL}
 fpkg -e "tar.gz" ${LESS} "http://www.greenwoodsoftware.com/less"
@@ -83,3 +90,4 @@ fpkg -e "tar.gz" ${GRUB} "ftp://alpha.gnu.org/gnu/grub"
 fpkg -e "tar.gz" ${DHCP} "ftp://ftp.isc.org/isc/dhcp/dhcp-3.0-history"
 
 exit $?
+
diff --git a/stage2/pkg/firmware-b43-lpphy b/stage2/pkg/firmware-b43-lpphy
new file mode 100644 (file)
index 0000000..fe05de2
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+hvbuild()
+{
+    local FIRMWARE_INSTALL_DIR="/lib/firmware"
+
+    cd ${LFS_TMP}/${PACKAGE}/linux
+
+    b43-fwcutter -w ${FIRMWARE_INSTALL_DIR} wl_apsta.o
+}
index 0d1821a..e72babc 100644 (file)
@@ -8,23 +8,6 @@ hvconfig_pre()
 
 hvbuild_post()
 {
+    echo "TODO: Configurer ssid"
     install -d -m755 /etc/sysconfig/network/ssid
-
-    #install -d -m755 /etc/sysconfig/network-devices/ifconfig.ath0 &&
-    #cat > /etc/sysconfig/network-devices/ifconfig.ath0/01-wireless << "EOF"
-#ONBOOT=yes
-#SERVICE=wireless
-#ESSID=scan
-#TYPE=wep
-#EOF
-
-#cat > /etc/sysconfig/network/ssid/[ssid] << "EOF"
-#MODE=Managed
-#KEY1=""
-#KEY2=""
-#KEY3=""
-#KEY4=""
-#EOF
-
-    install -v -m740 ${SCRDIR}/misc/wireless /etc/rc.d/init.d
 }