wok annotate 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 |
rev | line source |
---|---|
erjo@985 | 1 #!/bin/sh |
erjo@985 | 2 # |
erjo@985 | 3 # Get and install non-free Broadcom b43 firmware. The script wil also |
erjo@985 | 4 # install linux-wireless and b43-fwcutter if needed. Finaly try to |
erjo@985 | 5 # configure wlan0 interface. |
erjo@985 | 6 # |
erjo@985 | 7 |
erjo@985 | 8 DIR="wl_apsta" |
erjo@985 | 9 VERSION=3.130.20.0 |
erjo@985 | 10 TARBALL=$DIR-$VERSION.o |
erjo@985 | 11 WGET_URL="http://downloads.openwrt.org/sources/$TARBALL" |
erjo@985 | 12 |
erjo@985 | 13 # Check if user is root to install. |
erjo@985 | 14 if test $(id -u) != 0 ; then |
erjo@985 | 15 echo -e "\nYou must be root to run `basename $0`." |
erjo@985 | 16 echo -e "Please use 'su' and root password to become super-user.\n" |
erjo@985 | 17 exit 0 |
erjo@985 | 18 fi |
erjo@985 | 19 |
erjo@985 | 20 # Avoid reinstall |
erjo@985 | 21 if [ -d /var/lib/tazpkg/installed/b43legacy-firmware ]; then |
erjo@985 | 22 echo -e "\nb43legacy-firmware package is already installed.\n" |
erjo@985 | 23 exit 0 |
erjo@985 | 24 fi |
erjo@985 | 25 |
erjo@985 | 26 # We need drivers, the extractor and tools. |
erjo@985 | 27 for pkg in linux-wireless b43-fwcutter wireless_tools |
erjo@985 | 28 do |
erjo@985 | 29 if [ ! -d /var/lib/tazpkg/installed/$pkg ]; then |
erjo@985 | 30 tazpkg get-install $pkg |
erjo@985 | 31 fi |
erjo@985 | 32 done |
erjo@985 | 33 |
erjo@985 | 34 # Get files |
erjo@985 | 35 cd /tmp |
erjo@985 | 36 wget $WGET_URL || exit |
erjo@985 | 37 #tar xjf $TARBALL |
erjo@985 | 38 #cd $DIR-$VERSION/ |
erjo@985 | 39 |
erjo@985 | 40 # Create pseudo package |
erjo@985 | 41 mkdir -p b43legacy-firmware-$VERSION/fs/lib/firmware |
erjo@985 | 42 b43-fwcutter -w "b43legacy-firmware-$VERSION/fs/lib/firmware" wl_apsta-3.130.20.0.o |
erjo@985 | 43 |
erjo@985 | 44 # Creat receipt |
erjo@985 | 45 cat > b43legacy-firmware-$VERSION/receipt <<EOT |
erjo@985 | 46 PACKAGE="b43legacy-firmware" |
erjo@985 | 47 VERSION="$VERSION" |
erjo@985 | 48 CATEGORY="non-free" |
erjo@985 | 49 SHORT_DESC="Broadcom b43legacy firmware." |
erjo@985 | 50 DEPENDS="b43-fwcutter" |
erjo@985 | 51 WEB_SITE="http://downloads.openwrt.org/" |
erjo@985 | 52 EOT |
erjo@985 | 53 |
erjo@985 | 54 # Pack |
erjo@985 | 55 tazpkg pack b43legacy-firmware-$VERSION |
erjo@985 | 56 |
erjo@985 | 57 # Install pseudo package |
erjo@985 | 58 tazpkg install b43legacy-firmware-$VERSION.tazpkg |
erjo@985 | 59 |
erjo@985 | 60 # Clean |
erjo@985 | 61 cd /tmp |
erjo@985 | 62 rm -rf $TARBALL $DIR-$VERSION |
erjo@985 | 63 |
erjo@985 | 64 # Load b43legacy module |
erjo@985 | 65 echo "Loading module: b43legacy..." |
erjo@985 | 66 modprobe b43legacy |
erjo@985 | 67 sleep 1 |
erjo@985 | 68 |
erjo@985 | 69 # Configure /etc/network.conf and start connexion |
erjo@985 | 70 sed -i s/'WIFI="no"'/'WIFI="yes"'/ /etc/network.conf |
erjo@985 | 71 . /etc/network.conf |
erjo@985 | 72 |
erjo@985 | 73 iwconfig $WIFI_INTERFACE essid $ESSID |
erjo@985 | 74 echo "Starting udhcpc client on: $WIFI_INTERFACE... " |
erjo@985 | 75 /sbin/udhcpc -b -i $WIFI_INTERFACE \ |
erjo@985 | 76 -p /var/run/udhcpc.$WIFI_INTERFACE.pid |
erjo@985 | 77 |