wok-6.x rev 13091
get-wifi-firmware: remove hard coded version
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Jun 26 11:55:39 2012 +0200 (2012-06-26) |
parents | 905806138e79 |
children | 07ef0746e8fc |
files | get-wifi-firmware/receipt get-wifi-firmware/stuff/get-wifi-firmware |
line diff
1.1 --- a/get-wifi-firmware/receipt Tue Jun 26 02:47:04 2012 +0000 1.2 +++ b/get-wifi-firmware/receipt Tue Jun 26 11:55:39 2012 +0200 1.3 @@ -12,23 +12,11 @@ 1.4 { 1.5 mkdir -p $fs/usr/bin 1.6 cp stuff/$PACKAGE $fs/usr/bin 1.7 - for i in b43 b43legacy ipw2100 ipw2200 rt61 rt73 rt2860 zd1211 \ 1.8 - rt61pci rt73usb rt2870usb zd1211rw \ 1.9 - iwlwifi-3945 iwlwifi-4965 iwlwifi-5000 iwlwifi-5150 iwlwifi-1000 iwlwifi-6000; do 1.10 - ln -s $PACKAGE $fs/usr/bin/get-$i-firmware 1.11 - done 1.12 + $fs/usr/bin/$PACKAGE --install 1.13 } 1.14 1.15 post_install() 1.16 { 1.17 - # directly support some freely distributable firmware drivers 1.18 - # intel 1.19 - rootfs=$1 1.20 - get-iwlwifi-3945-firmware --firmware $rootfs 1.21 - get-iwlwifi-4965-firmware --firmware $rootfs 1.22 - get-iwlwifi-5000-firmware --firmware $rootfs 1.23 - # ralink 1.24 - get-rt61-firmware --firmware $rootfs 1.25 - get-rt73-firmware --firmware $rootfs 1.26 - get-rt2870usb-firmware --firmware $rootfs 1.27 + # directly support some freely distributable firmware drivers 1.28 + chroot $1 /usr/bin/get-wifi-firmware --get-free-firmware 1.29 }
2.1 --- a/get-wifi-firmware/stuff/get-wifi-firmware Tue Jun 26 02:47:04 2012 +0000 2.2 +++ b/get-wifi-firmware/stuff/get-wifi-firmware Tue Jun 26 11:55:39 2012 +0200 2.3 @@ -5,6 +5,31 @@ 2.4 ROOT="$2" 2.5 PKG=$MODULE-firmware 2.6 DEPENDS="" 2.7 + 2.8 +MODULE_LIST="" 2.9 +while read module desc ; do 2.10 + [ "$MODULE" == "$module" ] && desc="$SHORT_DESC" 2.11 + MODULE_LIST="$MODULE_LIST $module" 2.12 +done <<EOT 2.13 +b43 Broadcom $MODULE firmware. 2.14 +b43legacy Broadcom $MODULE firmware (BCM4306 rev2 or 802.11b chips). 2.15 +ipw2100 Intel PRO/Wireless 2100 firmware. 2.16 +ipw2200 Intel PRO/Wireless 2200BG firmware. 2.17 +iwlwifi-3945 Intel PRO/Wireless 3945ABG/BG firmware. 2.18 +iwlwifi-4965 Intel WiFi Link 4965AGN firmware. 2.19 +iwlwifi-5000 Intel Wireless WiFi Link 5000AGN firmware. 2.20 +iwlwifi-5150 Intel Wireless WiFi Link 5150AGN firmware. 2.21 +iwlwifi-1000 Intel Wireless WiFi Link 1000BGN firmware. 2.22 +iwlwifi-6000 Intel Wireless WiFi Link 6000 Series Wi-fi Adapters. 2.23 +rt61 new RT2x00 RT61 Wireless Lan firmware. 2.24 +rt61pci new RT2x00 RT61 Wireless Lan firmware. 2.25 +rt73 new RT2x00 RT73(RT2571W) Wireless Lan firmware. 2.26 +rt73usb new RT2x00 RT73(RT2571W) Wireless Lan firmware. 2.27 +rt2870usb RaLink RT2870USB (RT2870/RT2770) WiFi adapter. 2.28 +zd1211 zd1211/zd1211rw Wireless Lan firmware. 2.29 +zd1211rw zd1211/zd1211rw Wireless Lan firmware. 2.30 +EOT 2.31 + 2.32 case "$MODULE" in 2.33 b43) 2.34 WEB_SITE="http://www.linuxwireless.org/en/users/Drivers/b43" 2.35 @@ -13,7 +38,6 @@ 2.36 '/broadcom-wl-[0-9\.]*.tar/!d;s/.*com-wl-\([0-9\.]*\).tar.*/\1/' | \ 2.37 tail -n 1) 2.38 SUBDIR="broadcom-wl-$VERSION" 2.39 - SHORT_DESC="Broadcom $MODULE firmware." 2.40 WGET_URL="$WGET_URL/$SUBDIR.tar.bz2" 2.41 DEPENDS="b43-fwcutter" 2.42 FWSET=wl_apsta_mimo.o 2.43 @@ -22,84 +46,47 @@ 2.44 WEB_SITE="http://downloads.openwrt.org/" 2.45 VERSION=$(wget -O - ${WEB_SITE}sources | sed \ 2.46 '/wl_apsta/!d;s/.*>wl_apsta-\(.*\).o.*/\1/') 2.47 - SHORT_DESC="Broadcom $MODULE firmware (BCM4306 rev2 or 802.11b chips)." 2.48 WGET_URL="${WEB_SITE}sources/wl_apsta-$VERSION.o" 2.49 DEPENDS="b43-fwcutter" 2.50 FWSET=wl_apsta-$VERSION.o 2.51 ;; 2.52 ipw2100) 2.53 - VERSION=1.3 2.54 - SHORT_DESC="Intel PRO/Wireless 2100 firmware." 2.55 + VERSION=$(wget -O - http://$MODULE.sourceforge.net/firmware.php?fid=2 |\ 2.56 + sed '/$MODULE-fw/!d;s/.*fw-\(.*\).tgz.*/\1/') 2.57 WEB_SITE="http://$MODULE.sourceforge.net/" 2.58 WGET_URL="http://bughost.org/firmware/${MODULE}-fw-${VERSION}.tgz" 2.59 ;; 2.60 ipw2200) 2.61 - VERSION=3.1 2.62 - SHORT_DESC="Intel PRO/Wireless 2200BG firmware." 2.63 + VERSION=$(wget -O - http://$MODULE.sourceforge.net/firmware.php?fid=8 |\ 2.64 + sed '/$MODULE-fw/!d;s/.*fw-\(.*\).tgz.*/\1/') 2.65 WEB_SITE="http://$MODULE.sourceforge.net/" 2.66 WGET_URL="http://bughost.org/firmware/${MODULE}-fw-${VERSION}.tgz" 2.67 ;; 2.68 -iwlwifi-3945) 2.69 +iwlwifi-*) 2.70 WEB_SITE="http://www.intellinuxwireless.org/?n=Downloads" 2.71 VERSION=$(wget -O - $WEB_SITE | sed -e "/$MODULE-/!d" -e \ 2.72 's/.*-ucode-\([0-9\.-]*\).t.*/\1/;q') 2.73 - SHORT_DESC="Intel PRO/Wireless 3945ABG/BG firmware." 2.74 WGET_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$MODULE-ucode-$VERSION.tgz" 2.75 ;; 2.76 -iwlwifi-4965) 2.77 - WEB_SITE="http://www.intellinuxwireless.org/?n=Downloads" 2.78 - VERSION=$(wget -O - $WEB_SITE | sed -e "/$MODULE-/!d" -e \ 2.79 - 's/.*-ucode-\([0-9\.-]*\).t.*/\1/;q') 2.80 - SHORT_DESC="Intel WiFi Link 4965AGN firmware." 2.81 - WGET_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$MODULE-ucode-$VERSION.tgz" 2.82 +rt61*) 2.83 + WGET_URL="http://archlinux.c3sl.ufpr.br/other/rt2x00-rt61-fw" 2.84 + VERSION=$(wget -O - $WGET_URL | sed '/Firmware/!d;s/.*_V\(.*\).zip.*/\1/') 2.85 + WEB_SITE="http://www.ralinktech.com/" 2.86 + WGET_URL="$WGET_URL/RT61_Firmware_V${VERSION}.zip" 2.87 ;; 2.88 -iwlwifi-5000) 2.89 - WEB_SITE="http://www.intellinuxwireless.org/?n=Downloads" 2.90 - VERSION=$(wget -O - $WEB_SITE | sed -e "/$MODULE-/!d" -e \ 2.91 - 's/.*-ucode-\([0-9\.-]*\).t.*/\1/;q') 2.92 - SHORT_DESC="Intel Wireless WiFi Link 5000AGN firmware." 2.93 - WGET_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$MODULE-ucode-$VERSION.tgz" 2.94 - ;; 2.95 -iwlwifi-5150) 2.96 - WEB_SITE="http://www.intellinuxwireless.org/?n=Downloads" 2.97 - VERSION=$(wget -O - $WEB_SITE | sed -e "/$MODULE-/!d" -e \ 2.98 - 's/.*-ucode-\([0-9\.-]*\).t.*/\1/;q') 2.99 - SHORT_DESC="Intel Wireless WiFi Link 5150AGN firmware." 2.100 - WGET_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$MODULE-ucode-$VERSION.tgz" 2.101 - ;; 2.102 -iwlwifi-1000) 2.103 - WEB_SITE="http://www.intellinuxwireless.org/?n=Downloads" 2.104 - VERSION=$(wget -O - $WEB_SITE | sed -e "/$MODULE-/!d" -e \ 2.105 - 's/.*-ucode-\([0-9\.-]*\).t.*/\1/;q') 2.106 - SHORT_DESC="Intel Wireless WiFi Link 1000BGN firmware." 2.107 - WGET_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$MODULE-ucode-$VERSION.tgz" 2.108 - ;; 2.109 -iwlwifi-6000) 2.110 - WEB_SITE="http://www.intellinuxwireless.org/?n=Downloads" 2.111 - VERSION=$(wget -O - $WEB_SITE | sed -e "/$MODULE-/!d" -e \ 2.112 - 's/.*-ucode-\([0-9\.-]*\).t.*/\1/;q') 2.113 - SHORT_DESC="Intel Wireless WiFi Link 6000 Series Wi-fi Adapters" 2.114 - WGET_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$MODULE-ucode-$VERSION.tgz" 2.115 - ;; 2.116 -rt61|rt61pci) 2.117 - VERSION=1.2 2.118 - SHORT_DESC="new RT2x00 RT61 Wireless Lan firmware." 2.119 +rt73*) 2.120 + WGET_URL="http://archlinux.c3sl.ufpr.br/other/rt2x00-rt71w-fw" 2.121 + VERSION=$(wget -O - $WGET_URL | sed '/Firmware/!d;s/.*_V\(.*\).zip.*/\1/') 2.122 WEB_SITE="http://www.ralinktech.com/" 2.123 - WGET_URL="ftp://ftp.archlinux.org/other/rt2x00-rt61-fw/RT61_Firmware_V${VERSION}.zip" 2.124 - ;; 2.125 -rt73|rt73usb) 2.126 - VERSION=1.8 2.127 - SHORT_DESC="new RT2x00 RT73(RT2571W) Wireless Lan firmware." 2.128 - WEB_SITE="http://www.ralinktech.com/" 2.129 - WGET_URL="ftp://ftp.archlinux.org/other/rt2x00-rt71w-fw/RT71W_Firmware_V${VERSION}.zip" 2.130 + WGET_URL="$WGET_URL/RT71W_Firmware_V${VERSION}.zip" 2.131 ;; 2.132 rt2870usb) 2.133 - VERSION=8 2.134 - SHORT_DESC="RaLink RT2870USB (RT2870/RT2770) WiFi adapter." 2.135 + WGET_URL="http://archlinux.c3sl.ufpr.br/other/${MODULE}-fw" 2.136 + VERSION=$(wget -O - $WGET_URL | sed '/Firmware/!d;s/.*_V\(.*\).zip.*/\1/') 2.137 WEB_SITE="http://www.ralinktech.com/" 2.138 - WGET_URL="ftp://ftp.archlinux.org/other/${MODULE}-fw/RT2870_Firmware_V${VERSION}.zip" 2.139 + WGET_URL="$WGET_URL/RT2870_Firmware_V${VERSION}.zip" 2.140 ;; 2.141 -zd1211|zd1211rw) 2.142 +zd1211*) 2.143 WGET_URL="http://mirrors.kernel.org/debian/pool/non-free/z/zd1211-firmware" 2.144 VERSION=$(wget -O - $WGET_URL | sed -e '/zd1211-firmware/!d' \ 2.145 -e '/all.deb/!d' -e 's/.*>zd1211-firmware_\(.*\)_all.deb.*/\1/') 2.146 @@ -107,7 +94,23 @@ 2.147 WEB_SITE="http://packages.debian.org/etch/zd1211-firmware" 2.148 WGET_URL="$WGET_URL/zd1211-firmware_${VERSION}_all.deb" 2.149 ;; 2.150 -*) echo "Unknown wifi driver. Please run one of the following commands:" 2.151 +*) 2.152 + case "$2" in 2.153 + --install) 2.154 + cd $(dirname $0) 2.155 + for i in $MODULE_LIST ; do 2.156 + ln -s get-wifi-firmware get-$i-firmware 2.157 + done 2.158 + exit 0 ;; 2.159 + --get-free-firmware) 2.160 + for i in $MODULE_LIST ; do 2.161 + case "$i" in 2.162 + iwlwifi*|rt*) get-$i-firmware 2.163 + esac 2.164 + done 2.165 + exit 0 ;; 2.166 + esac 2.167 + echo "Unknown wifi driver. Please run one of the following commands:" 2.168 for i in $(cd $(dirname $0); ls get-*-firmware); do 2.169 [ -L $i ] || continue 2.170 [ "$(readlink $i)" = "get-wifi-firmware" ] || continue 2.171 @@ -144,7 +147,7 @@ 2.172 cd $TMP 2.173 wget $WGET_URL 2.174 TARBALL="$(basename $WGET_URL)" 2.175 -if [ ! -f $TARBALL ]; then 2.176 +if [ ! -s $TARBALL ]; then 2.177 cd $TOP 2.178 rm -rf $DIR 2.179 echo "Could not download $TARBALL. Exiting." 2.180 @@ -174,7 +177,7 @@ 2.181 mv RT*_Firmware_V$VERSION/*LICENSE* $PKG-$VERSION/fs/usr/share/licenses/ralink-rt61-LICENSE.txt;; 2.182 iwlwifi*) mv iwlwifi*/iwlwifi*.ucode $PKG-$VERSION/fs/lib/firmware 2.183 mv iwlwifi*/*LICENSE* $PKG-$VERSION/fs/usr/share/licenses/intel-iwlwifi-LICENSE.txt ;; 2.184 -zd1211|zd1211rw) 2.185 +zd1211*) 2.186 mv lib/firmware/zd1211 $PKG-$VERSION/fs/lib/firmware 2.187 for i in $(cd usr/lib/hotplug/firmware; ls); do 2.188 target=$(readlink usr/lib/hotplug/firmware/$i)