wok diff get-b43legacy-firmware/stuff/get-b43legacy-firmware @ rev 987
fix: Fix build deps and compile
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Thu Jul 03 22:38:09 2008 +0200 (2008-07-03) |
parents | |
children | 784c95ed7cd7 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/get-b43legacy-firmware/stuff/get-b43legacy-firmware Thu Jul 03 22:38:09 2008 +0200 1.3 @@ -0,0 +1,77 @@ 1.4 +#!/bin/sh 1.5 +# 1.6 +# Get and install non-free Broadcom b43 firmware. The script wil also 1.7 +# install linux-wireless and b43-fwcutter if needed. Finaly try to 1.8 +# configure wlan0 interface. 1.9 +# 1.10 + 1.11 +DIR="wl_apsta" 1.12 +VERSION=3.130.20.0 1.13 +TARBALL=$DIR-$VERSION.o 1.14 +WGET_URL="http://downloads.openwrt.org/sources/$TARBALL" 1.15 + 1.16 +# Check if user is root to install. 1.17 +if test $(id -u) != 0 ; then 1.18 + echo -e "\nYou must be root to run `basename $0`." 1.19 + echo -e "Please use 'su' and root password to become super-user.\n" 1.20 + exit 0 1.21 +fi 1.22 + 1.23 +# Avoid reinstall 1.24 +if [ -d /var/lib/tazpkg/installed/b43legacy-firmware ]; then 1.25 + echo -e "\nb43legacy-firmware package is already installed.\n" 1.26 + exit 0 1.27 +fi 1.28 + 1.29 +# We need drivers, the extractor and tools. 1.30 +for pkg in linux-wireless b43-fwcutter wireless_tools 1.31 +do 1.32 + if [ ! -d /var/lib/tazpkg/installed/$pkg ]; then 1.33 + tazpkg get-install $pkg 1.34 + fi 1.35 +done 1.36 + 1.37 +# Get files 1.38 +cd /tmp 1.39 +wget $WGET_URL || exit 1.40 +#tar xjf $TARBALL 1.41 +#cd $DIR-$VERSION/ 1.42 + 1.43 +# Create pseudo package 1.44 +mkdir -p b43legacy-firmware-$VERSION/fs/lib/firmware 1.45 +b43-fwcutter -w "b43legacy-firmware-$VERSION/fs/lib/firmware" wl_apsta-3.130.20.0.o 1.46 + 1.47 +# Creat receipt 1.48 +cat > b43legacy-firmware-$VERSION/receipt <<EOT 1.49 +PACKAGE="b43legacy-firmware" 1.50 +VERSION="$VERSION" 1.51 +CATEGORY="non-free" 1.52 +SHORT_DESC="Broadcom b43legacy firmware." 1.53 +DEPENDS="b43-fwcutter" 1.54 +WEB_SITE="http://downloads.openwrt.org/" 1.55 +EOT 1.56 + 1.57 +# Pack 1.58 +tazpkg pack b43legacy-firmware-$VERSION 1.59 + 1.60 +# Install pseudo package 1.61 +tazpkg install b43legacy-firmware-$VERSION.tazpkg 1.62 + 1.63 +# Clean 1.64 +cd /tmp 1.65 +rm -rf $TARBALL $DIR-$VERSION 1.66 + 1.67 +# Load b43legacy module 1.68 +echo "Loading module: b43legacy..." 1.69 +modprobe b43legacy 1.70 +sleep 1 1.71 + 1.72 +# Configure /etc/network.conf and start connexion 1.73 +sed -i s/'WIFI="no"'/'WIFI="yes"'/ /etc/network.conf 1.74 +. /etc/network.conf 1.75 + 1.76 +iwconfig $WIFI_INTERFACE essid $ESSID 1.77 +echo "Starting udhcpc client on: $WIFI_INTERFACE... " 1.78 +/sbin/udhcpc -b -i $WIFI_INTERFACE \ 1.79 + -p /var/run/udhcpc.$WIFI_INTERFACE.pid 1.80 +