SHORT_DESC="Install the firmware files for the wireless kernel module" # end of get.list data # install linux-wireless, wireless_tools and b43-fwcutter if needed. MODULE=${PACKAGE%-firmware} CATEGORY="non-free" MODULE_LIST="" while read module desc ; do [ "$MODULE" = "$module" ] && SHORT_DESC="$desc" MODULE_LIST="$MODULE_LIST $module" done <wl_apsta-\(.*\).o.*/\1/') WGET_URL="${WEB_SITE}sources/wl_apsta-$VERSION.o" DEPENDS="b43-fwcutter" FWSET=wl_apsta-$VERSION.o ;; ipw2*) WEB_SITE="http://wireless.kernel.org/en/users/Drivers/$MODULE" VERSION=$(wget -O - $WEB_SITE | sed '/-fw/!d;s/.*-fw-\([^t]*\).t.*/\1/') WGET_URL="$(wget -O - $WEB_SITE | sed '/-fw/!d;s/.*href="\([^"]*\).*/\1/')$MODULE-fw-$VERSION.tgz" ;; iwlwifi-*) WEB_SITE="http://wireless.kernel.org/en/users/Drivers/iwlwifi/" WGET_URL="$(wget -O - $WEB_SITE | sed '/-ucode-/!d;s/.*href="\([^"]*\).*/\1/;/'${MODULE%firmware}'/!d' | sed '$!d')" VERSION="$(echo "$WGET_URL" | sed 's/.*-ucode-\(.*\).t.*/\1/')" CATEGORY="base-system" ;; rt61*) WGET_URL="http://archlinux.c3sl.ufpr.br/other/rt2x00-rt61-fw" VERSION=$(wget -O - $WGET_URL | sed '/Firmware/!d;s/.*_V\(.*\).zip.*/\1/') WEB_SITE="http://www.ralinktech.com/" WGET_URL="$WGET_URL/RT61_Firmware_V${VERSION}.zip" CATEGORY="base-system" ;; rt73*) WGET_URL="http://archlinux.c3sl.ufpr.br/other/rt2x00-rt71w-fw" VERSION=$(wget -O - $WGET_URL | sed '/Firmware/!d;s/.*_V\(.*\).zip.*/\1/') WEB_SITE="http://www.ralinktech.com/" WGET_URL="$WGET_URL/RT71W_Firmware_V${VERSION}.zip" CATEGORY="base-system" ;; rt2870usb) WGET_URL="http://archlinux.c3sl.ufpr.br/other/${MODULE}-fw" VERSION=$(wget -O - $WGET_URL | sed '/Firmware/!d;s/.*_V\(.*\).zip.*/\1/') WEB_SITE="http://www.ralinktech.com/" WGET_URL="$WGET_URL/RT2870_Firmware_V${VERSION}.zip" CATEGORY="base-system" ;; zd1211*) WGET_URL="http://mirrors.kernel.org/debian/pool/non-free/z/zd1211-firmware" VERSION=$(wget -O - $WGET_URL | sed -e '/zd1211-firmware/!d' \ -e '/all.deb/!d' -e 's/.*>zd1211-firmware_\(.*\)_all.deb.*/\1/;q') SHORT_DESC="zd1211/zd1211rw Wireless Lan firmware." WEB_SITE="http://packages.debian.org/etch/zd1211-firmware" WGET_URL="$WGET_URL/zd1211-firmware_${VERSION}_all.deb" ;; zd1201) SHORT_DESC="zd1201 Wireless Lan firmware." WEB_SITE="http://linux-lc100020.sourceforge.net/" WGET_URL="$(wget -O - $WEB_SITE | sed '/>Latest/!d;s/.*="\([^"]*\).*/\1/')" TARBALL="$(echo "$WGET_URL" | sed 's|.*/\([^/]*\)?.*|\1|')" VERSION="$(echo "$TARBALL" | sed 's/.*-\([^-]*\)-.*/\1/')" ;; esac case "$WGET_URL" in ftp*|http*) ;; /*) WGET_URL="$(echo $WEB_SITE | sed 's|\(^.*://[^/]*\).*|\1|')/$WGET_URL" ;; *) WGET_URL="${WEB_SITE%/}/$WGET_URL" ;; esac # We need drivers, the extractor and tools. for pkg in linux-wireless wireless_tools $DEPENDS do if [ ! -d $ROOT/var/lib/tazpkg/installed/$pkg ]; then tazpkg get-install $pkg --root=$ROOT fi done # Get files TARBALL="${TARBALL:-$(basename $WGET_URL)}" wget -O "$TARBALL" "$WGET_URL" [ -s $TARBALL ] || abort_package case "$TARBALL" in *rpm) rpm2cpio < $TARBALL | cpio -id;; *deb) dpkg-deb -x $TARBALL . ;; *bz2) tar xjf $TARBALL cd $SUBDIR/linux;; *tar.gz|*tgz) tar xzf $TARBALL;; *zip) unzip $TARBALL;; *o) ;; esac # Create pseudo package mkdir -p $PACKAGE-$VERSION/fs/lib/firmware $PACKAGE-$VERSION/fs/usr/share/licenses case "$MODULE" in b43*) b43-fwcutter -w "$PACKAGE-$VERSION/fs/lib/firmware" $FWSET;; ipw2200) cp ${MODULE}-fw-$VERSION/*LICENSE* $PACKAGE-$VERSION/fs/usr/share/licenses/intel-$MODULE-LICENSE.txt mv ${MODULE}-fw-$VERSION/* $PACKAGE-$VERSION/fs/lib/firmware;; ipw2100) cp *LICENSE* $PACKAGE-$VERSION/fs/usr/share/licenses/intel-$MODULE-LICENSE.txt mv *.fw* *LICENSE* $PACKAGE-$VERSION/fs/lib/firmware;; rt*) mv RT*_Firmware_V$VERSION/*.bin $PACKAGE-$VERSION/fs/lib/firmware mv RT*_Firmware_V$VERSION/*LICENSE* $PACKAGE-$VERSION/fs/usr/share/licenses/ralink-rt61-LICENSE.txt;; iwlwifi*) mv iwlwifi*/iwlwifi*.ucode $PACKAGE-$VERSION/fs/lib/firmware mv iwlwifi*/*LICENSE* $PACKAGE-$VERSION/fs/usr/share/licenses/intel-iwlwifi-LICENSE.txt ;; zd1211*) mv lib/firmware/zd1211 $PACKAGE-$VERSION/fs/lib/firmware ;; zd1201) mv $MODULE-$VERSION-fw/*fw $PACKAGE-$VERSION/fs/lib/firmware ;; esac # Creat receipt cat > $PACKAGE-$VERSION/receipt <