wok view 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
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="wl_apsta"
9 VERSION=3.130.20.0
10 TARBALL=$DIR-$VERSION.o
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/b43legacy-firmware ]; then
23 echo -e "\nb43legacy-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 || exit
38 #tar xjf $TARBALL
39 #cd $DIR-$VERSION/
41 # Create pseudo package
42 mkdir -p b43legacy-firmware-$VERSION/fs/lib/firmware
43 b43-fwcutter -w "b43legacy-firmware-$VERSION/fs/lib/firmware" wl_apsta-3.130.20.0.o
45 # Creat receipt
46 cat > b43legacy-firmware-$VERSION/receipt <<EOT
47 PACKAGE="b43legacy-firmware"
48 VERSION="$VERSION"
49 CATEGORY="non-free"
50 SHORT_DESC="Broadcom b43legacy firmware."
51 DEPENDS="linux-wireless b43-fwcutter wireless_tools"
52 WEB_SITE="http://downloads.openwrt.org/"
53 EOT
55 # Pack
56 tazpkg pack b43legacy-firmware-$VERSION
58 # Install pseudo package
59 tazpkg install b43legacy-firmware-$VERSION.tazpkg --root=$ROOT
61 # Clean
62 cd /tmp
63 rm -rf $TARBALL $DIR-$VERSION
65 # Load b43legacy module
66 if [ -z "$ROOT" ]; then
67 echo "Loading module: b43legacy..."
68 modprobe b43legacy
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