wok rev 3464

get-softmodem-driver: Add support for Agere Systems Modem
author Dominique Corbex <domcox@users.sourceforge.net>
date Tue Jun 16 13:10:15 2009 +0200 (2009-06-16)
parents c7584773b8f1
children 0d1cbed2d0dc
files get-softmodem-driver/receipt get-softmodem-driver/stuff/get-hcfpcimodem-driver get-softmodem-driver/stuff/get-softmodem-driver get-softmodem-driver/stuff/martian.init get-softmodem-driver/stuff/martian.receipt
line diff
     1.1 --- a/get-softmodem-driver/receipt	Tue Jun 16 10:02:52 2009 +0200
     1.2 +++ b/get-softmodem-driver/receipt	Tue Jun 16 13:10:15 2009 +0200
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="get-softmodem-driver"
     1.7 -VERSION="0.5"
     1.8 +VERSION="0.6"
     1.9  CATEGORY="non-free"
    1.10  SHORT_DESC="Get misc softmodem drivers."
    1.11  MAINTAINER="domcox@slitaz.org"
    1.12 @@ -13,11 +13,12 @@
    1.13  {
    1.14  	mkdir -p $fs/usr/bin
    1.15  	cp stuff/$PACKAGE $fs/usr/bin
    1.16 -	for i in hsfmodem hcfpcimodem; do
    1.17 +	for i in hsfmodem hcfpcimodem martian; do
    1.18  		ln -s $PACKAGE $fs/usr/bin/get-$i-driver
    1.19  	done
    1.20  	mkdir -p $fs/usr/share/softmodem
    1.21  	cp stuff/*diff $fs/usr/share/softmodem
    1.22  	cp stuff/*receipt $fs/usr/share/softmodem
    1.23 +	cp stuff/*init $fs/usr/share/softmodem
    1.24  	cp stuff/zone.tab $fs/usr/share/softmodem
    1.25  }
     2.1 --- a/get-softmodem-driver/stuff/get-hcfpcimodem-driver	Tue Jun 16 10:02:52 2009 +0200
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,1 +0,0 @@
     2.4 -get-softmodem-driver
     2.5 \ No newline at end of file
     3.1 --- a/get-softmodem-driver/stuff/get-softmodem-driver	Tue Jun 16 10:02:52 2009 +0200
     3.2 +++ b/get-softmodem-driver/stuff/get-softmodem-driver	Tue Jun 16 13:10:15 2009 +0200
     3.3 @@ -5,14 +5,28 @@
     3.4  ROOT="$1"
     3.5  DEPENDS=""
     3.6  
     3.7 +untested()
     3.8 +{
     3.9 +echo "--------------------------------------------------------"
    3.10 +echo "Due to a lack of compatible hardware for troubleshooting,"
    3.11 +echo "this $PACKAGE package has not been tested."
    3.12 +echo "Please report any bug to help us make a reliable package."
    3.13 +echo "--------------------------------------------------------"
    3.14 +sleep 1
    3.15 +}
    3.16 +
    3.17  case "$PACKAGE" in
    3.18  hsfmodem)
    3.19  	. /usr/share/softmodem/hsfmodem.receipt
    3.20 -	;;
    3.21 +	echo "Support for the Conexant (formerly Rockwell) HSF Softmodem family." ;;
    3.22  hcfpcimodem)
    3.23  	. /usr/share/softmodem/hcfpcimodem.receipt
    3.24 -	;;
    3.25 -*)	echo "Unknown modem driver. Please run one of the following commands:"
    3.26 +	echo "Support for the Conexant HCF (controllerless) modem family." ;;
    3.27 +martian)
    3.28 +	. /usr/share/softmodem/martian.receipt
    3.29 +	echo "Support for the Agere Systems PCI Modem built on DSP 164x (Mars) series." ;;
    3.30 +*)
    3.31 +	echo "Unknown modem driver. Please run one of the following commands:"
    3.32  	for i in $(cd $(dirname $0); ls get-*-driver); do
    3.33  		[ -L $i ] || continue
    3.34  		[ "$(readlink $i)" = "get-modem-driver" ] || continue
    3.35 @@ -108,6 +122,22 @@
    3.36  	mkdir -p $fs/usr/src
    3.37  	mv $src $fs/usr/src
    3.38  	;;
    3.39 +martian)
    3.40 +	untested
    3.41 +	# Build
    3.42 +	src=/usr/src/$PACKAGE
    3.43 +	cd $src
    3.44 +	sed -i 's/uname -i/uname -m/' modem/Makefile
    3.45 +	sed -i 's/asm\/page.h/\/usr\/src\/linux\/include\/asm\/page.h/' modem/mport.c
    3.46 +	sed -i 's/asm\/page.h/\/usr\/src\/linux\/include\/asm\/page.h/' modem/tweakrelocsdynamic.c
    3.47 +	make all
    3.48 +	# Install
    3.49 +	mkdir -p $fs/usr/sbin
    3.50 +	cp -a modem/martian_modem $fs/usr/sbin
    3.51 +	mkdir -p $fs/lib/modules/`uname -r`/martian
    3.52 +	cp -a kmodule/martian_dev.ko $fs/lib/modules/`uname -r`/martian
    3.53 +	mkdir -p $fs/etc/init.d
    3.54 +	cp -a /usr/share/softmodem/martian.init $fs/etc/init.d/martian
    3.55  esac
    3.56  
    3.57  # Create receipt
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/get-softmodem-driver/stuff/martian.init	Tue Jun 16 13:10:15 2009 +0200
     4.3 @@ -0,0 +1,62 @@
     4.4 +#!/bin/sh
     4.5 +# /etc/init.d/martian: Start, stop and restart martian deamon on SliTaz, at boot
     4.6 +# time or with the command line.
     4.7 +#
     4.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS
     4.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
    4.10 +#
    4.11 +. /etc/init.d/rc.functions
    4.12 +. /etc/daemons.conf
    4.13 +
    4.14 +NAME=Martian modem
    4.15 +DESC="Agere Systems PCI Modem deamon"
    4.16 +DAEMON=/usr/sbin/martian_modem
    4.17 +OPTIONS="--daemon $MARTIAN_OPTIONS /dev/ttySM0"
    4.18 +PIDFILE=/var/run/martian.pid
    4.19 +
    4.20 +if [ `/sbin/lsmod | grep -c martian_dev}` -lt "1" ]; then
    4.21 +	echo "kernel module is not loaded!"
    4.22 +	exit 1
    4.23 +fi
    4.24 +
    4.25 +case "$1" in
    4.26 +  start)
    4.27 +    if [ -f $PIDFILE ] ; then
    4.28 +      echo "$NAME already running."
    4.29 +      exit 1
    4.30 +    fi
    4.31 +    echo -n "Starting $DESC: $NAME... "
    4.32 +    $DAEMON $OPTIONS
    4.33 +    status
    4.34 +	echo `/sbin/pidof $DAEMON` > $PIDFILE
    4.35 +    ;;
    4.36 +  stop)
    4.37 +    if [ ! -f $PIDFILE ] ; then
    4.38 +      echo "$NAME is not running."
    4.39 +      exit 1
    4.40 +    fi
    4.41 +    echo -n "Stopping $DESC: $NAME... "
    4.42 +    kill `cat $PIDFILE`
    4.43 +    status
    4.44 +    ;;
    4.45 +  restart)
    4.46 +    if [ ! -f $PIDFILE ] ; then
    4.47 +      echo "$NAME is not running."
    4.48 +      exit 1
    4.49 +    fi
    4.50 +    echo -n "Restarting $DESC: $NAME... "
    4.51 +    kill `cat $PIDFILE`
    4.52 +    sleep 2
    4.53 +    $DAEMON $OPTIONS
    4.54 +    status
    4.55 +	echo `/sbin/pidof $DAEMON` > $PIDFILE
    4.56 +    ;;
    4.57 +  *)
    4.58 +    echo ""
    4.59 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    4.60 +    echo ""
    4.61 +    exit 1
    4.62 +    ;;
    4.63 +esac
    4.64 +
    4.65 +exit 0
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/get-softmodem-driver/stuff/martian.receipt	Tue Jun 16 13:10:15 2009 +0200
     5.3 @@ -0,0 +1,20 @@
     5.4 +# SliTaz package receipt.
     5.5 +
     5.6 +PACKAGE="martian"
     5.7 +VERSION="full-20080617"
     5.8 +CATEGORY="non-free"
     5.9 +SHORT_DESC="Modem driver for Agere Systems PCI WinModem."
    5.10 +MAINTAINER="domcox@slitaz.org"
    5.11 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    5.12 +DEPENDS="module-init-tools linux-source"
    5.13 +WEB_SITE="http://martian.barrelsoutofbond.org"
    5.14 +WGET_URL="http://www.barrelsoutofbond.org/downloads/$PACKAGE/$TARBALL"
    5.15 +
    5.16 +# Rules to gen a SliTaz package suitable for Tazpkg.
    5.17 +
    5.18 +post_install()
    5.19 +{
    5.20 +	/sbin/depmod -a
    5.21 +	/sbin/modprobe martian_dev && \
    5.22 +	/etc/init.d/martian start
    5.23 +}