wok view 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
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"
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/b43legacy-firmware ]; then
22 echo -e "\nb43legacy-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 || exit
37 #tar xjf $TARBALL
38 #cd $DIR-$VERSION/
40 # Create pseudo package
41 mkdir -p b43legacy-firmware-$VERSION/fs/lib/firmware
42 b43-fwcutter -w "b43legacy-firmware-$VERSION/fs/lib/firmware" wl_apsta-3.130.20.0.o
44 # Creat receipt
45 cat > b43legacy-firmware-$VERSION/receipt <<EOT
46 PACKAGE="b43legacy-firmware"
47 VERSION="$VERSION"
48 CATEGORY="non-free"
49 SHORT_DESC="Broadcom b43legacy firmware."
50 DEPENDS="b43-fwcutter"
51 WEB_SITE="http://downloads.openwrt.org/"
52 EOT
54 # Pack
55 tazpkg pack b43legacy-firmware-$VERSION
57 # Install pseudo package
58 tazpkg install b43legacy-firmware-$VERSION.tazpkg
60 # Clean
61 cd /tmp
62 rm -rf $TARBALL $DIR-$VERSION
64 # Load b43legacy module
65 echo "Loading module: b43legacy..."
66 modprobe b43legacy
67 sleep 1
69 # Configure /etc/network.conf and start connexion
70 sed -i s/'WIFI="no"'/'WIFI="yes"'/ /etc/network.conf
71 . /etc/network.conf
73 iwconfig $WIFI_INTERFACE essid $ESSID
74 echo "Starting udhcpc client on: $WIFI_INTERFACE... "
75 /sbin/udhcpc -b -i $WIFI_INTERFACE \
76 -p /var/run/udhcpc.$WIFI_INTERFACE.pid