diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-dialup/capi4k-utils | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.xz |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-dialup/capi4k-utils')
-rw-r--r-- | net-dialup/capi4k-utils/Manifest | 3 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/capi4k-utils-20050718-r6.ebuild | 182 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/README.gentoo | 86 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi-isdn | 18 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.blacklist | 30 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.conf | 86 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.confd | 36 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.hotplug | 189 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.initd | 180 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.pcmcia | 31 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.pcmcia.conf | 36 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.usermap | 23 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/config | 8 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/rcapid.xinetd | 13 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/metadata.xml | 17 |
15 files changed, 938 insertions, 0 deletions
diff --git a/net-dialup/capi4k-utils/Manifest b/net-dialup/capi4k-utils/Manifest new file mode 100644 index 00000000000..ea99332f069 --- /dev/null +++ b/net-dialup/capi4k-utils/Manifest @@ -0,0 +1,3 @@ +DIST capi4k-files-20050718-r5.tar.xz 3864 SHA256 ffeb2985c5eea7b64f95ac94e7f1065921b141a07b1b3c1e79f660edf20176a8 SHA512 df65fa9f8dd0a1286391dd5a7ec077b492b2d486904b2baae9b78726299e24bca677baa17d243dc9e712e4f591b21a8b4314b52f302f1171454024428e999557 WHIRLPOOL 4b96683d2a68fb25c09e8288c8d81a73a521b50b5f91410dd4e7afd29b1569480fe54c59e95a85bb0c72929bd27c9989c944f29d9fc89889c3cbb898b2e5be85 +DIST capi4k-patches-20050718-r5.tar.xz 12564 SHA256 e390c9a87b9b31a6934198a2c6e9e99f0dea43daa8a04ce604f13ae72c1ee24b SHA512 68f3643d39e2fe1814ab65235402fb310c751a0ea142debc9f03df56790982673b1e5a47cbecb02e96ea922be124c09d3c52db4720f1fdc1434b150d1532c337 WHIRLPOOL 2f7a6ab5c72e699a2210806f33ead77128bacbe1c7ecd1f47b7f077c3815663adb7a9a8abba9c621eff2beb32024d65f1be52598d2165ac7687e6862cf920418 +DIST capi4k-utils-2005-07-18.tar.gz 862826 SHA256 b162d726a31310fc29e7c0a25a4f82a590457f6a95c1b1168bcd72b6497b5746 SHA512 9493f2d81cb6cf39dc97a119b5133834019c7570c58c2e8aac8abff3c8ab0b37ec0630da535eadc58bc5111f70887f34d88729ddf2832dbfaf993013c40e8e47 WHIRLPOOL f69da2bfc814702ab87fadb4ce55bcc70b35866f2b47f03bc4ad89237cccd7bbd1fc583b616b364f51751ffbc41e1282aa4c2e07d6cc04c175ca2276c445b5f7 diff --git a/net-dialup/capi4k-utils/capi4k-utils-20050718-r6.ebuild b/net-dialup/capi4k-utils/capi4k-utils-20050718-r6.ebuild new file mode 100644 index 00000000000..30681a97411 --- /dev/null +++ b/net-dialup/capi4k-utils/capi4k-utils-20050718-r6.ebuild @@ -0,0 +1,182 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit eutils linux-info multilib versionator + +YEAR_PV="${PV:0:4}" +MON_PV="${PV:4:2}" +DAY_PV="${PV:6:2}" +MY_P="${PN}-${YEAR_PV}-${MON_PV}-${DAY_PV}" + +PATCHVER="5" +TARBALL_FILES="capi4k-files-${PV}-r${PATCHVER}.tar.xz" +TARBALL_PATCHES="capi4k-patches-${PV}-r${PATCHVER}.tar.xz" + +DESCRIPTION="CAPI4Linux Utils" +HOMEPAGE="ftp://ftp.in-berlin.de/pub/capi4linux/" +SRC_URI="ftp://ftp.in-berlin.de/pub/capi4linux/${MY_P}.tar.gz + ftp://ftp.in-berlin.de/pub/capi4linux/OLD/${MY_P}.tar.gz + http://sbriesen.de/gentoo/distfiles/${TARBALL_FILES} + http://sbriesen.de/gentoo/distfiles/${TARBALL_PATCHES}" + +LICENSE="GPL-2" +SLOT="0/3.0.4" +KEYWORDS="~alpha amd64 ppc x86" +IUSE="fax +pppd rcapid" + +COMMON_DEP="pppd? ( net-dialup/ppp:= )" + +DEPEND="${COMMON_DEP} + virtual/linux-sources + virtual/os-headers + app-arch/xz-utils + >=sys-apps/sed-4" + +RDEPEND="${COMMON_DEP} + dev-lang/perl" + +S="${WORKDIR}/${PN}" + +pkg_setup() { + # check kernel config + CONFIG_CHECK="~ISDN ~ISDN_CAPI ~ISDN_CAPI_CAPI20" + use pppd && CONFIG_CHECK="${CONFIG_CHECK} ~ISDN_CAPI_MIDDLEWARE ~ISDN_CAPI_CAPIFS_BOOL" + get_version # config checked later in pkg_postinst + + # find installed pppd version + if use pppd; then + local INSTALLED_PPP="$(best_version net-dialup/ppp)" + PPPVERSION="${INSTALLED_PPP#net-dialup/ppp-}" + PPPVERSION="$(version_format_string '$1.$2.$3' ${PPPVERSION})" + if [ -z "${PPPVERSION}" ]; then + die "No pppd installation found" + fi + fi +} + +src_prepare() { + # add ppp-2.4.4 support + epatch "${WORKDIR}/capi4k-patches/pppd244.diff" + + # add ppp-2.4.5 support + epatch "${WORKDIR}/capi4k-patches/pppd245.diff" + + # apply rcapid patches + epatch "${WORKDIR}/capi4k-patches/rcapid.diff" + + # apply msg2str-safety patch (see bug #170870) + epatch "${WORKDIR}/capi4k-patches/msg2str-safety.diff" + + # apply capi20.h patches (needed for glibc-2.7) + epatch "${WORKDIR}/capi4k-patches/capi20-include.diff" + + # set our config + cp -f "${WORKDIR}/capi4k-files/config" .config + # patch all Makefile.* and Rules.make to use our CFLAGS + sed -i -e "s:^\(CFLAGS.*\)-O2:\1${CFLAGS}:g" */Makefile.* */Rules.make || die "sed failed" + # patch capi20/Makefile.* to use -fPIC for shared library + sed -i -e "s:^\(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${PPPVERSION}:g" pppdcapiplugin/Makefile || die "sed failed" + # patch capiinit/capiinit.c to look also in /lib/firmware + 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" + # add --libdir to configure call in Makefile + sed -i -e "s:\(\./configure \):\1--libdir=/usr/$(get_libdir) :g" Makefile || die "sed failed" + # patch /usr/lib/pppd in pppdcapiplugin tree + sed -i -e "s:/usr/lib/pppd:/usr/$(get_libdir)/pppd:g" \ + pppdcapiplugin/ppp-*/Makefile pppdcapiplugin/{README,*.8} || die "sed failed" + # respecting LDFLAGS (see bug #293209) + sed -i -e "s:^LDFLAGS\s\(\s*\)=:LDFLAGS+\1=:g" \ + {capiinfo,capiinit,capifax,rcapid,avmb1}/Makefile* pppdcapiplugin/Rules.make || die + # build rcapid + if ! use rcapid; then + sed -i -e "s:^\(CONFIG_RCAPID=.*\)$:# \1:g" .config || die + fi + # build pppdcapiplugin + if use pppd; then + # workaround for bug #511800 + if has_version \>=net-dialup/ppp-2.4.6; then + pushd pppdcapiplugin &>/dev/null || die + mv ppp-2.4.5 "ppp-${PPPVERSION}" || die + popd &>/dev/null + fi + else + sed -i -e "s:^\(CONFIG_PPPDCAPIPLUGIN=.*\)$:# \1:g" .config || die + fi + # build capifax + if ! use fax; then + sed -i -e "s:^\(CONFIG_CAPIFAX=.*\)$:# \1:g" .config || die + fi + + epatch_user +} + +src_configure() { + # bug 468662 - we NEED to redefine AR and CC both with tc-export and at compile phase + tc-export AR CC + emake subconfig +} + +src_compile() { + # bug 468662 - we NEED to redefine AR and CC both with tc-export and at compile phase + emake AR="$(tc-getAR)" CC="$(tc-getCC)" +} + +src_install() { + default_src_install + prune_libtool_files + + # install base + dobin scripts/isdncause + newinitd "${WORKDIR}/capi4k-files/capi.initd" capi + newconfd "${WORKDIR}/capi4k-files/capi.confd" capi + insinto /etc + doins "${WORKDIR}/capi4k-files/capi.conf" + dodoc "${WORKDIR}/capi4k-files/README.gentoo" scripts/makedev.sh + + # install rcapid stuff + if use rcapid; then + insinto /etc/xinetd.d + newins "${WORKDIR}/capi4k-files/rcapid.xinetd" rcapid + newdoc rcapid/README README.rcapid + fi + + # install pppdcapiplugin stuff + if use pppd; then + insinto /etc/ppp/peers + doins pppdcapiplugin/peers/t-dsl + docinto pppdcapiplugin + dodoc pppdcapiplugin/README pppdcapiplugin/examples/* + # fixing permissions (see bug #136120) + fperms 0644 /usr/share/man/man8/capiplugin.8 + fi +} + +pkg_postinst() { + elog + elog "Please read the instructions in README.gentoo in:" + elog "/usr/share/doc/${PF}/" + elog + elog "Annotation for active AVM ISDN boards (B1 ISA/PCI, ...):" + elog "If you run" + elog " emerge isdn-firmware" + elog "you will probably find your board's firmware in /lib/firmware." + elog + elog "If you have another active ISDN board, you should create" + elog "/lib/firmware and copy there your board's firmware." + elog + 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." + elog + elog "If any of the following kernel configuration options is missing, you" + elog "should reconfigure and rebuild your kernel before using capi4k-utils." + linux-info_pkg_setup + elog +} diff --git a/net-dialup/capi4k-utils/files/README.gentoo b/net-dialup/capi4k-utils/files/README.gentoo new file mode 100644 index 00000000000..e809a58c84a --- /dev/null +++ b/net-dialup/capi4k-utils/files/README.gentoo @@ -0,0 +1,86 @@ +#################################################################### +# CAPI4Linux / Gentoo usage instructions # +#################################################################### + +First edit /etc/capi.conf to match your configuration. + +here an example for the AVM B1 PCI card: + + # card file proto io irq mem cardnr options + b1pci b1.t4 DSS1 - - - - + +First option is the name of the kernel driver, second is the firmware +file which will be uploaded to the card. All firmware files for active +ISDN controllers have to be placed in /lib/firmware. + +The 'cardnr' option can be left '-' if you only have one card. +Otherwise fill in the card number you want to assign to this card. + +'options' is a list of options which are passed via 'modprobe' to +the card driver. You can also set them somewhere in /etc/modules.d +but this is only recommended for USB based cards, where capi.conf +is normally not used/needed. + +Then you should check /etc/conf.d/capi and change it to your needs. + +Now you can start the CAPI with + + /etc/init.d/capi start + +It should show the loaded drivers/cards after the initialization. +You can check the CAPI with the 'capiinfo' command. + +So, if all runs smoothly, then fixate it + + rc-update add capi boot + +You can now install the package net-dialup/isdn4k-utils if you +want to use all the legacy ISDN apps, such as 'isdnlog'. + + +modules oder static? +~~~~~~~~~~~~~~~~~~~~ +In general it's ok to compile all ISDN/CAPI stuff into the kernel. +But I suggest to compile at least all card drivers as a module. +That includes the 'capidrv' driver! That way it's much easier to +change a card and/or unload the driver if needed. + + +hotplug or hardwired? +~~~~~~~~~~~~~~~~~~~~~ +Gentoo supports hotplug for CAPI-Cards. Just plug in your card, +wait for the beep (if enabled in /etc/conf.d/capi) and check with +'capiinfo' if your card is available to the CAPI subsystem. + +If you have more than one card and/or depend on services like +'capi4hylafax' or 'isdnlog', it's better to disable hotplug in +/etc/conf.d/capi and configure your card(s) in /etc/capi.conf. + +You can always check what card(s) are loaded with + + /etc/init.d/capi info + +If you stopped CAPI with + + /etc/init.d/capi stop + +you have to unplug all USB-cards to re-initialize them again. +Ok, reboot is another option. ;-) Using only hotplug, you can +plug in and out your card as often as you want. + + +pppdcapiplugin +~~~~~~~~~~~~~~ +please read the README and have a look at the examples. +You obviously need net-dialup/ppp to make this work. + + +rcapid +~~~~~~ +if you want to use 'rcapid' (remote capi daemon), then install +sys-apps/xinetd and configure it in /etc/xinetd.d/rcapid +and read the rcapid documentation. + + +-- +Stefan Briesenick <sbriesen@gmx.de> 2005-04-09 diff --git a/net-dialup/capi4k-utils/files/capi-isdn b/net-dialup/capi4k-utils/files/capi-isdn new file mode 100644 index 00000000000..97f298b9f29 --- /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.blacklist b/net-dialup/capi4k-utils/files/capi.blacklist new file mode 100644 index 00000000000..88e52a73006 --- /dev/null +++ b/net-dialup/capi4k-utils/files/capi.blacklist @@ -0,0 +1,30 @@ +# /etc/hotplug/blacklist.d/capi + +# CAPI USB is handled via /etc/hotplug/usb/capi.usermap +fcusb +fcusb2 +fxusb +fxusb_CZ +fcdslusb +bfusb + +# CAPI modules are loaded via /etc/init.d/capi +b1isa +b1pci +b1pcmcia +c4 +t1isa +t1pci +fcpci +fcclassic +fcdsl +fcdsl2 +fcdslsl + +# mISDN modules (experimental) +avmfritz +hfcpci +hfcsusb +hfcmulti +sedlfax +w6692pci diff --git a/net-dialup/capi4k-utils/files/capi.conf b/net-dialup/capi4k-utils/files/capi.conf new file mode 100644 index 00000000000..c2e3864e169 --- /dev/null +++ b/net-dialup/capi4k-utils/files/capi.conf @@ -0,0 +1,86 @@ +# /etc/capi.conf - CAPI configuration file + +# card file proto io irq mem cardnr options +# + +############################## +# ISA/PCI devices # +############################## + +# These are examples! You have do setup your card correctly. 'P2P' means +# 'point-to-point' (leased line) and has nothing to do with PPP. If you +# don't have a leased line, then you must not set it. + +### 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 + +### AVM t1 (you also have to install the firmware) +#t1isa t1.t4 DSS1 0x340 9 - 0 +#t1pci t1.t4 DSS1 - - - - + +### AVM FritzCard ISA (A1) +#fcclassic - - 0x200 7 - - + +### 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="no" 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 - - - - - + + +############################## +# mISDN (experimental) # +############################## + +#avmfritz - - - - - - +#hfcpci - - - - - - +#hfcsusb - - - - - - +#hfcmulti - - - - - - +#sedlfax - - - - - - +#w6692pci - - - - - - diff --git a/net-dialup/capi4k-utils/files/capi.confd b/net-dialup/capi4k-utils/files/capi.confd new file mode 100644 index 00000000000..d7e7af590cb --- /dev/null +++ b/net-dialup/capi4k-utils/files/capi.confd @@ -0,0 +1,36 @@ +# configuraton file for /etc/init.d/capi + +### +### Common settings +### + +# should 'capidrv' be loaded? +CAPI_LOAD_CAPIDRV="no" + +# deactivate cards on stop (USB-Cards have to be re-plugged then)? +CAPI_UNLOAD_CARDS="yes" + +### +### USB Hotplug +### + +# do you want to use USB hotplug? +# if disabled, you have to configure your device in /etc/capi.conf +CAPI_HOTPLUG_USB="yes" + +# should via hotplug added cards generate a beep? +CAPI_HOTPLUG_BEEP="yes" + +# should capi-usb handle hotplug-events for mISDN cards? +CAPI_HOTPLUG_MISDN="yes" + +### +### Bluetooth CIP +### + +# blank-seperated list of CIP devices to connect. You need +# started Bluez stack and already peered devices to make +# this work. Bluetooth devices will be connected after +# ISA/PCI/(USB) devices. Leave empty to disable feature. +#CAPI_CIP_DEVICES="00:11:22:33:44:55 DE:AD:BE:EF:47:11" + diff --git a/net-dialup/capi4k-utils/files/capi.hotplug b/net-dialup/capi4k-utils/files/capi.hotplug new file mode 100644 index 00000000000..593db81f9ac --- /dev/null +++ b/net-dialup/capi4k-utils/files/capi.hotplug @@ -0,0 +1,189 @@ +#!/bin/bash +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +. /etc/conf.d/capi + +[ "${CAPI_HOTPLUG_USB}" = "yes" ] || exit 0 + +# possible firmware locations (list and order taken from 'capiinit') +FWDIRS=(/lib/firmware/isdn /lib/firmware /usr/share/isdn /usr/lib/isdn /lib/isdn) + +# Syslog output +syslog() { # <msg> + /usr/bin/logger -t "capi-usb" "$@" +} + +# OK beep +beep_ok() { + [ "${CAPI_HOTPLUG_BEEP}" = "yes" ] && \ + echo -en "\033[10;1200]\a\033[10;262]" > /dev/console +} + +# Error beep +beep_error() { + [ "${CAPI_HOTPLUG_BEEP}" = "yes" ] && \ + echo -en "\033[10;300]\a\033[10;262]" > /dev/console +} + +# Driver lookup +cardinfo() { # <driver> + # /proc/capi/controller: <controller> <drivername> <state> <cardname> <controllerinfo> + /bin/sed -n "s:^\([1-9][0-9]*\) \+${1} \+\([^ ]\+\) \+\([^ ]\+\) \+\([^ ]\+\):\1 \3 \2 \4:p" \ + /proc/capi/controller 2>/dev/null +} + +# Firmware search +findfw() { # <fw_name> + local DIR + for DIR in ${FWDIRS[*]}; do + if [ -f "${DIR}/${1}" ]; then + echo "${DIR}/${1}"; return 0 + fi + done + return 1 +} + +# AVM firmware loader +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##*/}' onto controller ${CARD} (${NAME})" + /usr/sbin/avmcapictrl load "${3}" "${CARD}" || return 1 + break + fi + done < <(cardinfo "${1}") + return 0 +} + +# Split and normalize product code and device +IFS="/" +_D=(${DEVICE}) +_P=(${PRODUCT}) +_N=($(printf "%04x/%04x/%04x" 0x${_P[0]} 0x${_P[1]} 0x${_P[2]})) +unset IFS + +# Setup variables +VENDID="${_N[0]}/${_N[1]}" +USBBUS="${_D[4]}" +USBDEV="${_D[5]}" + +# Make sure we're not running multiple instances at once. +# Try twice to lock, otherwise give up. +LOCK="/var/run/capi-usb-${USBBUS}-${USBDEV}" +for ((i = 0; i < 2; i = i + 1)); do + /bin/ln 2>/dev/null -sn $$ ${LOCK} && break + LOCKPID=$(/bin/readlink 2>/dev/null ${LOCK}) || continue + [[ $(</proc/${LOCKPID}/cmdline) == $(</proc/$$/cmdline) ]] 2>/dev/null && exit 0 + /bin/rm -f ${LOCK} +done + +# Check to make sure locking was successful +if [ ! -L "${LOCK}" ]; then + syslog "could not create lock ${LOCK}" + beep_error + exit 1 +fi + +# Set a trap to remove the lockfile when we're finished +trap "/bin/rm -f ${LOCK}" 0 1 2 3 15 + +# Select driver and firmware +LOADER="" +DRIVER="" +FIRMWARE="" +case "${VENDID}" in + "057c/0c00") # FRITZCARD!USB + DRIVER="fcusb";; + "057c/1000") # FRITZCARD!USB v2.0 + DRIVER="fcusb2"; LOADER="avmusb"; FIRMWARE="fus2base.frm";; + "057c/1900") # FRITZCARD!USB v2.1 + DRIVER="fcusb2"; LOADER="avmusb"; FIRMWARE="fus3base.frm";; + "057c/2000") # FRITZX!USB + DRIVER="fxusb";; + "057c/2200") # BlueFRITZ!USB + DRIVER="bfusb"; LOADER="avmusb"; FIRMWARE="bfubase.frm";; + "057c/2300") # FRITZDSL!USB + DRIVER="fcdslusb"; LOADER="avmusb"; FIRMWARE="fdsubase.frm";; + "057c/2800") # FRITZX!USB OEM + DRIVER="fxusb_CZ";; + "057c/3500") # FRITZDSL!USB SL + DRIVER="fcdslslusb"; LOADER="avmusb"; FIRMWARE="fdlubase.frm";; + "0959/2bd0") # ISDN USB TA (Cologne Chip HFC-S USB based) + DRIVER="hfcsusb";; + "0675/1688") # DrayTek miniVigor 128 USB ISDN TA + DRIVER="hfcsusb";; + "07b0/0007") # Billion tiny USB ISDN TA 128 + DRIVER="hfcsusb";; + "0742/2008") # Stollmann USB TA + DRIVER="hfcsusb";; + "0742/2009") # Aceex USB ISDN TA + DRIVER="hfcsusb";; + "0742/200a") # OEM USB ISDN TA + DRIVER="hfcsusb";; + "08e3/0301") # Olitec USB RNIS + DRIVER="hfcsusb";; + "07fa/0846") # Bewan Modem RNIS USB + DRIVER="hfcsusb";; + "07fa/0847") # Djinn Numeris USB + DRIVER="hfcsusb";; + "07b0/0006") # Twister ISDN TA + DRIVER="hfcsusb";; + *) # unknown card + syslog "unknown USB product: ${VENDID}" + exit 1;; +esac + +if [ "${DRIVER}" = "hfcsusb" -a "${CAPI_HOTPLUG_MISDN}" != "yes" ]; then + syslog "ignore mISDN card: ${DRIVER} (${VENDID})" + exit 0 +fi + +case "${ACTION}" in + add) + # loading capi + if ! ( [ -f /proc/capi/capi20 ] || /sbin/modprobe -sq capi ); then + syslog "could not load CAPI!" + beep_error; exit 1 + fi + + # loading driver + if ! /sbin/modprobe -sq ${DRIVER}; then + syslog "could not load driver ${DRIVER}!" + beep_error; exit 1 + fi + + # loading firmware + if [ -n "${LOADER}" -a -n "${FIRMWARE}" ]; then + CNT=0 # wait for udev (max 10s) + while [ ! -c /dev/capi20 -a ${CNT} -lt 40 ]; do + sleep 0.25; : $((CNT++)) + done + FW=$(findfw "${FIRMWARE}") + if [ -n "${FW}" ]; then + if ! ${LOADER} ${DRIVER} ${USBDEV} ${FW}; then + syslog "could not load firmware!" + beep_error; exit 1 + fi + else + syslog "firmware '${FIRMWARE}' not found in ${FWDIRS[0]}" + beep_error; exit 1 + fi + fi + + # loading capidrv (should be loaded *after* card driver) + if ! ( [ -f /proc/capi/capidrv -o "${CAPI_LOAD_CAPIDRV}" != "yes" ] \ + || /sbin/modprobe -sq capidrv ); then + syslog "could not load CAPIDRV!" + fi + + beep_ok + ;; + + remove) + /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 new file mode 100644 index 00000000000..6ed53648ece --- /dev/null +++ b/net-dialup/capi4k-utils/files/capi.initd @@ -0,0 +1,180 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +opts="info showconfig" + +depend() { + after isapnp pcmcia bluetooth +} + +# possible firmware locations (list and order taken from 'capiinit') +FWDIRS="/lib/firmware/isdn /lib/firmware /usr/share/isdn /usr/lib/isdn /lib/isdn" + +# Firmware search +findfw() { # <fw_name> + local DIR + for DIR in ${FWDIRS}; do + if [ -f "${DIR}/${1}" ]; then + echo "${DIR}/${1}"; return 0 + fi + done + return 1 +} + +# looking for 'detected' cards (currently only 'sedlfax') +detected() { # <driver> + # /proc/capi/controller: <controller> <drivername> <state> <cardname> <controllerinfo> + sed -n "s:^\([1-9][0-9]*\) \+${1} \+detected \+.*:\1:p" \ + /proc/capi/controller 2>/dev/null +} + +# detecting loaded mISDN modules +misdn_modules() { + sed -n "s:^mISDN_core \+[0-9]\+ \+[0-9]\+ \+\([^ ]\+\).*\$:\1:p" \ + /proc/modules 2>/dev/null | tr "," " " +} + +# detecting loaded CAPI drivers +capi_drivers() { + local DRV MISDN=0 + for DRV in $(sed -n "s:^[0-9]\+ \+\([^ ]\+\).*\$:\1:p" /proc/capi/controller 2>/dev/null); do + case "${DRV}" in + mISDN) MISDN=1;; + ?*) echo "${DRV}";; + esac + done + # dirty hack to find loaded mISDN modules + if [ ${MISDN} -gt 0 ]; then + for DRV in $(misdn_modules); do + case "${DRV}" in + mISDN_*|l3udss1|faxl3) continue;; + ?*) echo "${DRV}";; + esac + done + fi +} + +# detecting bluetooth CIP connections +bluez_cip() { + [ -x /usr/bin/ciptool ] && \ + sed -n "s:[0-9]\+ \+cmtp \+[^ ]\+ \+\([0-9A-F:]\+\) \+.*\$:\1:p" \ + /proc/capi/controller 2>/dev/null +} + + + +start() { + if [ ! -e /etc/capi.conf ] ; then + eerror "You're missing /etc/capi.conf (comes with a capi-driver)." + eerror "Emerge net-dialup/fritzcapi if you're having an AVM Fritz!Card" + return 1 + fi + + ebegin "Loading CAPI" + [ -f /proc/capi/capi20 ] || /sbin/modprobe -s capi + eend $? || return 1 + + local CNT=0 # wait for udev (max 10s) + while [ ! -c /dev/capi20 -a ${CNT} -lt 40 ]; do + sleep 0.25; : $((CNT++)) + done + + ebegin "Starting CAPI" + /usr/sbin/capiinit activate 2>/dev/null + if eend $?; then + local CIP MSG INFO FW CARD MISDN + + # HACK: loading ISAR.BIN onto 'sedlfax' cards + # shouldn't be necessary, but mISDN is crappy + MISDN=$(detected "mISDN") + if [ -n "${MISDN}" ]; then + FW=$(findfw "ISAR.BIN") + if [ -n "${FW}" ]; then + for CARD in ${MISDN}; do + ebegin "Loading firmware '${FW##*/}' onto controller ${CARD}" + /usr/sbin/avmcapictrl load "${FW}" "${CARD}" 2>&1 >/dev/null + eend $? + done + else + eerror "Firmware 'ISAR.BIN' not found in ${FWDIRS%% *}" + fi + fi + + # connect to CIP devices + if [ -n "${CAPI_CIP_DEVICES}" -a -x /usr/bin/ciptool ]; then + for CIP in ${CAPI_CIP_DEVICES}; do + ebegin "CIP connect to ${CIP}" + INFO=$(/usr/bin/ciptool connect "${CIP}" 2>&1) + if ! eend $?; then + [ -n "${INFO}" ] && \ + echo "${INFO}" | while read line MSG; do eerror " ${MSG}"; done + fi + done + sleep 0.3 # give subsystems time to initialize + fi + + # load 'capidrv' + [ -f /proc/capi/capidrv -o "${CAPI_LOAD_CAPIDRV}" != "yes" ] || /sbin/modprobe -s capidrv + + # show controllers + INFO=$(cat /proc/capi/controller) + if [ -n "${INFO}" ]; then + einfo "Available CAPI controllers:" + echo "${INFO}" | while read MSG; do einfo " ${MSG}"; done + fi + fi + return 0 # never fail +} + +stop() { + local DRV CIP RET FCNT=0 DRIVERS=$(capi_drivers | sort -u) + + # if some CAPI applications are still running, kill 'em + if fuser -s /dev/capi20 2>/dev/null; then + ebegin "Stopping CAPI applications" + fuser -ks /dev/capi20; RET=$? + while [ ${RET} -eq 0 -a ${FCNT} -lt 10 ]; do + : $((FCNT++)); sleep 0.5; fuser -s /dev/capi20; RET=$? + done + [ ${RET} -ne 0 ] + eend $? + fi + + # release bluetooth CIP connections + for CIP in $(bluez_cip); do + ebegin "Release CIP connection to ${CIP}" + /usr/bin/ciptool release "${CIP}" + eend + done + + ebegin "Stopping CAPI" + [ "${CAPI_LOAD_CAPIDRV}" = "yes" ] && /sbin/modprobe -sqr capidrv + [ "${CAPI_UNLOAD_CARDS}" = "yes" ] && /usr/sbin/capiinit stop &>/dev/null + for DRV in ${DRIVERS}; do + /sbin/modprobe -sqr "${DRV}" + done + /sbin/modprobe -sqr capi + eend 0 # ignore errors +} + +info() { + if [ -f /proc/capi/controller ]; then + local MSG + while read MSG; do einfo "${MSG}"; done < /proc/capi/controller + else + eerror "ERROR: CAPI not loaded" + return 1 + fi +} + +showconfig() { + local MSG INFO + if INFO=$(/usr/sbin/capiinit show 2>&1); then + echo "${INFO}" | while read MSG; do einfo "${MSG}"; done + return 0 + fi + echo "${INFO}" | while read MSG; do eerror "${MSG}"; done + return 1 +} diff --git a/net-dialup/capi4k-utils/files/capi.pcmcia b/net-dialup/capi4k-utils/files/capi.pcmcia new file mode 100644 index 00000000000..77a2a760f75 --- /dev/null +++ b/net-dialup/capi4k-utils/files/capi.pcmcia @@ -0,0 +1,31 @@ +#!/bin/bash +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +. /etc/pcmcia/shared +. /etc/conf.d/capi + +# Syslog output +syslog() { # <msg> + /usr/bin/logger -t "capi-pcmcia" "$@" +} + +case "${ACTION}" in + start) + # loading capi + if ! ( [ -f /proc/capi/capi20 ] || /sbin/modprobe -sq capi ); then + syslog "could not load CAPI!" + exit 1 + fi + + # loading capidrv (should be loaded *after* card driver) + if ! ( [ -f /proc/capi/capidrv -o "${CAPI_LOAD_CAPIDRV}" != "yes" ] \ + || /sbin/modprobe -sq capidrv ); then + syslog "could not load CAPIDRV!" + fi + ;; + stop) + ;; +esac +exit 0 diff --git a/net-dialup/capi4k-utils/files/capi.pcmcia.conf b/net-dialup/capi4k-utils/files/capi.pcmcia.conf new file mode 100644 index 00000000000..8a6072b2f72 --- /dev/null +++ b/net-dialup/capi4k-utils/files/capi.pcmcia.conf @@ -0,0 +1,36 @@ +############################################################################### +# Device driver definitions for AVM cards (CAPI) # +# Please read "man 5 pcmcia" for detailed informations. # +############################################################################### + +# needs net-dialup/fritzcapi +device "fcpcmcia_cs" + class "capi" module "fcpcmcia_cs" + +# active controller, driver included in kernel +device "avm_cs" + class "capi" module "avm_cs" +# class "capi" module "b1pcmcia" module "avm_cs" +# class "capi" module "avm_cs" opts "irq_list=15,12,11,10,9,7" + + +############################################################################### +# Card definitions # +############################################################################### + +card "AVM ISDN-Controller A1" + version "AVM", "ISDN A" + bind "fcpcmcia_cs" + +card "AVM ISDN-Controller B1" + version "AVM", "ISDN-Controller B1" + bind "avm_cs" + +card "AVM Mobile ISDN-Controller M1" + version "AVM", "Mobile ISDN-Controller M1" + bind "avm_cs" + +card "AVM Mobile ISDN-Controller M2" + version "AVM", "Mobile ISDN-Controller M2" + bind "avm_cs" + diff --git a/net-dialup/capi4k-utils/files/capi.usermap b/net-dialup/capi4k-utils/files/capi.usermap new file mode 100644 index 00000000000..32adec7c791 --- /dev/null +++ b/net-dialup/capi4k-utils/files/capi.usermap @@ -0,0 +1,23 @@ +# /etc/hotplug/usb/capi.usermap + +# AVM USB cards (ISDN/DSL) +capi 0x0003 0x057c 0x0c00 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x057c 0x1000 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x057c 0x1900 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x057c 0x2000 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x057c 0x2200 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x057c 0x2300 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x057c 0x2800 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x057c 0x3500 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 + +# mISDN HFC-S USB +capi 0x0003 0x0959 0x2bd0 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x0675 0x1688 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x07b0 0x0007 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x0742 0x2008 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x0742 0x2009 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x0742 0x200a 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x08e3 0x0301 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x07fa 0x0846 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x07fa 0x0847 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +capi 0x0003 0x07b0 0x0006 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 diff --git a/net-dialup/capi4k-utils/files/config b/net-dialup/capi4k-utils/files/config new file mode 100644 index 00000000000..970991b2295 --- /dev/null +++ b/net-dialup/capi4k-utils/files/config @@ -0,0 +1,8 @@ +CONFIG_KERNELDIR='/usr/src/linux' +CONFIG_BINDIR='/usr/bin' +CONFIG_SBINDIR='/usr/sbin' +CONFIG_MANDIR='/usr/share/man' +CONFIG_AVMCAPICTRL=y +CONFIG_CAPIFAX=y +CONFIG_RCAPID=y +CONFIG_PPPDCAPIPLUGIN=y diff --git a/net-dialup/capi4k-utils/files/rcapid.xinetd b/net-dialup/capi4k-utils/files/rcapid.xinetd new file mode 100644 index 00000000000..01208331873 --- /dev/null +++ b/net-dialup/capi4k-utils/files/rcapid.xinetd @@ -0,0 +1,13 @@ +service rcapid +{ + port = 2662 + socket_type = stream + wait = no + user = root + type = unlisted + server = /usr/sbin/rcapid + server_args = -l 5 + log_on_success += USERID + log_on_failure += USERID + disable = yes +} diff --git a/net-dialup/capi4k-utils/metadata.xml b/net-dialup/capi4k-utils/metadata.xml new file mode 100644 index 00000000000..6ba78ea422b --- /dev/null +++ b/net-dialup/capi4k-utils/metadata.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>net-dialup</herd> + <longdescription lang="en"> + This package contains the CAPI 2.0 library, which is needed for all + CAPI applications. It also contains programs to show information about + installed CAPI controllers and for the receiving and sending of FAX + messages. CAPI 2.0 drivers for Linux are available for a growing + number of ISDN devices. + </longdescription> + <use> + <flag name='fax'>Install capi-fax demo programs</flag> + <flag name='pppd'>Installs pppdcapiplugin modules</flag> + <flag name='rcapid'>Installs rcapid daemon</flag> + </use> +</pkgmetadata> |