get-scripts view b43-firmware @ rev 47

firefox-official: fix paths
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jun 04 18:56:03 2015 +0200 (2015-06-04)
parents 6ca05e6839e1
children 2cdf3e534506
line source
1 SHORT_DESC="Install the firmware files for the wireless kernel module"
2 # end of get.list data
4 # install linux-wireless, wireless_tools and b43-fwcutter if needed.
6 MODULE=${PACKAGE%-firmware}
7 CATEGORY="non-free"
8 DEPENDS=""
10 MODULE_LIST=""
11 while read module desc ; do
12 [ "$MODULE" == "$module" ] && SHORT_DESC="$desc"
13 MODULE_LIST="$MODULE_LIST $module"
14 done <<EOT
15 b43 Broadcom $MODULE firmware.
16 b43legacy Broadcom $MODULE firmware (BCM4306 rev2 or 802.11b chips).
17 ipw2100 Intel PRO/Wireless 2100 firmware.
18 ipw2200 Intel PRO/Wireless 2200BG firmware.
19 iwlwifi-5000 Intel Wireless WiFi Link 5000AGN, 5300AGN and 5350AGN firmware.
20 iwlwifi-5150 Intel Wireless WiFi Link 5150AGN firmware.
21 iwlwifi-100 Intel Wireless WiFi Link 100N firmware.
22 iwlwifi-105 Intel Wireless WiFi Link 105N firmware.
23 iwlwifi-135 Intel Wireless WiFi Link 135N firmware.
24 iwlwifi-1000 Intel Wireless WiFi Link 1000N firmware.
25 iwlwifi-2000 Intel Wireless WiFi Link 2200 Series Wi-fi Adapters.
26 iwlwifi-2030 Intel Wireless WiFi Link 2230 Series Wi-fi Adapters.
27 iwlwifi-6000gda Intel Wireless WiFi Link 6000 Series Wi-fi Adapters.
28 iwlwifi-6000gdb Intel Wireless WiFi Link 6000 Series Wi-fi Adapters.
29 iwlwifi-6000 Intel Wireless WiFi Link 6000 Series Wi-fi Adapters.
30 iwlwifi-6050 Intel Wireless WiFi Link 6050 Series Wi-fi Adapters.
31 rt61 new RT2x00 RT61 Wireless Lan firmware.
32 rt61pci new RT2x00 RT61 Wireless Lan firmware.
33 rt73 new RT2x00 RT73(RT2571W) Wireless Lan firmware.
34 rt73usb new RT2x00 RT73(RT2571W) Wireless Lan firmware.
35 rt2870usb RaLink RT2870USB (RT2870/RT2770) WiFi adapter.
36 zd1211 zd1211/zd1211rw Wireless Lan firmware.
37 zd1211rw zd1211/zd1211rw Wireless Lan firmware.
38 EOT
40 case "$MODULE" in
41 b43)
42 WEB_SITE="http://www.linuxwireless.org/en/users/Drivers/b43"
43 WGET_URL="http://mirror2.openwrt.org/sources"
44 VERSION=$(wget -O - $WGET_URL | sed \
45 '/broadcom-wl-[0-9\.]*.tar/!d;s/.*com-wl-\([0-9\.]*\).tar.*/\1/' | \
46 tail -n 1)
47 SUBDIR="broadcom-wl-$VERSION"
48 WGET_URL="$WGET_URL/$SUBDIR.tar.bz2"
49 DEPENDS="b43-fwcutter"
50 FWSET=wl_apsta.o
51 ;;
52 b43legacy)
53 WEB_SITE="http://downloads.openwrt.org/"
54 VERSION=$(wget -O - ${WEB_SITE}sources | sed \
55 '/wl_apsta/!d;s/.*>wl_apsta-\(.*\).o.*/\1/')
56 WGET_URL="${WEB_SITE}sources/wl_apsta-$VERSION.o"
57 DEPENDS="b43-fwcutter"
58 FWSET=wl_apsta-$VERSION.o
59 ;;
60 ipw2*)
61 WEB_SITE="http://wireless.kernel.org/en/users/Drivers/$MODULE"
62 VERSION=$(wget -O - $WEB_SITE | sed '/-fw/!d;s/.*-fw-\([^t]*\).t.*/\1/')
63 WGET_URL="$(wget -O - $WEB_SITE | sed '/-fw/!d;s/.*href="\([^"]*\).*/\1/')$MODULE-fw-$VERSION.tgz"
64 ;;
65 iwlwifi-*)
66 WEB_SITE="http://wireless.kernel.org/en/users/Drivers/iwlwifi/"
67 WGET_URL="$(wget -O - $WEB_SITE | sed '/-ucode-/!d;s/.*href="\([^"]*\).*/\1/;/'${MODULE%firmware}'/!d' | sed '$!d')"
68 VERSION="$(echo "$WGET_URL" | sed 's/.*-ucode-\(.*\).t.*/\1/')"
69 CATEGORY="base-system"
70 ;;
71 rt61*)
72 WGET_URL="http://archlinux.c3sl.ufpr.br/other/rt2x00-rt61-fw"
73 VERSION=$(wget -O - $WGET_URL | sed '/Firmware/!d;s/.*_V\(.*\).zip.*/\1/')
74 WEB_SITE="http://www.ralinktech.com/"
75 WGET_URL="$WGET_URL/RT61_Firmware_V${VERSION}.zip"
76 CATEGORY="base-system"
77 ;;
78 rt73*)
79 WGET_URL="http://archlinux.c3sl.ufpr.br/other/rt2x00-rt71w-fw"
80 VERSION=$(wget -O - $WGET_URL | sed '/Firmware/!d;s/.*_V\(.*\).zip.*/\1/')
81 WEB_SITE="http://www.ralinktech.com/"
82 WGET_URL="$WGET_URL/RT71W_Firmware_V${VERSION}.zip"
83 CATEGORY="base-system"
84 ;;
85 rt2870usb)
86 WGET_URL="http://archlinux.c3sl.ufpr.br/other/${MODULE}-fw"
87 VERSION=$(wget -O - $WGET_URL | sed '/Firmware/!d;s/.*_V\(.*\).zip.*/\1/')
88 WEB_SITE="http://www.ralinktech.com/"
89 WGET_URL="$WGET_URL/RT2870_Firmware_V${VERSION}.zip"
90 CATEGORY="base-system"
91 ;;
92 zd1211*)
93 WGET_URL="http://mirrors.kernel.org/debian/pool/non-free/z/zd1211-firmware"
94 VERSION=$(wget -O - $WGET_URL | sed -e '/zd1211-firmware/!d' \
95 -e '/all.deb/!d' -e 's/.*>zd1211-firmware_\(.*\)_all.deb.*/\1/')
96 SHORT_DESC="zd1211/zd1211rw Wireless Lan firmware."
97 WEB_SITE="http://packages.debian.org/etch/zd1211-firmware"
98 WGET_URL="$WGET_URL/zd1211-firmware_${VERSION}_all.deb"
99 ;;
100 esac
102 case "$WGET_URL" in
103 ftp*|http*) ;;
104 *) WGET_URL="${WEB_SITE%/}/$WGET_URL"
105 esac
107 # We need drivers, the extractor and tools.
108 for pkg in linux-wireless wireless_tools $DEPENDS
109 do
110 if [ ! -d $ROOT/var/lib/tazpkg/installed/$pkg ]; then
111 tazpkg get-install $pkg --root=$ROOT
112 fi
113 done
115 # Get files
116 wget $WGET_URL
117 TARBALL="$(basename $WGET_URL)"
118 [ -s $TARBALL ] || abort_package "Could not download $TARBALL. Exiting."
120 case "$WGET_URL" in
121 *rpm) rpm2cpio < $TARBALL | cpio -id;;
122 *deb) dpkg-deb -x $TARBALL . ;;
123 *bz2) tar xjf $TARBALL
124 cd $SUBDIR/linux;;
125 *tar.gz|*tgz) tar xzf $TARBALL;;
126 *zip) unzip $TARBALL;;
127 *o) ;;
128 esac
130 # Create pseudo package
131 mkdir -p $PACKAGE-$VERSION/fs/lib/firmware $PACKAGE-$VERSION/fs/usr/share/licenses
132 case "$MODULE" in
133 b43*) b43-fwcutter -w "$PACKAGE-$VERSION/fs/lib/firmware" $FWSET;;
134 ipw2200) cp ${MODULE}-fw-$VERSION/*LICENSE* $PACKAGE-$VERSION/fs/usr/share/licenses/intel-$MODULE-LICENSE.txt
135 mv ${MODULE}-fw-$VERSION/* $PACKAGE-$VERSION/fs/lib/firmware;;
136 ipw2100) cp *LICENSE* $PACKAGE-$VERSION/fs/usr/share/licenses/intel-$MODULE-LICENSE.txt
137 mv *.fw* *LICENSE* $PACKAGE-$VERSION/fs/lib/firmware;;
138 rt*)
139 mv RT*_Firmware_V$VERSION/*.bin $PACKAGE-$VERSION/fs/lib/firmware
140 mv RT*_Firmware_V$VERSION/*LICENSE* $PACKAGE-$VERSION/fs/usr/share/licenses/ralink-rt61-LICENSE.txt;;
141 iwlwifi*) mv iwlwifi*/iwlwifi*.ucode $PACKAGE-$VERSION/fs/lib/firmware
142 mv iwlwifi*/*LICENSE* $PACKAGE-$VERSION/fs/usr/share/licenses/intel-iwlwifi-LICENSE.txt ;;
143 zd1211*)
144 mv lib/firmware/zd1211 $PACKAGE-$VERSION/fs/lib/firmware ;;
145 esac
147 # Creat receipt
148 cat > $PACKAGE-$VERSION/receipt <<EOT
149 PACKAGE="$PACKAGE"
150 VERSION="$VERSION"
151 CATEGORY="$CATEGORY"
152 SHORT_DESC="$SHORT_DESC."
153 WEB_SITE="$WEB_SITE"
154 DEPENDS="linux-wireless wireless_tools $DEPENDS"
156 # Pre and post install commands for Tazpkg.
157 post_install()
158 {
159 echo -n "Configure wifi ? "
160 read -t 30 answer
161 case "\$answer" in
162 n*|N*) return
163 esac
165 echo "configuring and loading module ..."
166 # Check if we need wpa_supplicant
167 . \$1/etc/network.conf
168 if [ \$WIFI_KEY_TYPE = "wpa" ] || [ \$WIFI_KEY_TYPE = "WPA" ]; then
169 if [ ! -d \$1/var/lib/tazpkg/installed/wpa_supplicant ]; then
170 tazpkg get-install wpa_supplicant --root=\$1
171 fi
172 fi
174 # Configure /etc/network.conf and start connexion
175 sed -i s/'WIFI="no"'/'WIFI=&