wok view get-b43-firmware/stuff/get-b43-firmware @ rev 1616

Add perl-getopt-long
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Oct 19 21:40:44 2008 +0000 (2008-10-19)
parents 784c95ed7cd7
children e01dd228942a
line source
1 #!/bin/sh
2 #
3 # Get and install non-free Broadcom b43 firmware. The script wil also
4 # install linux-wireless and b43-fwcutter if needed. Finaly try to
5 # configure wlan0 interface.
6 #
8 DIR="broadcom-wl"
9 VERSION=4.80.53.0
10 TARBALL=$DIR-$VERSION.tar.bz2
11 WGET_URL="http://downloads.openwrt.org/sources/$TARBALL"
13 # Check if user is root to install.
14 if test $(id -u) != 0 ; then
15 echo -e "\nYou must be root to run `basename $0`."
16 echo -e "Please use 'su' and root password to become super-user.\n"
17 exit 0
18 fi
20 # Avoid reinstall
21 if [ -d /var/lib/tazpkg/installed/b43-firmware ]; then
22 echo -e "\nb43-firmware package is already installed.\n"
23 exit 0
24 fi
26 # We need drivers, the extractor and tools.
27 for pkg in linux-wireless b43-fwcutter wireless_tools
28 do
29 if [ ! -d /var/lib/tazpkg/installed/$pkg ]; then
30 tazpkg get-install $pkg
31 fi
32 done
34 # Get files
35 cd /tmp
36 wget $WGET_URL
37 tar xjf $TARBALL
38 cd $DIR-$VERSION/kmod
40 # Create pseudo package
41 mkdir -p b43-firmware-$VERSION/fs/lib/firmware
42 b43-fwcutter -w "b43-firmware-$VERSION/fs/lib/firmware" wl_apsta.o
44 # Creat receipt
45 cat > b43-firmware-$VERSION/receipt <<EOT
46 PACKAGE="b43-firmware"
47 VERSION="$VERSION"
48 CATEGORY="non-free"
49 SHORT_DESC="Broadcom b43 firmware."
50 DEPENDS="b43-fwcutter"
51 WEB_SITE="http://downloads.openwrt.org/"
52 EOT
54 # Pack
55 tazpkg pack b43-firmware-$VERSION
57 # Install pseudo package
58 tazpkg install b43-firmware-$VERSION.tazpkg
60 # Clean
61 cd /tmp
62 rm -rf $TARBALL $DIR-$VERSION
64 # Load b43 module
65 echo "Loading module: b43..."
66 modprobe b43
67 sleep 1
69 # Configure /etc/network.conf and start connexion
70 sed -i s/'WIFI="no"'/'WIFI="yes"'/ /etc/network.conf
71 /etc/init.d/network.sh restart