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