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"
# 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"
# 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
# Network interface card eth0 settings
BOOTPROTO[0]="dhcp"
+# Network interface card wlan0 settings
+BOOTPROTO[1]="wifi"
+
# Samba support
USE_SAMBA="no"
}
# 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
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
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
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
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
+++ /dev/null
-#!/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
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"
fpkg -e "tar.gz" ${DHCP} "ftp://ftp.isc.org/isc/dhcp/dhcp-3.0-history"
exit $?
+
--- /dev/null
+#!/bin/bash
+
+hvbuild()
+{
+ local FIRMWARE_INSTALL_DIR="/lib/firmware"
+
+ cd ${LFS_TMP}/${PACKAGE}/linux
+
+ b43-fwcutter -w ${FIRMWARE_INSTALL_DIR} wl_apsta.o
+}
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
}