wok view get-dsl-firmware/stuff/get-dsl-firmware @ rev 2602
netatalk: do not link pam
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Apr 10 16:33:24 2009 +0000 (2009-04-10) |
parents | 3c4e4aa73511 |
children | 32959e7975fc |
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 SHORT_DESC="Firmware for SpeedTouch ADSL Modem."
13 WEB_SITE="http://www.linux-usb.org/SpeedTouch/"
14 URL="http://www.speedtouch.com/download/drivers/USB"
15 URL="$URL/SpeedTouch330_firmware_$(echo $VERSION | sed 's/\.//').zip"
16 ;;
17 ueagle|ueagle-atm)
18 VERSION="1.1"
19 SHORT_DESC="Firmware for Fast800 USB ADSL Modem."
20 SOURCE="ueagle-data"
21 WEB_SITE="http://eagle-usb.org/"
22 URL="${WEB_SITE}ueagle-atm/non-free/ueagle-data-$VERSION.tar.gz"
23 ;;
24 *) echo "Unknown dsl driver. Please run one of the following commands:"
25 for i in $(cd $(dirname $0); ls get-*-firmware); do
26 [ -L $i ] || continue
27 [ "$(readlink $i)" = "get-dsl-firmware" ] || continue
28 echo " $i"
29 done
30 exit 1;;
31 esac
33 # Check if user is root to install.
34 if test $(id -u) != 0 ; then
35 echo -e "\nYou must be root to run `basename $0`."
36 echo -e "Please use 'su' and root password to become super-user.\n"
37 exit 0
38 fi
40 # Avoid reinstall
41 if [ -d $ROOT/var/lib/tazpkg/installed/$PKG ]; then
42 echo -e "\n$PKG package is already installed.\n"
43 exit 0
44 fi
46 mkdir $TMP
47 TOP=$PWD
48 cd $TMP
50 mkdir -p $PKG-$VERSION/fs/lib/firmware
52 case "$MODULE" in
53 speedtouch|speedtouch-silver|speedtch)
54 wget $URL
55 unzip -n $(basename $URL)
56 wget http://www.linux-usb.org/SpeedTouch/firmware/firmware-extractor.tar.gz
57 tar xzf firmware-extractor.tar.gz
58 cd firmware-extractor/
59 gcc -o firmware-extractor firmware.c
60 FIRMWARE="ZZZL_$VERSION"
61 [ "$MODULE" = "speedtouch" ] && FIRMWARE="KQD6_$VERSION"
62 cp ../$FIRMWARE mgmt.o
63 ./firmware-extractor mgmt.o
64 install -m 600 speedtch-1.bin speedtch-2.bin \
65 ../$PKG-$VERSION/fs/lib/firmware
66 cd ..
67 ;;
68 ueagle|ueagle-atm)
69 wget $URL
70 tar xzf $(basename $URL)
71 wget $(dirname $URL)/ueagle4-data-1.0.tar.gz
72 tar xzf ueagle4-data-1.0.tar.gz
73 mkdir -p $PKG-$VERSION/fs/lib/firmware/ueagle-atm
74 cp -a ueagle-*/*.fw ueagle-*/*.bin ueagle4*/*.fw ueagle4*/*.bin* \
75 $PKG-$VERSION/fs/lib/firmware/ueagle-atm
76 chown root.root $PKG-$VERSION/fs/lib/firmware/ueagle-atm/*
77 ln $PKG-$VERSION/fs/lib/firmware/ueagle-atm/CMV4p.bin.v2 \
78 $PKG-$VERSION/fs/lib/firmware/ueagle-atm/CMV4p.bin || true
79 ;;
80 esac
82 # Create receipt
83 cat > $PKG-$VERSION/receipt <<EOT
84 PACKAGE="$PKG"
85 VERSION="$VERSION"
86 CATEGORY="non-free"
87 SHORT_DESC="$SHORT_DESC."
88 WEB_SITE="$WEB_SITE"
89 EOT
91 # Pack
92 tazpkg pack $PKG-$VERSION
94 # Install pseudo package
95 tazpkg install $PKG-$VERSION.tazpkg --root=$ROOT
97 # Clean
98 cd $TOP
99 rm -rf $TMP