wok annotate get-dsl-firmware/stuff/get-dsl-firmware @ rev 4534
Up: gnome-mplayer; improve receipt
author | Rohit Joshi <jozee@slitaz.org> |
---|---|
date | Mon Nov 30 10:33:39 2009 +0000 (2009-11-30) |
parents | c11a070d03ee |
children |
rev | line source |
---|---|
pascal@2167 | 1 #!/bin/sh |
pascal@2167 | 2 |
pascal@2167 | 3 MODULE=$(echo $0 | sed 's/.*get-\(.*\)-firmware/\1/') |
pascal@2167 | 4 ROOT="$1" |
pascal@2167 | 5 PKG=$MODULE-firmware |
pascal@2167 | 6 DEPENDS="" |
pascal@2167 | 7 TMP=/tmp/$(basename $0)$$ |
pascal@2167 | 8 |
pascal@2167 | 9 case "$MODULE" in |
pascal@2268 | 10 speedtouch|speedtouch-silver|speedtch) |
pascal@2167 | 11 VERSION="3.012" |
pascal@3893 | 12 TARBALL="SpeedTouch330_firmware_$(echo $VERSION | sed 's/\.//').zip" |
pascal@2167 | 13 SHORT_DESC="Firmware for SpeedTouch ADSL Modem." |
pascal@2167 | 14 WEB_SITE="http://www.linux-usb.org/SpeedTouch/" |
pascal@3893 | 15 URL="http://www.speedtouch.com/download/drivers/USB/$TARBALL" |
pascal@2167 | 16 ;; |
pascal@2268 | 17 ueagle|ueagle-atm) |
pascal@2167 | 18 VERSION="1.1" |
pascal@3893 | 19 TARBALL="ueagle-data-$VERSION.tar.gz" |
pascal@2167 | 20 SHORT_DESC="Firmware for Fast800 USB ADSL Modem." |
pascal@2167 | 21 SOURCE="ueagle-data" |
pascal@2167 | 22 WEB_SITE="http://eagle-usb.org/" |
pascal@3893 | 23 URL="${WEB_SITE}ueagle-atm/non-free/$TARBALL" |
pascal@2167 | 24 ;; |
pascal@2167 | 25 *) echo "Unknown dsl driver. Please run one of the following commands:" |
pascal@2167 | 26 for i in $(cd $(dirname $0); ls get-*-firmware); do |
pascal@2171 | 27 [ -L $i ] || continue |
pascal@2171 | 28 [ "$(readlink $i)" = "get-dsl-firmware" ] || continue |
pascal@2167 | 29 echo " $i" |
pascal@2167 | 30 done |
pascal@2167 | 31 exit 1;; |
pascal@2167 | 32 esac |
pascal@2167 | 33 |
pascal@2167 | 34 # Check if user is root to install. |
pascal@2167 | 35 if test $(id -u) != 0 ; then |
pascal@2167 | 36 echo -e "\nYou must be root to run `basename $0`." |
pascal@2167 | 37 echo -e "Please use 'su' and root password to become super-user.\n" |
pascal@2167 | 38 exit 0 |
pascal@2167 | 39 fi |
pascal@2167 | 40 |
pascal@2167 | 41 # Avoid reinstall |
pascal@2167 | 42 if [ -d $ROOT/var/lib/tazpkg/installed/$PKG ]; then |
pascal@2167 | 43 echo -e "\n$PKG package is already installed.\n" |
pascal@2167 | 44 exit 0 |
pascal@2167 | 45 fi |
pascal@2167 | 46 |
pascal@2167 | 47 mkdir $TMP |
pascal@2167 | 48 TOP=$PWD |
pascal@2167 | 49 cd $TMP |
pascal@2167 | 50 |
pascal@2167 | 51 mkdir -p $PKG-$VERSION/fs/lib/firmware |
pascal@2167 | 52 |
pascal@2167 | 53 case "$MODULE" in |
pascal@2268 | 54 speedtouch|speedtouch-silver|speedtch) |
pascal@2167 | 55 wget $URL |
pascal@2167 | 56 unzip -n $(basename $URL) |
pascal@2167 | 57 wget http://www.linux-usb.org/SpeedTouch/firmware/firmware-extractor.tar.gz |
pascal@2167 | 58 tar xzf firmware-extractor.tar.gz |
pascal@2167 | 59 cd firmware-extractor/ |
pascal@2167 | 60 gcc -o firmware-extractor firmware.c |
pascal@2167 | 61 FIRMWARE="ZZZL_$VERSION" |
pascal@2167 | 62 [ "$MODULE" = "speedtouch" ] && FIRMWARE="KQD6_$VERSION" |
pascal@2167 | 63 cp ../$FIRMWARE mgmt.o |
pascal@2167 | 64 ./firmware-extractor mgmt.o |
pascal@2167 | 65 install -m 600 speedtch-1.bin speedtch-2.bin \ |
pascal@2167 | 66 ../$PKG-$VERSION/fs/lib/firmware |
pascal@2167 | 67 cd .. |
pascal@2167 | 68 ;; |
pascal@2268 | 69 ueagle|ueagle-atm) |
pascal@2167 | 70 wget $URL |
pascal@2167 | 71 tar xzf $(basename $URL) |
pascal@2167 | 72 wget $(dirname $URL)/ueagle4-data-1.0.tar.gz |
pascal@2167 | 73 tar xzf ueagle4-data-1.0.tar.gz |
pascal@2168 | 74 mkdir -p $PKG-$VERSION/fs/lib/firmware/ueagle-atm |
pascal@2167 | 75 cp -a ueagle-*/*.fw ueagle-*/*.bin ueagle4*/*.fw ueagle4*/*.bin* \ |
pascal@2168 | 76 $PKG-$VERSION/fs/lib/firmware/ueagle-atm |
pascal@2168 | 77 chown root.root $PKG-$VERSION/fs/lib/firmware/ueagle-atm/* |
pascal@2168 | 78 ln $PKG-$VERSION/fs/lib/firmware/ueagle-atm/CMV4p.bin.v2 \ |
pascal@2168 | 79 $PKG-$VERSION/fs/lib/firmware/ueagle-atm/CMV4p.bin || true |
pascal@2167 | 80 ;; |
pascal@2167 | 81 esac |
pascal@2167 | 82 |
pascal@3893 | 83 if [ ! -f $TARBALL ]; then |
pascal@3893 | 84 echo "Could not download $TARBALL. Exiting." |
pascal@3893 | 85 cd $TOP |
pascal@3893 | 86 rm -rf $TMP |
pascal@3893 | 87 exit 1 |
pascal@3893 | 88 fi |
pascal@3893 | 89 |
pascal@2167 | 90 # Create receipt |
pascal@2167 | 91 cat > $PKG-$VERSION/receipt <<EOT |
pascal@2167 | 92 PACKAGE="$PKG" |
pascal@2167 | 93 VERSION="$VERSION" |
pascal@2167 | 94 CATEGORY="non-free" |
pascal@2167 | 95 SHORT_DESC="$SHORT_DESC." |
pascal@2167 | 96 WEB_SITE="$WEB_SITE" |
pascal@2167 | 97 EOT |
pascal@2167 | 98 |
pascal@2167 | 99 # Pack |
pascal@2167 | 100 tazpkg pack $PKG-$VERSION |
pascal@2167 | 101 |
pascal@2167 | 102 # Install pseudo package |
pascal@2167 | 103 tazpkg install $PKG-$VERSION.tazpkg --root=$ROOT |
pascal@2167 | 104 |
pascal@2167 | 105 # Clean |
pascal@2167 | 106 cd $TOP |
pascal@2167 | 107 rm -rf $TMP |