diff options
author | Stefan Schweizer <genstef@gentoo.org> | 2005-03-29 22:16:07 +0000 |
---|---|---|
committer | Stefan Schweizer <genstef@gentoo.org> | 2005-03-29 22:16:07 +0000 |
commit | be531e09460e86b1dca324e49fe386388461779a (patch) | |
tree | 24950cf91540c0bd9257824cbafccfce28b9cc19 /net-dialup/capi4k-utils/files | |
parent | Stable on sparc wrt #86541 (diff) | |
download | gentoo-2-be531e09460e86b1dca324e49fe386388461779a.tar.gz gentoo-2-be531e09460e86b1dca324e49fe386388461779a.tar.bz2 gentoo-2-be531e09460e86b1dca324e49fe386388461779a.zip |
Improved ebuild and config-files thanks to Stefan Briesenick
(Portage version: 1.585-cvs)
Diffstat (limited to 'net-dialup/capi4k-utils/files')
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.blacklist | 4 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.conf | 62 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.confd | 6 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.hotplug | 65 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.initd | 29 |
5 files changed, 128 insertions, 38 deletions
diff --git a/net-dialup/capi4k-utils/files/capi.blacklist b/net-dialup/capi4k-utils/files/capi.blacklist index 7ef81d727149..33e55856d49b 100644 --- a/net-dialup/capi4k-utils/files/capi.blacklist +++ b/net-dialup/capi4k-utils/files/capi.blacklist @@ -1,6 +1,6 @@ -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.blacklist,v 1.1 2005/03/29 06:43:28 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.blacklist,v 1.2 2005/03/29 22:16:07 genstef Exp $ # CAPI USB is handled via /etc/hotplug/usb/capi.usermap fcusb diff --git a/net-dialup/capi4k-utils/files/capi.conf b/net-dialup/capi4k-utils/files/capi.conf index f045f52a63ec..0f9e6a45586f 100644 --- a/net-dialup/capi4k-utils/files/capi.conf +++ b/net-dialup/capi4k-utils/files/capi.conf @@ -1,21 +1,73 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.conf,v 1.2 2005/03/29 22:16:07 genstef Exp $ + # card file proto io irq mem cardnr options # + +############################## +# ISA/PCI devices # +############################## + +### AVM B1 (you also have to install the firmware) #b1isa b1.t4 DSS1 0x150 7 - - P2P #b1pci b1.t4 DSS1 - - - - + +### AVM C2(you also have to install the firmware) +#c2 c2.bin DSS1 - - - - +#c2 - DSS1 - - - - + +### AVM C4 (you also have to install the firmware) #c4 c4.bin DSS1 - - - - #c4 - DSS1 - - - - #c4 - DSS1 - - - - P2P #c4 - DSS1 - - - - P2P -#c2 c2.bin DSS1 - - - - -#c2 - DSS1 - - - - + +### AVM t1 (you also have to install the firmware) #t1isa t1.t4 DSS1 0x340 9 - 0 #t1pci t1.t4 DSS1 - - - - -#fcpci - - - - - - + +### AVM FritzCard ISA (A1) #fcclassic - - 0x200 7 - - -#fcusb2 fus2base.frm - - - - - -#fcusb2 fus3base.frm - - - - - + +### AVM FritzCard PCI +#fcpci - - - - - - + +### AVM DSL controllers #fcdsl fdslbase.bin - - - - - #fcdsl2 fds2base.bin - - - - - #fcdslsl fdssbase.bin - - - - - + + +############################## +# USB devices # +############################## + +# If you're using hotplug, you shouldn't configure your devices in this config. +# USB devices are detected automatically. If you don't want to use hotplug, then +# set CAPI_HOTPLUG_USB=0 in /etc/conf.d/capi and uncomment your card(s) below. + +### AVM FRITZCARD!USB +#fcusb - - - - - - + +### AVM FRITZX!USB +#fxusb - - - - - - + +### AVM FRITZX!USB OEM +#fxusb_CZ - - - - - - + +### AVM FRITZCARD!USB v2.0 +#fcusb2 fus2base.frm - - - - - + +### AVM FRITZCARD!USB v2.1 +#fcusb2 fus3base.frm - - - - - + +### AVM BlueFRITZ!USB +#bfusb - - - - - - + +### AVM FRITZDSL!USB (DSL/ISDN) #fcdslusb fdsubase.frm - - - - - + +### AVM FRITZDSL!USB SL (DSL only) #fcdslslusb fdlubase.frm - - - - - + diff --git a/net-dialup/capi4k-utils/files/capi.confd b/net-dialup/capi4k-utils/files/capi.confd index 73d5f9942513..31dc5c9dfb11 100644 --- a/net-dialup/capi4k-utils/files/capi.confd +++ b/net-dialup/capi4k-utils/files/capi.confd @@ -1,6 +1,6 @@ -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.confd,v 1.1 2005/03/29 06:43:28 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.confd,v 1.2 2005/03/29 22:16:07 genstef Exp $ # do you want to use USB hotplug? # if disabled, you have to configure your device in /etc/capi.conf @@ -9,3 +9,5 @@ CAPI_HOTPLUG_USB=1 # should via hotplug added cards generate a beep? CAPI_HOTPLUG_BEEP=1 +# should CAPIDRV be loaded? +CAPI_LOAD_CAPIDRV=1 diff --git a/net-dialup/capi4k-utils/files/capi.hotplug b/net-dialup/capi4k-utils/files/capi.hotplug index 9ed7517069ff..00be239e424c 100644 --- a/net-dialup/capi4k-utils/files/capi.hotplug +++ b/net-dialup/capi4k-utils/files/capi.hotplug @@ -1,20 +1,41 @@ #!/bin/bash -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.hotplug,v 1.1 2005/03/29 06:43:28 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.hotplug,v 1.2 2005/03/29 22:16:07 genstef Exp $ . /etc/conf.d/capi [ "$CAPI_HOTPLUG_USB" = "0" ] && exit 0 +# syslog output +syslog() { # <msg> + /usr/bin/logger -t "capi-usb" "$1" +} + +beep_ok() { + [ "$CAPI_HOTPLUG_BEEP" = "0" ] || echo -en "\033[10;1200]\a\033[10;262]" > /dev/console +} + +beep_error() { + [ "$CAPI_HOTPLUG_BEEP" = "0" ] || echo -en "\033[10;300]\a\033[10;262]" > /dev/console +} + # driver lookup cardinfo() { # <driver> - /bin/sed 2>/dev/null -n "s:^\([1-9][0-9]*\) \+${1} \+\([^ ]\+\) \+\([^ ]\+\).*:\1 \3 \2:p" /proc/capi/controller + # /proc/capi/controller: <controller> <drivername> <state> <cardname> <controllerinfo> + /bin/sed 2>/dev/null -n "s:^\([1-9][0-9]*\) \+${1} \+\([^ ]\+\) \+\([^ ]\+\) \+\([^ ]\+\):\1 \3 \2 \4:p" /proc/capi/controller } # AVM firmware loader -avmusb() { # <card> <firmware> - /usr/sbin/avmcapictrl load "/lib/firmware/${2}" "${1}" +avmusb() { # <driver> <usbdev> <firmware> + local CARD NAME STATUS TYPE VER DEV FIRMWARE + while read CARD NAME STATUS TYPE VER DEV; do # AVM cardinfo + if [ "${STATUS}" = "detected" -a ${DEV} -eq ${2} ]; then + syslog "loading firmware ${3} into controller ${CARD} (${NAME})" + /usr/sbin/avmcapictrl load "/lib/firmware/${3}" "${CARD}" + break + fi + done < <(cardinfo "${1}") } # normalize and split product code @@ -66,30 +87,46 @@ case "${VENDID}" in FIRMWARE="fdlubase.frm" ;; *) # unknown card - echo "unknown USB product: $VENDID" + syslog "unknown USB product: ${VENDID}" exit 1 esac case "$ACTION" in add) /bin/ln 2>/dev/null -s "$$" "$LOCK" || exit 0 - for MODULE in kernelcapi capi capidrv $DRIVER; do - /sbin/modprobe -s $MODULE || exit 1 - done + + # loading capi + capidrv + ( [ -f /proc/capi/capi20 ] || /sbin/modprobe -sq capi ) && \ + ( [ -f /proc/capi/capidrv -o "$CAPI_LOAD_CAPIDRV" = "0" ] || /sbin/modprobe -sq capidrv ) + if [ $? -ne 0 ]; then + syslog "could not load CAPI!" + beep_error; /bin/rm -f "$LOCK"; exit 1 + fi + + # loading driver + if ! /sbin/modprobe -sq $DRIVER; then + syslog "could not load driver ${DRIVER}!" + beep_error; /bin/rm -f "$LOCK"; exit 1 + fi + + # loading firmware if [ -n "$LOADER" -a -n "$FIRMWARE" ]; then CNT=0 # wait for udev while [ ! -e /dev/capi20 -a $CNT -lt 10 ]; do sleep 1; : $((CNT++)) done - read CARD NAME STATUS < <(cardinfo $DRIVER) - [ "$STATUS" = "detected" ] && $LOADER $CARD $FIRMWARE + if [ -f "/lib/firmware/${FIRMWARE}" ]; then + $LOADER $DRIVER $USBDEV $FIRMWARE + else + syslog "firmware ${FIRMWARE} not found!" + beep_error; /bin/rm -f "$LOCK"; exit 1 + fi fi - [ "$CAPI_HOTPLUG_BEEP" = "0" ] || echo -en "\033[10;1200]\a\033[10;262]" > /dev/console - /bin/rm -f "$LOCK" + + beep_ok; /bin/rm -f "$LOCK" ;; remove) /sbin/modprobe -sqr $DRIVER - [ "$CAPI_HOTPLUG_BEEP" = "0" ] || echo -en "\033[10;300]\a\033[10;262]" > /dev/console ;; esac exit 0 diff --git a/net-dialup/capi4k-utils/files/capi.initd b/net-dialup/capi4k-utils/files/capi.initd index 9901bc77b6d2..7644eb710a07 100644 --- a/net-dialup/capi4k-utils/files/capi.initd +++ b/net-dialup/capi4k-utils/files/capi.initd @@ -1,7 +1,7 @@ #!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.initd,v 1.2 2005/03/29 06:55:24 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.initd,v 1.3 2005/03/29 22:16:07 genstef Exp $ opts="start stop info" @@ -9,44 +9,43 @@ depend() { after coldplug isapnp } -get_modules() { - /usr/bin/cut 2>/dev/null -f2 -d' ' /proc/capi/controller -} - start() { if [ ! -e /etc/capi.conf ] ; then eerror "You're missing /etc/capi.conf (comes with a capi-driver)." - eerror "Emerge net-dialup/fcpci if you are having an AVM Fritz!Card PCI" + eerror "Emerge net-dialup/fritzcapi if you are having an AVM Fritz!Card" return 1 fi ebegin "Loading CAPI" - ( [ -f /proc/capi/capi20 ] || /sbin/modprobe capi ) && \ - ( [ -f /proc/capi/capidrv ] || /sbin/modprobe capidrv ) + ( [ -f /proc/capi/capi20 ] || /sbin/modprobe -s capi ) && \ + ( [ -f /proc/capi/capidrv -o "$CAPI_LOAD_CAPIDRV" = "0" ] || /sbin/modprobe -s capidrv ) eend $? || return 1 ebegin "Starting CAPI" - - CNT=0 # wait for udev + + local CNT=0 # wait for udev while [ ! -e /dev/capi20 -a $CNT -lt 10 ]; do sleep 1; : $((CNT++)) done - if /usr/sbin/capiinit activate ; then - while read INFO; do einfo " $INFO"; done < /proc/capi/controller + if /usr/sbin/capiinit 2>/dev/null activate ; then + eindent + while read INFO; do einfo "$INFO"; done < /proc/capi/controller + eoutdent fi eend $? } stop() { - local DRIVERS=$(get_modules) + local DRIVERS=$(/usr/bin/cut 2>/dev/null -f1 -d' ' /proc/capi/driver) - ebegin "Unloading CAPI" + ebegin "Stopping CAPI" /sbin/modprobe -sqr capidrv /usr/sbin/capiinit 2>/dev/null stop for DRV in $DRIVERS; do /sbin/modprobe -sqr $DRV; done + /sbin/modprobe -sqr capi eend 0 } |