wok annotate get-b43legacy-firmware/stuff/get-b43legacy-firmware @ rev 1773
hardinfo: fix usb
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Nov 28 17:23:48 2008 +0000 (2008-11-28) |
parents | c56a51e96041 |
children |
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" |
pascal@1713 | 12 ROOT="$1" |
erjo@985 | 13 |
erjo@985 | 14 # Check if user is root to install. |
erjo@985 | 15 if test $(id -u) != 0 ; then |
erjo@985 | 16 echo -e "\nYou must be root to run `basename $0`." |
erjo@985 | 17 echo -e "Please use 'su' and root password to become super-user.\n" |
erjo@985 | 18 exit 0 |
erjo@985 | 19 fi |
erjo@985 | 20 |
erjo@985 | 21 # Avoid reinstall |
pascal@1713 | 22 if [ -d $ROOT/var/lib/tazpkg/installed/b43legacy-firmware ]; then |
erjo@985 | 23 echo -e "\nb43legacy-firmware package is already installed.\n" |
erjo@985 | 24 exit 0 |
erjo@985 | 25 fi |
erjo@985 | 26 |
erjo@985 | 27 # We need drivers, the extractor and tools. |
erjo@985 | 28 for pkg in linux-wireless b43-fwcutter wireless_tools |
erjo@985 | 29 do |
erjo@985 | 30 if [ ! -d /var/lib/tazpkg/installed/$pkg ]; then |
erjo@985 | 31 tazpkg get-install $pkg |
erjo@985 | 32 fi |
erjo@985 | 33 done |
erjo@985 | 34 |
erjo@985 | 35 # Get files |
erjo@985 | 36 cd /tmp |
erjo@985 | 37 wget $WGET_URL || exit |
erjo@985 | 38 #tar xjf $TARBALL |
erjo@985 | 39 #cd $DIR-$VERSION/ |
erjo@985 | 40 |
erjo@985 | 41 # Create pseudo package |
erjo@985 | 42 mkdir -p b43legacy-firmware-$VERSION/fs/lib/firmware |
erjo@985 | 43 b43-fwcutter -w "b43legacy-firmware-$VERSION/fs/lib/firmware" wl_apsta-3.130.20.0.o |
erjo@985 | 44 |
erjo@985 | 45 # Creat receipt |
erjo@985 | 46 cat > b43legacy-firmware-$VERSION/receipt <<EOT |
erjo@985 | 47 PACKAGE="b43legacy-firmware" |
erjo@985 | 48 VERSION="$VERSION" |
erjo@985 | 49 CATEGORY="non-free" |
erjo@985 | 50 SHORT_DESC="Broadcom b43legacy firmware." |
pascal@1713 | 51 DEPENDS="linux-wireless b43-fwcutter wireless_tools" |
erjo@985 | 52 WEB_SITE="http://downloads.openwrt.org/" |
erjo@985 | 53 EOT |
erjo@985 | 54 |
erjo@985 | 55 # Pack |
erjo@985 | 56 tazpkg pack b43legacy-firmware-$VERSION |
erjo@985 | 57 |
erjo@985 | 58 # Install pseudo package |
pascal@1713 | 59 tazpkg install b43legacy-firmware-$VERSION.tazpkg --root=$ROOT |
erjo@985 | 60 |
erjo@985 | 61 # Clean |
erjo@985 | 62 cd /tmp |
erjo@985 | 63 rm -rf $TARBALL $DIR-$VERSION |
erjo@985 | 64 |
erjo@985 | 65 # Load b43legacy module |
pascal@1713 | 66 if [ -z "$ROOT" ]; then |
pascal@1713 | 67 echo "Loading module: b43legacy..." |
pascal@1713 | 68 modprobe b43legacy |
pascal@1713 | 69 sleep 1 |
pascal@1713 | 70 fi |
erjo@985 | 71 |
erjo@985 | 72 # Configure /etc/network.conf and start connexion |
pascal@1713 | 73 sed -i s/'WIFI="no"'/'WIFI="yes"'/ $ROOT/etc/network.conf |
pascal@1713 | 74 [ -z "$ROOT" ] && /etc/init.d/network.sh restart |
erjo@985 | 75 |