wok-current rev 2167
Add get-dsl-firmware
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Feb 07 13:59:28 2009 +0000 (2009-02-07) |
parents | 13c1216335ad |
children | 06de91c7c560 |
files | get-dsl-firmware/receipt get-dsl-firmware/stuff/get-dsl-firmware |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/get-dsl-firmware/receipt Sat Feb 07 13:59:28 2009 +0000 1.3 @@ -0,0 +1,18 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="get-dsl-firmware" 1.7 +VERSION="1.0" 1.8 +CATEGORY="non-free" 1.9 +SHORT_DESC="Get misc dsl modem firmwares." 1.10 +MAINTAINER="pascal.bellard@slitaz.org" 1.11 +WEB_SITE="http://hg.slitaz.org/wok/file/tip/$PACKAGE/stuff/$PACKAGE" 1.12 + 1.13 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.14 +genpkg_rules() 1.15 +{ 1.16 + mkdir -p $fs/usr/bin 1.17 + cp stuff/$PACKAGE $fs/usr/bin 1.18 + for i in speedtouch speedtouch-silver ueagle ; do 1.19 + ln -s $PACKAGE $fs/usr/bin/get-$i-firmware 1.20 + done 1.21 +}
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/get-dsl-firmware/stuff/get-dsl-firmware Sat Feb 07 13:59:28 2009 +0000 2.3 @@ -0,0 +1,99 @@ 2.4 +#!/bin/sh 2.5 + 2.6 +MODULE=$(echo $0 | sed 's/.*get-\(.*\)-firmware/\1/') 2.7 +ROOT="$1" 2.8 +PKG=$MODULE-firmware 2.9 +DEPENDS="" 2.10 +TMP=/tmp/$(basename $0)$$ 2.11 + 2.12 +case "$MODULE" in 2.13 +speedtouch|speedtouch-silver) 2.14 + VERSION="3.012" 2.15 + SHORT_DESC="Firmware for SpeedTouch ADSL Modem." 2.16 + WEB_SITE="http://www.linux-usb.org/SpeedTouch/" 2.17 + URL="http://www.speedtouch.com/download/drivers/USB" 2.18 + URL="$URL/SpeedTouch330_firmware_$(echo $VERSION | sed 's/\.//').zip" 2.19 + ;; 2.20 +ueagle) 2.21 + VERSION="1.1" 2.22 + SHORT_DESC="Firmware for Fast800 USB ADSL Modem." 2.23 + SOURCE="ueagle-data" 2.24 + WEB_SITE="http://eagle-usb.org/" 2.25 + URL="${WEB_SITE}ueagle-atm/non-free/ueagle-data-$VERSION.tar.gz" 2.26 + ;; 2.27 +*) echo "Unknown dsl driver. Please run one of the following commands:" 2.28 + cd $TOP 2.29 + rm -rf $TMP 2.30 + for i in $(cd $(dirname $0); ls get-*-firmware); do 2.31 + [ "$i" = "get-dsl-firmware" ] && continue 2.32 + echo " $i" 2.33 + done 2.34 + exit 1;; 2.35 +esac 2.36 + 2.37 +# Check if user is root to install. 2.38 +if test $(id -u) != 0 ; then 2.39 + echo -e "\nYou must be root to run `basename $0`." 2.40 + echo -e "Please use 'su' and root password to become super-user.\n" 2.41 + exit 0 2.42 +fi 2.43 + 2.44 +# Avoid reinstall 2.45 +if [ -d $ROOT/var/lib/tazpkg/installed/$PKG ]; then 2.46 + echo -e "\n$PKG package is already installed.\n" 2.47 + exit 0 2.48 +fi 2.49 + 2.50 +mkdir $TMP 2.51 +TOP=$PWD 2.52 +cd $TMP 2.53 + 2.54 +mkdir -p $PKG-$VERSION/fs/lib/firmware 2.55 + 2.56 +case "$MODULE" in 2.57 +speedtouch|speedtouch-silver) 2.58 + wget $URL 2.59 + unzip -n $(basename $URL) 2.60 + wget http://www.linux-usb.org/SpeedTouch/firmware/firmware-extractor.tar.gz 2.61 + tar xzf firmware-extractor.tar.gz 2.62 + cd firmware-extractor/ 2.63 + gcc -o firmware-extractor firmware.c 2.64 + FIRMWARE="ZZZL_$VERSION" 2.65 + [ "$MODULE" = "speedtouch" ] && FIRMWARE="KQD6_$VERSION" 2.66 + cp ../$FIRMWARE mgmt.o 2.67 + ./firmware-extractor mgmt.o 2.68 + install -m 600 speedtch-1.bin speedtch-2.bin \ 2.69 + ../$PKG-$VERSION/fs/lib/firmware 2.70 + cd .. 2.71 + ;; 2.72 +ueagle) 2.73 + wget $URL 2.74 + tar xzf $(basename $URL) 2.75 + wget $(dirname $URL)/ueagle4-data-1.0.tar.gz 2.76 + tar xzf ueagle4-data-1.0.tar.gz 2.77 + cp -a ueagle-*/*.fw ueagle-*/*.bin ueagle4*/*.fw ueagle4*/*.bin* \ 2.78 + $PKG-$VERSION/fs/lib/firmware 2.79 + chown root.root $PKG-$VERSION/fs/lib/firmware/* 2.80 + ln $PKG-$VERSION/fs/lib/firmware/CMV4p.bin.v2 \ 2.81 + $PKG-$VERSION/fs/lib/firmware/CMV4p.bin || true 2.82 + ;; 2.83 +esac 2.84 + 2.85 +# Create receipt 2.86 +cat > $PKG-$VERSION/receipt <<EOT 2.87 +PACKAGE="$PKG" 2.88 +VERSION="$VERSION" 2.89 +CATEGORY="non-free" 2.90 +SHORT_DESC="$SHORT_DESC." 2.91 +WEB_SITE="$WEB_SITE" 2.92 +EOT 2.93 + 2.94 +# Pack 2.95 +tazpkg pack $PKG-$VERSION 2.96 + 2.97 +# Install pseudo package 2.98 +tazpkg install $PKG-$VERSION.tazpkg --root=$ROOT 2.99 + 2.100 +# Clean 2.101 +cd $TOP 2.102 +rm -rf $TMP