summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schweizer <genstef@gentoo.org>2005-03-29 22:16:07 +0000
committerStefan Schweizer <genstef@gentoo.org>2005-03-29 22:16:07 +0000
commitbe531e09460e86b1dca324e49fe386388461779a (patch)
tree24950cf91540c0bd9257824cbafccfce28b9cc19 /net-dialup/capi4k-utils
parentStable on sparc wrt #86541 (diff)
downloadgentoo-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')
-rw-r--r--net-dialup/capi4k-utils/ChangeLog7
-rw-r--r--net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild30
-rw-r--r--net-dialup/capi4k-utils/files/capi.blacklist4
-rw-r--r--net-dialup/capi4k-utils/files/capi.conf62
-rw-r--r--net-dialup/capi4k-utils/files/capi.confd6
-rw-r--r--net-dialup/capi4k-utils/files/capi.hotplug65
-rw-r--r--net-dialup/capi4k-utils/files/capi.initd29
7 files changed, 152 insertions, 51 deletions
diff --git a/net-dialup/capi4k-utils/ChangeLog b/net-dialup/capi4k-utils/ChangeLog
index fb99c138e4f0..03bcf23a0d3a 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.28 2005/03/29 06:43:28 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/ChangeLog,v 1.29 2005/03/29 22:16:07 genstef Exp $
+
+ 29 Mar 2005; Stefan Schweizer <genstef@gentoo.org> files/capi.blacklist,
+ files/capi.conf, files/capi.confd, files/capi.hotplug, files/capi.initd,
+ capi4k-utils-20050322.ebuild:
+ Improved ebuild and config-files thanks to Stefan Briesenick
*capi4k-utils-20050322 (29 Mar 2005)
diff --git a/net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild b/net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild
index 689e03d8cc14..0e402c43e47d 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.1 2005/03/29 06:43:28 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild,v 1.2 2005/03/29 22:16:07 genstef Exp $
YEAR_PV=${PV:0:4}
MON_PV=${PV:4:2}
@@ -37,13 +37,15 @@ src_unpack() {
# patch includes of all *.c files
sed -i -e "s:linux/capi.h>$:linux/compiler.h>\n#include <linux/capi.h>:g" */*.c || die "sed failed"
# patch all Makefile.am and Rules.make to use our CFLAGS
- sed -i -e "s:^CFLAGS\(.*\)-O2:CFLAGS\1${CFLAGS}:g" */Makefile.am */Rules.make || die "sed failed"
+ sed -i -e "s:^CFLAGS\(.*\)-O2:CFLAGS\1${CFLAGS}:g" */Makefile.* */Rules.make || die "sed failed"
# patch capi20/Makefile.am to use -fPIC for shared library
- sed -i -e "s:^\(libcapi20_la_CFLAGS = \):\1-fPIC :g" capi20/Makefile.am || die "sed failed"
+ sed -i -e "s:^\(libcapi20_la_CFLAGS = \):\1-fPIC :g" capi20/Makefile.* || die "sed failed"
# patch pppdcapiplugin/Makefile to use only the ppp versions we want
sed -i -e "s:^\(PPPVERSIONS = \).*$:\1${PPPVERSIONS}:g" pppdcapiplugin/Makefile || die "sed failed"
# patch capiinit/capiinit.c to look also in /lib/firmware
- sed -i -e "/\"\/usr\/share\/isdn\"/i\"/lib/firmware\"," capiinit/capiinit.c || die "sed failed"
+ sed -i -e "s:\(\"/lib/firmware/isdn\",\):\1 \"/lib/firmware\",:g" capiinit/capiinit.c || die "sed failed"
+ # no, we don't need any devices nodes
+ sed -i -e "s:\(sh scripts/makedev.sh\):echo \1:g" Makefile || die "sed failed"
}
src_compile() {
@@ -52,8 +54,7 @@ src_compile() {
ebegin "Updating autotools-generated files"
aclocal -I . || die "aclocal failed"
automake -a || die "automake failed"
- export WANT_AUTOCONF=2.5
- autoconf || die "autoconf failed"
+ WANT_AUTOCONF=2.5 autoconf || die "autoconf failed"
libtoolize -f -c || die "libtoolize failed"
eend $?
cd ${S}
@@ -63,17 +64,15 @@ src_compile() {
}
src_install() {
- dodir /dev
make DESTDIR=${D} install || die "make install failed"
# install docs
newdoc rcapid/README README.rcapid
- newdoc pppdcapiplugin/README README.pppdcapiplugin
dodoc scripts/makedev.sh ${FILESDIR}/README.gentoo
- docinto pppdcapiplugin.examples; dodoc pppdcapiplugin/examples/*
+ docinto pppdcapiplugin; dodoc pppdcapiplugin/README pppdcapiplugin/examples/*
# install init-script + init-config
- dodir /etc/conf.d # BUG: w/o newconfd failes
+ dodir /etc/conf.d # BUG: w/o newconfd fails
newinitd ${FILESDIR}/capi.initd capi
newconfd ${FILESDIR}/capi.confd capi
@@ -100,14 +99,21 @@ src_install() {
}
pkg_postinst() {
+ einfo
einfo "Please read the instructions in:"
einfo "/usr/share/doc/${PF}/README.gentoo.gz"
- einfo ""
+ einfo
einfo "Annotation for active AVM ISDN boards (B1 ISA/PCI, ...):"
einfo "If you run"
einfo " emerge isdn-firmware"
einfo "you will probably find your board's firmware in /lib/firmware."
- einfo ""
+ einfo
einfo "If you have another active ISDN board, you should create"
einfo "/lib/firmware and copy there your board's firmware."
+ einfo
+ ewarn "If you're upgrading from an older capi4k-utils, you must recompile"
+ ewarn "the other packages on your system that link with libcapi after the"
+ ewarn "upgrade completes. To perform this action, please run revdep-rebuild"
+ ewarn "in package app-portage/gentoolkit."
+ ewarn
}
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
}