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