# HG changeset patch # User Dominique Corbex # Date 1245150615 -7200 # Node ID 1f6bff8314819f5f04cd1dcb905c8d5fefa8874c # Parent c7584773b8f154bbd5fb8616f790fae44f7fd589 get-softmodem-driver: Add support for Agere Systems Modem diff -r c7584773b8f1 -r 1f6bff831481 get-softmodem-driver/receipt --- a/get-softmodem-driver/receipt Tue Jun 16 10:02:52 2009 +0200 +++ b/get-softmodem-driver/receipt Tue Jun 16 13:10:15 2009 +0200 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="get-softmodem-driver" -VERSION="0.5" +VERSION="0.6" CATEGORY="non-free" SHORT_DESC="Get misc softmodem drivers." MAINTAINER="domcox@slitaz.org" @@ -13,11 +13,12 @@ { mkdir -p $fs/usr/bin cp stuff/$PACKAGE $fs/usr/bin - for i in hsfmodem hcfpcimodem; do + for i in hsfmodem hcfpcimodem martian; do ln -s $PACKAGE $fs/usr/bin/get-$i-driver done mkdir -p $fs/usr/share/softmodem cp stuff/*diff $fs/usr/share/softmodem cp stuff/*receipt $fs/usr/share/softmodem + cp stuff/*init $fs/usr/share/softmodem cp stuff/zone.tab $fs/usr/share/softmodem } diff -r c7584773b8f1 -r 1f6bff831481 get-softmodem-driver/stuff/get-hcfpcimodem-driver --- a/get-softmodem-driver/stuff/get-hcfpcimodem-driver Tue Jun 16 10:02:52 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -get-softmodem-driver \ No newline at end of file diff -r c7584773b8f1 -r 1f6bff831481 get-softmodem-driver/stuff/get-softmodem-driver --- a/get-softmodem-driver/stuff/get-softmodem-driver Tue Jun 16 10:02:52 2009 +0200 +++ b/get-softmodem-driver/stuff/get-softmodem-driver Tue Jun 16 13:10:15 2009 +0200 @@ -5,14 +5,28 @@ ROOT="$1" DEPENDS="" +untested() +{ +echo "--------------------------------------------------------" +echo "Due to a lack of compatible hardware for troubleshooting," +echo "this $PACKAGE package has not been tested." +echo "Please report any bug to help us make a reliable package." +echo "--------------------------------------------------------" +sleep 1 +} + case "$PACKAGE" in hsfmodem) . /usr/share/softmodem/hsfmodem.receipt - ;; + echo "Support for the Conexant (formerly Rockwell) HSF Softmodem family." ;; hcfpcimodem) . /usr/share/softmodem/hcfpcimodem.receipt - ;; -*) echo "Unknown modem driver. Please run one of the following commands:" + echo "Support for the Conexant HCF (controllerless) modem family." ;; +martian) + . /usr/share/softmodem/martian.receipt + echo "Support for the Agere Systems PCI Modem built on DSP 164x (Mars) series." ;; +*) + echo "Unknown modem driver. Please run one of the following commands:" for i in $(cd $(dirname $0); ls get-*-driver); do [ -L $i ] || continue [ "$(readlink $i)" = "get-modem-driver" ] || continue @@ -108,6 +122,22 @@ mkdir -p $fs/usr/src mv $src $fs/usr/src ;; +martian) + untested + # Build + src=/usr/src/$PACKAGE + cd $src + sed -i 's/uname -i/uname -m/' modem/Makefile + sed -i 's/asm\/page.h/\/usr\/src\/linux\/include\/asm\/page.h/' modem/mport.c + sed -i 's/asm\/page.h/\/usr\/src\/linux\/include\/asm\/page.h/' modem/tweakrelocsdynamic.c + make all + # Install + mkdir -p $fs/usr/sbin + cp -a modem/martian_modem $fs/usr/sbin + mkdir -p $fs/lib/modules/`uname -r`/martian + cp -a kmodule/martian_dev.ko $fs/lib/modules/`uname -r`/martian + mkdir -p $fs/etc/init.d + cp -a /usr/share/softmodem/martian.init $fs/etc/init.d/martian esac # Create receipt diff -r c7584773b8f1 -r 1f6bff831481 get-softmodem-driver/stuff/martian.init --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-softmodem-driver/stuff/martian.init Tue Jun 16 13:10:15 2009 +0200 @@ -0,0 +1,62 @@ +#!/bin/sh +# /etc/init.d/martian: Start, stop and restart martian deamon on SliTaz, at boot +# time or with the command line. +# +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. +# +. /etc/init.d/rc.functions +. /etc/daemons.conf + +NAME=Martian modem +DESC="Agere Systems PCI Modem deamon" +DAEMON=/usr/sbin/martian_modem +OPTIONS="--daemon $MARTIAN_OPTIONS /dev/ttySM0" +PIDFILE=/var/run/martian.pid + +if [ `/sbin/lsmod | grep -c martian_dev}` -lt "1" ]; then + echo "kernel module is not loaded!" + exit 1 +fi + +case "$1" in + start) + if [ -f $PIDFILE ] ; then + echo "$NAME already running." + exit 1 + fi + echo -n "Starting $DESC: $NAME... " + $DAEMON $OPTIONS + status + echo `/sbin/pidof $DAEMON` > $PIDFILE + ;; + stop) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $DESC: $NAME... " + kill `cat $PIDFILE` + status + ;; + restart) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Restarting $DESC: $NAME... " + kill `cat $PIDFILE` + sleep 2 + $DAEMON $OPTIONS + status + echo `/sbin/pidof $DAEMON` > $PIDFILE + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" + echo "" + exit 1 + ;; +esac + +exit 0 diff -r c7584773b8f1 -r 1f6bff831481 get-softmodem-driver/stuff/martian.receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-softmodem-driver/stuff/martian.receipt Tue Jun 16 13:10:15 2009 +0200 @@ -0,0 +1,20 @@ +# SliTaz package receipt. + +PACKAGE="martian" +VERSION="full-20080617" +CATEGORY="non-free" +SHORT_DESC="Modem driver for Agere Systems PCI WinModem." +MAINTAINER="domcox@slitaz.org" +TARBALL="$PACKAGE-$VERSION.tar.gz" +DEPENDS="module-init-tools linux-source" +WEB_SITE="http://martian.barrelsoutofbond.org" +WGET_URL="http://www.barrelsoutofbond.org/downloads/$PACKAGE/$TARBALL" + +# Rules to gen a SliTaz package suitable for Tazpkg. + +post_install() +{ + /sbin/depmod -a + /sbin/modprobe martian_dev && \ + /etc/init.d/martian start +}