diff options
author | Stefan Schweizer <genstef@gentoo.org> | 2005-04-09 14:35:00 +0000 |
---|---|---|
committer | Stefan Schweizer <genstef@gentoo.org> | 2005-04-09 14:35:00 +0000 |
commit | 0389bb1181f3a21ff4155050f342d72e9fab2ace (patch) | |
tree | 5c1ecdf6eb7528b177e06cd705cbe6646a8a139e /net-dialup/capi4k-utils | |
parent | modified startup script (diff) | |
download | historical-0389bb1181f3a21ff4155050f342d72e9fab2ace.tar.gz historical-0389bb1181f3a21ff4155050f342d72e9fab2ace.tar.bz2 historical-0389bb1181f3a21ff4155050f342d72e9fab2ace.zip |
Merge some changes thanks to sbriesen
Package-Manager: portage-1.585-cvs
Diffstat (limited to 'net-dialup/capi4k-utils')
-rw-r--r-- | net-dialup/capi4k-utils/ChangeLog | 7 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/Manifest | 11 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild | 6 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi-isdn | 18 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.confd | 11 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.hotplug | 32 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.initd | 53 |
7 files changed, 92 insertions, 46 deletions
diff --git a/net-dialup/capi4k-utils/ChangeLog b/net-dialup/capi4k-utils/ChangeLog index 7ef50156b0a3..58e62152e27b 100644 --- a/net-dialup/capi4k-utils/ChangeLog +++ b/net-dialup/capi4k-utils/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for net-dialup/capi4k-utils # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/ChangeLog,v 1.30 2005/03/30 20:03:15 genstef Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/ChangeLog,v 1.31 2005/04/09 14:35:00 genstef Exp $ + + 09 Apr 2005; Stefan Schweizer <genstef@gentoo.org> files/capi.confd, + files/capi.hotplug, files/capi.initd, +files/capi-isdn, + capi4k-utils-20050322.ebuild: + Merge some changes thanks to sbriesen 30 Mar 2005; Stefan Schweizer <genstef@gentoo.org> files/capi.hotplug, files/capi.initd, capi4k-utils-20050322.ebuild: diff --git a/net-dialup/capi4k-utils/Manifest b/net-dialup/capi4k-utils/Manifest index bc986d5b41ed..493914f685d9 100644 --- a/net-dialup/capi4k-utils/Manifest +++ b/net-dialup/capi4k-utils/Manifest @@ -1,18 +1,19 @@ MD5 4a0bb8a608304da5ee282b438e6d54c2 capi4k-utils-20041006-r5.ebuild 3741 -MD5 12e2cee7042772716fd30ce77d45fcf2 capi4k-utils-20050322.ebuild 3984 -MD5 a7ed4418a29999230d17bd0502f951c3 ChangeLog 5910 +MD5 3a618762750b5d4112dc0553b1b0b459 capi4k-utils-20050322.ebuild 4011 +MD5 5e59c1107ea2f470c003b7e5ba8c6979 ChangeLog 6112 MD5 ec2f84816306825d125d0c01bd86758d metadata.xml 163 MD5 e74f9b822b6f485ca6ff834c2699151a files/README.gentoo 1492 +MD5 bc75ed1e49b13568f93fb63a37c5dc70 files/capi-isdn 287 MD5 b5810627ea4dabf7c53540e8f75e348e files/capi.conf 1832 -MD5 a02f80ede6d0cb85cbc625bb33c43df5 files/capi.confd 464 -MD5 22d0eb7039ce2d60935b08e59fa7a1b1 files/capi.initd 1418 +MD5 299580849e0827ebd2d7f14758a5b13e files/capi.confd 568 +MD5 8d9d0a05431a8f207b901f64f280bd78 files/capi.initd 2168 MD5 5567e0f076f3d1faafcd0d4fa39a1c4e files/digest-capi4k-utils-20041006-r5 156 MD5 edc50538053b658093927f9fb28c3aff files/config 195 MD5 fa4cf0be46c4a16a2ef6fd178ed54c01 files/capi.usermap 1504 MD5 2fe94d2623c5b129780b72bacaf4a7bc files/rcapid.xinetd 236 MD5 709e4079ecd09537691845755cb9136d files/digest-capi4k-utils-20050322 75 MD5 fec82196af639d72141823a395298799 files/capi.blacklist 447 -MD5 8810eb754c81325ec7541d9ded3ddd3f files/capi.hotplug 3478 +MD5 dcb4433c68cb6f0d606b5a0a7450b81e files/capi.hotplug 3509 MD5 e74f9b822b6f485ca6ff834c2699151a files/20041006/README.gentoo 1492 MD5 fb9f9b4003d8d1647e23cf7b329386f6 files/20041006/capi.confd 424 MD5 1954a92bd07c3e2dfcfe1d68d8a290d8 files/20041006/capi.initd 1297 diff --git a/net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild b/net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild index 430b9922b6c0..0d586f058ff5 100644 --- a/net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild +++ b/net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild @@ -1,6 +1,6 @@ # 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/capi4k-utils-20050322.ebuild,v 1.3 2005/03/30 20:03:15 genstef Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild,v 1.4 2005/04/09 14:35:00 genstef Exp $ YEAR_PV=${PV:0:4} MON_PV=${PV:4:2} @@ -94,9 +94,9 @@ src_install() { insopts -m 0644 newins ${FILESDIR}/rcapid.xinetd rcapid - # install DSL sample config + # install DSL/ISDN sample config insinto /etc/ppp/peers - doins pppdcapiplugin/peers/t-dsl + doins pppdcapiplugin/peers/t-dsl ${FILESDIR}/capi-isdn # very useful tool ;-) dobin scripts/isdncause diff --git a/net-dialup/capi4k-utils/files/capi-isdn b/net-dialup/capi4k-utils/files/capi-isdn new file mode 100644 index 000000000000..97f298b9f291 --- /dev/null +++ b/net-dialup/capi4k-utils/files/capi-isdn @@ -0,0 +1,18 @@ +# +# ISDN connection using CAPI interface +# +plugin capiplugin.so +sync +protocol hdlc +/dev/null + +# Plugin passwordfd enables us to pipe the password to pppd, thus we +# don't have to put it into pap-secrets and chap-secrets. +# +plugin passwordfd.so + +noauth + +# this is recommended +noccp +noipx diff --git a/net-dialup/capi4k-utils/files/capi.confd b/net-dialup/capi4k-utils/files/capi.confd index 31dc5c9dfb11..4d0074247b2f 100644 --- a/net-dialup/capi4k-utils/files/capi.confd +++ b/net-dialup/capi4k-utils/files/capi.confd @@ -1,13 +1,16 @@ # 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.2 2005/03/29 22:16:07 genstef Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.confd,v 1.3 2005/04/09 14:35:00 genstef Exp $ # do you want to use USB hotplug? # if disabled, you have to configure your device in /etc/capi.conf -CAPI_HOTPLUG_USB=1 +CAPI_HOTPLUG_USB="yes" # should via hotplug added cards generate a beep? -CAPI_HOTPLUG_BEEP=1 +CAPI_HOTPLUG_BEEP="yes" # should CAPIDRV be loaded? -CAPI_LOAD_CAPIDRV=1 +CAPI_LOAD_CAPIDRV="yes" + +# deactivate cards on stop (USB-Cards have to be re-plugged then)? +CAPI_UNLOAD_CARDS="yes" diff --git a/net-dialup/capi4k-utils/files/capi.hotplug b/net-dialup/capi4k-utils/files/capi.hotplug index d532d63446aa..d4d33fef0cb7 100644 --- a/net-dialup/capi4k-utils/files/capi.hotplug +++ b/net-dialup/capi4k-utils/files/capi.hotplug @@ -1,11 +1,11 @@ #!/bin/bash # 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.3 2005/03/30 20:03:15 genstef Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.hotplug,v 1.4 2005/04/09 14:35:00 genstef Exp $ . /etc/conf.d/capi -[ "$CAPI_HOTPLUG_USB" = "0" ] && exit 0 +[ "$CAPI_HOTPLUG_USB" = "yes" ] || exit 0 # syslog output syslog() { # <msg> @@ -13,11 +13,11 @@ syslog() { # <msg> } beep_ok() { - [ "$CAPI_HOTPLUG_BEEP" = "0" ] || echo -en "\033[10;1200]\a\033[10;262]" > /dev/console + [ "$CAPI_HOTPLUG_BEEP" = "yes" ] && 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 + [ "$CAPI_HOTPLUG_BEEP" = "yes" ] && echo -en "\033[10;300]\a\033[10;262]" > /dev/console } # driver lookup @@ -31,7 +31,7 @@ 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})" + syslog "loading firmware '${3}' into controller ${CARD} (${NAME})" /usr/sbin/avmcapictrl load "/lib/firmware/${3}" "${CARD}" break fi @@ -93,44 +93,44 @@ esac case "$ACTION" in add) - /bin/ln 2>/dev/null -s "$$" "$LOCK" || exit 0 + /bin/ln 2>/dev/null -s "$$" "${LOCK}" || exit 0 # loading capi if ! ( [ -f /proc/capi/capi20 ] || /sbin/modprobe -sq capi ); then syslog "could not load CAPI!" - beep_error; /bin/rm -f "$LOCK"; exit 1 + beep_error; /bin/rm -f "${LOCK}"; exit 1 fi # loading driver - if ! /sbin/modprobe -sq $DRIVER; then + if ! /sbin/modprobe -sq ${DRIVER}; then syslog "could not load driver ${DRIVER}!" - beep_error; /bin/rm -f "$LOCK"; exit 1 + beep_error; /bin/rm -f "${LOCK}"; exit 1 fi # loading firmware - if [ -n "$LOADER" -a -n "$FIRMWARE" ]; then + if [ -n "${LOADER}" -a -n "${FIRMWARE}" ]; then CNT=0 # wait for udev - while [ ! -e /dev/capi20 -a $CNT -lt 10 ]; do - sleep 1; : $((CNT++)) + while [ ! -e /dev/capi20 -a $CNT -lt 20 ]; do + sleep 0.5; : $((CNT++)) done if [ -f "/lib/firmware/${FIRMWARE}" ]; then $LOADER $DRIVER $USBDEV $FIRMWARE else syslog "firmware ${FIRMWARE} not found!" - beep_error; /bin/rm -f "$LOCK"; exit 1 + beep_error; /bin/rm -f "${LOCK}"; exit 1 fi fi # loading capidrv (should be loaded *after* card driver) - if ! ( [ -f /proc/capi/capidrv -o "$CAPI_LOAD_CAPIDRV" = "0" ] || /sbin/modprobe -sq capidrv ); then + if ! ( [ -f /proc/capi/capidrv -o "$CAPI_LOAD_CAPIDRV" != "yes" ] || /sbin/modprobe -sq capidrv ); then syslog "could not load CAPIDRV!" fi - beep_ok; /bin/rm -f "$LOCK" + beep_ok; /bin/rm -f "${LOCK}" ;; remove) - /sbin/modprobe -sqr $DRIVER + /sbin/modprobe -sqr ${DRIVER} ;; esac exit 0 diff --git a/net-dialup/capi4k-utils/files/capi.initd b/net-dialup/capi4k-utils/files/capi.initd index a201560fdede..005c03f4cbbc 100644 --- a/net-dialup/capi4k-utils/files/capi.initd +++ b/net-dialup/capi4k-utils/files/capi.initd @@ -1,12 +1,12 @@ #!/sbin/runscript # 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.4 2005/03/30 20:03:15 genstef Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.initd,v 1.5 2005/04/09 14:35:00 genstef Exp $ -opts="start stop info" +opts="info showconfig" depend() { - after coldplug isapnp + after coldplug hotplug isapnp pcmcia } start() { @@ -21,40 +21,59 @@ start() { eend $? || return 1 local CNT=0 # wait for udev - while [ ! -e /dev/capi20 -a $CNT -lt 10 ]; do - sleep 1; : $((CNT++)) + while [ ! -e /dev/capi20 -a $CNT -lt 20 ]; do + sleep 0.5; : $((CNT++)) done ebegin "Starting CAPI" - if /usr/sbin/capiinit 2>/dev/null activate ; then - [ -f /proc/capi/capidrv -o "$CAPI_LOAD_CAPIDRV" = "0" ] || /sbin/modprobe -s capidrv - eindent - while read INFO; do einfo "$INFO"; done < /proc/capi/controller - eoutdent + [ -f /proc/capi/capidrv -o "$CAPI_LOAD_CAPIDRV" != "yes" ] || /sbin/modprobe -s capidrv + # eindent -> waiting for new baselayout :-/ + local INFO + while read INFO; do einfo " ${INFO}"; done < /proc/capi/controller + # eoutdent fi - eend $? } stop() { - local DRIVERS=$(/usr/bin/cut 2>/dev/null -f1 -d' ' /proc/capi/driver) + local DRV RET FCNT=0 DRIVERS=$(/bin/cut 2>/dev/null -f1 -d' ' /proc/capi/driver) - ebegin "Stopping CAPI" + # if some CAPI applications are still running, kill 'em + if /bin/fuser 2>/dev/null -s /dev/capi20; then + ebegin "Stopping CAPI applications" + /bin/fuser -ks /dev/capi20; RET=$? + while [ $RET -eq 0 -a $FCNT -lt 10 ]; do + echo -n "."; sleep 0.5; FCNT=$(($FCNT + 1)) + /bin/fuser -s /dev/capi20; RET=$? + done + [ $RET -eq 0 ] && eend 1 || eend 0 + fi - /sbin/modprobe -sqr capidrv - /usr/sbin/capiinit 2>/dev/null stop + ebegin "Stopping CAPI" + [ "$CAPI_LOAD_CAPIDRV" = "yes" ] && /sbin/modprobe -sqr capidrv + [ "$CAPI_UNLOAD_CARDS" = "yes" ] && /usr/sbin/capiinit 2>/dev/null stop for DRV in $DRIVERS; do /sbin/modprobe -sqr $DRV; done /sbin/modprobe -sqr capi - eend 0 } info() { if [ -e /proc/capi/controller ]; then - while read INFO; do einfo "$INFO"; done < /proc/capi/controller + local INFO + while read INFO; do einfo "${INFO}"; done < /proc/capi/controller else eerror "ERROR: CAPI not loaded" return 1 fi } + +showconfig() { + local TEXT INFO + if TEXT=$(/usr/sbin/capiinit 2>&1 show); then + echo "$TEXT" | while read INFO; do einfo "${INFO}"; done + return 0 + fi + echo "$TEXT" | while read INFO; do eerror "${INFO}"; done + return 1 +} |