From 06244ce555ca4826aa9dc4dbd36a2b5dde6b0cdb Mon Sep 17 00:00:00 2001 From: Nadi Sarrar Date: Tue, 3 Apr 2007 08:39:08 +0000 Subject: [PATCH] remove deprecated misdn-init and update Makefile and README --- Makefile | 16 +- README.misdn-init | 55 --- config/README.mISDN | 6 +- mISDN.modprobe.d | 25 -- misdn-init | 792 -------------------------------------------- 5 files changed, 5 insertions(+), 889 deletions(-) delete mode 100644 README.misdn-init delete mode 100644 mISDN.modprobe.d delete mode 100755 misdn-init diff --git a/Makefile b/Makefile index e8be2d6..8364c8b 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ all: VERSION test_old_misdn cp $(MISDNDIR)/drivers/isdn/hardware/mISDN/Makefile.v2.6 $(MISDNDIR)/drivers/isdn/hardware/mISDN/Makefile export MINCLUDES=$(MISDNDIR)/include ; export MISDNVERSION=$(MISDNVERSION); make -C $(LINUX) SUBDIRS=$(MISDN_SRC) modules $(CONFIGS) -install: all modules-install misdn-init +install: all modules-install $(DEPMOD) $(UPDATE_MODULES) $(MODULES_UPDATE) @@ -62,18 +62,6 @@ modules-install: mkdir -p $(INSTALL_PREFIX)/usr/include/linux/ cp $(MISDNDIR)/include/linux/*.h $(INSTALL_PREFIX)/usr/include/linux/ -misdn-init: - mkdir -p $(INSTALL_PREFIX)/usr/sbin/ - install -m755 misdn-init $(INSTALL_PREFIX)/usr/sbin/ - if [ -d $(INSTALL_PREFIX)/etc/init.d ]; then \ - if [ -e $(INSTALL_PREFIX)/etc/init.d/misdn-init ]; then rm -rf $(INSTALL_PREFIX)/etc/init.d/misdn-init; fi; \ - ln -s $(INSTALL_PREFIX)/usr/sbin/misdn-init $(INSTALL_PREFIX)/etc/init.d/misdn-init; \ - fi - mkdir -p $(INSTALL_PREFIX)/etc/modprobe.d - cp mISDN.modprobe.d $(INSTALL_PREFIX)/etc/modprobe.d/mISDN - mkdir -p $(INSTALL_PREFIX)/etc/modules.d - cp mISDN.modprobe.d $(INSTALL_PREFIX)/etc/modules.d/mISDN - test_old_misdn: @if echo -ne "#include " | gcc -C -E - 2>/dev/null 1>/dev/null ; then \ if ! echo -ne "#include \n#if MISDN_MAJOR_VERSION < 4\n#error old mISDNif.h\n#endif\n" | gcc -C -E - 2>/dev/null 1>/dev/null ; then \ @@ -85,7 +73,7 @@ test_old_misdn: -.PHONY: modules-install install all clean misdn-init VERSION +.PHONY: modules-install install all clean VERSION force: rm -f $(LINUX)/include/linux/mISDNif.h diff --git a/README.misdn-init b/README.misdn-init deleted file mode 100644 index 4d6c500..0000000 --- a/README.misdn-init +++ /dev/null @@ -1,55 +0,0 @@ -misdn-init: init-script to auto-configure and load the mISDN kernel drivers -=========================================================================== - -This script makes it easy to configure and activate mISDN compatible -adapter cards. It scans an eyecandy config file named misdn-init.conf -for your card and port settings, then it loads the driver modules properly. -The misdn-init.conf can also be autogenerated by the misdn-init script. - ---------------------------------------------------------------------------- -Usage: /usr/sbin/misdn-init start|stop|restart|config|scan|help - - --start scan /etc/misdn-init.conf and load the mISDN drivers - --stop unload the mISDN drivers - --restart see stop, then start - --config scan your PCI bus for mISDN compatible hardware and generate - a /etc/misdn-init.conf - --scan scan your PCI bus for mISDN compatible hardware and print - the results to the console - --help print the usage info ---------------------------------------------------------------------------- - - -* Here is a quick overview on how to use misdn-init: - -1) Get and install misdn-init: - $ wget http://www.beronet.com/downloads/chan_misdn/stable/chan_misdn.tar.gz - $ tar zxf chan_misdn.tar.gz - $ (as root) cp chan_misdn/misdn-init /usr/sbin/misdn-init - -2) Let misdn-init scan your PCI bus for mISDN compatible hardware and write - the results into /etc/misdn-init.conf: - $ (as root) /usr/sbin/misdn-init config - -3) (optional) Edit /etc/misdn-init.conf and set everything the way you want it. - This file is heavily commented, hence it should be self-explaining. - -4) (optional, but recommended) Add misdn-init to your run level. - This is distribution dependend. Here an example for a debian system: - ATTENTION: If you have services in your runlevels that depend - on mISDN, make sure that misdn-init starts before, and - stops after them (this is done by changing the values - that are set to 60 in this example, more info: read the - manpage for update-rc.d). - $ (as root) update-rc.d misdn-init start 60 2 3 4 5 . stop 60 0 1 6 . - -5) Run the following to start mISDN: - $ (as root) /usr/sbin/misdn-init start - - - ---------------------------------------------------------------------------- -* Report Bugs: -If you experience any bugs or have a feature request, please visit: -www.isdn4linux.de/mantis - diff --git a/config/README.mISDN b/config/README.mISDN index dcb5693..21ec178 100644 --- a/config/README.mISDN +++ b/config/README.mISDN @@ -3,7 +3,7 @@ This script makes it easy to configure and activate mISDN compatible adapter cards. It scans an eyecandy config file named mISDN.conf for your card and port settings, then it loads the driver modules properly. -The misdn-init.conf can also be autogenerated by the mISDN script. +The mISDN.conf can also be autogenerated by the mISDN script. --------------------------------------------------------------------------- @@ -17,9 +17,9 @@ xsltproc on debian, just type: On other distros the package name might be libxmtools or likewise. --------------------------------------------------------------------------- -Usage: /usr/sbin/misdn-init start|stop|restart|config|scan|help +Usage: /usr/sbin/mISDN start|stop|restart|config|scan|help - --start scan /etc/misdn-init.conf and load the mISDN drivers + --start scan /etc/mISDN.conf and load the mISDN drivers --stop unload the mISDN drivers --restart see stop, then start --config scan your PCI bus for mISDN compatible hardware and generate diff --git a/mISDN.modprobe.d b/mISDN.modprobe.d deleted file mode 100644 index 396de54..0000000 --- a/mISDN.modprobe.d +++ /dev/null @@ -1,25 +0,0 @@ - -install hfcmulti /usr/sbin/misdn-init start hfcmulti -remove hfcmulti /usr/sbin/misdn-init stop - -install hfcpci /usr/sbin/misdn-init start hfcpci -remove hfcpci /usr/sbin/misdn-init stop - -install hfcsusb /usr/sbin/misdn-init start hfcsusb -remove hfcsusb /usr/sbin/misdn-init stop - -install hfcsmini /usr/sbin/misdn-init start hfcsmini -remove hfcsmini /usr/sbin/misdn-init stop - -install xhfc /usr/sbin/misdn-init start xhfc -remove xhfc /usr/sbin/misdn-init stop - -install avmfritz /usr/sbin/misdn-init start avmfritz -remove avmfritz /usr/sbin/misdn-init stop - -install w6692pci /usr/sbin/misdn-init start w6692pci -remove w6692pci /usr/sbin/misdn-init stop - -install sedlfax /usr/sbin/misdn-init start sedlfax -remove sedlfax /usr/sbin/misdn-init stop - diff --git a/misdn-init b/misdn-init deleted file mode 100755 index e02bbc5..0000000 --- a/misdn-init +++ /dev/null @@ -1,792 +0,0 @@ -#!/bin/bash - -################################################################################ -# -# misdn-init init script -# -# Copyright (C) 2005, Nadi Sarrar -# -# Nadi Sarrar -# -# This program is free software, distributed under the terms of -# the GNU General Public License -# - -# -# USAGE: -# -# /usr/sbin/misdn-init start|stop|restart|config|scan|help -# - -# chkconfig: 2345 35 60 -# description: mISDN Kernel Modules - -# -# CONFIGURATION: -# -# Path to your misdn-init.conf: -# -misdn_init_conf="/etc/misdn-init.conf" -# -################################################################################ - -# -# change this to modify the user/group settings of /dev/mISDN -# -USER=asterisk -GROUP=asterisk - -# HFC 8/4 (S0) Options -master_clock=17 - -# HFC-E1 Options -optical=17 -los=19 -ais=20 -slip=21 -nocrc4=24 - -# Card Settings -ulaw=9 -dtmf=10 -pcm_slave=12 -ignore_pcm_frameclock=13 - -rxclock=14 -crystalclock=19 - -watchdog=20 - - -#dsp defaults -dsp_options=0 - -poll_option= - -dsp_poll_option= - -dtmfthreshold_option= - -function check_cmd { - if ! which "${1}" > /dev/null; then - if [ "$(id -u)" != "0" ]; then - echo "[!!] FATAL: $1 not in path, please install and/or be root." - else - echo "[!!] FATAL: $1 not in path, please install." - fi - if [ "${2}" != "notfatal" ] ; then - exit 1 - fi - else - var=$(echo ${1} | tr a-z A-Z) - eval "$var=`which ${1}`" - fi -} - -check_cmd modprobe -check_cmd modinfo -check_cmd rmmod -check_cmd insmod -check_cmd lspci -check_cmd lsusb notfatal -check_cmd mknod -check_cmd bc -check_cmd cut -check_cmd wc - -function check_asterisk { - if ps ax | grep -v grep | grep asterisk > /dev/null ; then asterisk -rx "stop now" ; fi -} - -function create_card_db -{ - cardline="" - cardcount=1 - skipnext=0 - - IFS=$'\n' - NL=" -" - function addcard { - cardline="${cardline}${cardcount},${1}${NL}" - let "cardcount = ${cardcount} + 1" - } - - function addport { - let "portcount = ${portcount} + ${1}" - } - - for line in $(${LSPCI} -n -d 0xd161:b410); do - addcard "4,0x4" - done - - for line in $(${LSPCI} -n | sed -n 's/^\(0000:\|\)\([0-9a-f]\{2\}:[0-9a-f]\{2\}.[0-9a-f]\{1\}\)\( Class \| \)[0-9a-f]\{4\}: 1397:\([0-9a-f]\{4\}\).*$/\4 \2/p'); do - if [ ${skipnext} -eq 1 ]; then - skipnext=0 - continue - fi - case "${line}" in - 30b1*) - case "${line:5}" in - 00*) - addcard "1,0x1" - ;; - *) - if [ $(${LSPCI} -n -s ${line:5:3} | ${WC} -l) -eq 2 ]; then - addcard "2,2E1" - skipnext=1 - else - addcard "1,0x1" - fi - ;; - esac - ;; - 16b8*) - addcard "8,0x8" - ;; - 08b4*) - - if ${LSPCI} -n -v -s "${line:5}" | grep "Subsystem" | grep "1397:b567" > /dev/null ; then - addcard "1,0x4" - elif ${LSPCI} -n -v -s "${line:5}" | grep "Subsystem" | grep "1397:b566\|1397:b569" > /dev/null ; then - addcard "2,0x4" - else - addcard "4,0x4" - fi - ;; - esac - done - for line in $(${LSPCI} -n | grep "1397:\(2bd\(0\|6\|7\|8\|9\|a\|b\|c\)\|b100\)\|1043:0675\|0871:ffa\(1\|2\)\|1051:0100\|15b0:2bd0\|114f:007\(0\|1\|2\|3\)\|13d1:2bd1\|182d:3069"); do - addcard "1,hfcpci" - done - for line in $(${LSPCI} -n | grep "1244:\(0a00\|0e00\)"); do - addcard "1,avmfritz" - done - for line in $(${LSPCI} -n -d 1050:6692); do - addcard "1,w6692pci" - done - - if [ -e ${LSUSB} ]; then - for line in $(${LSUSB} | grep "0959:2bd0\|0675:1688\|07b0:0007\|0742:200\(7\|8\|9\|A\)\|08e3:0301\|07fa:084\(7\|8\)\|07ba:0006"); do - addcard "1,hfcsusb" - done - fi - - echo "${cardline}" -} - -function load_card_modules { - - carddb=$(create_card_db) - - function find_carddb_line { - i=1 - for l in ${carddb} ; do - if [ $i -eq $1 ] ; then - echo $l - return - fi - let "i=$i+1" - done - } - - if [ ! -z "$1" ] ; then - echo "Loading only $1" - fi - - IFS=$'\n' - skipnr=0 - - for line in $(sed -n -e '/^[^#]/p' ${misdn_init_conf}); - do - var=$(echo "${line}" | ${CUT} -d "=" -f1) - val=$(echo "${line}" | ${CUT} -d "=" -f2) - - case "${var}" in - card) - #echo "processing line: $val" - nr=$(echo "${val}" | ${CUT} -d "," -f1) - mod=$(echo "${val}" | ${CUT} -d "," -f2) - opns=$(echo "${val}" | ${CUT} -d "," -f3-) - - #getting portcount from carddb - ports=$(find_carddb_line $nr | ${CUT} -d "," -f2) - let "nr = ${nr} + ${skipnr}" - #echo "nr $nr ports $ports mod $mod opns: $opns" - - case "${mod}" in - 2E1) - hfcmulti[${nr}]=1 - hfcmulti[$((${nr} + 1))]=1 - let "hfcports = ${hfcports} + ${ports}" - IFS=$',' - for li in ${opns}; do - hfcmulti[${nr}]=$(echo "obase=10;2^(${!li}-1)+${hfcmulti[${nr}]}" | ${BC}) - if [ "${li}" != "pcm_slave" ]; then - hfcmulti[$((${nr} + 1))]=$(echo "obase=10;2^(${!li}-1)+${hfcmulti[$((${nr}+1))]}" | ${BC}) - fi - done - IFS=$'\n' - hfcmulti[$((${nr} + 1))]=$(echo "obase=10;2^(${pcm_slave}-1)+${hfcmulti[$((${nr}+1))]}" | ${BC}) - let "skipnr = ${skipnr} + 1" - ;; - 0x*) - hfcmulti[${nr}]=$(echo ${mod} | sed -e "s/^0x\([0-9]*\)/\1/") - let "hfcports = ${hfcports} + ${ports}" - IFS=$',' - for li in ${opns}; do - hfcmulti[${nr}]=$(echo "obase=10;2^(${!li}-1)+${hfcmulti[${nr}]}" | ${BC}) - done - IFS=$'\n' - ;; - *) - other_card[${nr}]=${mod} - ;; - esac - ;; - te_ptp) - IFS=$',' - for li in ${val}; do - layermask[${li}]="0xf" - protocol[${li}]=34 # 0x22 == 34 - done - IFS=$'\n' - ;; - te_ptmp) - IFS=$',' - for li in ${val}; do - layermask[${li}]="0xf" - protocol[${li}]=2 # 0x2 == 2 - done - IFS=$'\n' - ;; - nt_*) - IFS=$',' - for li in ${val}; do - layermask[${li}]="0x3" - protocol[${li}]=18 # 0x12 == 18 - done - IFS=$'\n' - ;; - te_capi_ptp) - IFS=$',' - for li in ${val}; do - layermask[${li}]="0x0" - protocol[${li}]=34 # 0x22 == 34 - done - IFS=$'\n' - - export addcapi=1 - ;; - te_capi_ptmp) - IFS=$',' - for li in ${val}; do - layermask[${li}]="0x0" - protocol[${li}]=2 # 0x2 == 2 - done - IFS=$'\n' - - export addcapi=1 - ;; - - option) - port=`echo "${val}" | sed -e "s/^\([0-9]*\),.*/\1/"` - opt=`echo "${val}" | sed -e "s/^[0-9]*,\(.*\)/\1/"` - - if [ -z ${protocol[${port}]} ]; then - protocol[${port}]="0" - fi - - IFS=$',' - for li in ${opt}; do - protocol[${port}]=$(echo "obase=10;2^(${!li}-1)+${protocol[${port}]}" | ${BC}) - done - IFS=$'\n' - ;; - poll) - poll=${val} - poll_option=poll=${val} - ;; - dsp_poll) - dsp_poll_option=poll=${val} - ;; - pcm) - pcm=${val} - ;; - dsp_options) - export dsp_options=${val} - ;; - dtmfthreshold) - export dtmfthreshold_option="dtmfthreshold=${val}" - ;; - debug) - debug=${val} - ;; - timer) - timer=${val} - ;; - *) - echo "unknown variable: ${var}" - ;; - esac - - done - - echo "-----------------------------------------" - echo " Loading module(s) for your misdn-cards:" - echo "-----------------------------------------" - - card_index=1 - port_index=1 - while [ ! -z ${hfcmulti[${card_index}]} ] || [ ! -z ${other_card[${card_index}]} ]; - do - if [ ! -z ${hfcmulti[${card_index}]} ]; then - # MODPROBE COMMAND FOR hfcmulti CARD - hfcmulti_type="type=" - hfcmulti_prot="protocol=" - hfcmulti_layer="layermask=" - while [ ! -z ${hfcmulti[${card_index}]} ]; - do - hfcmulti_type="${hfcmulti_type}$(echo "obase=16;\"0x\";${hfcmulti[${card_index}]}" | ${BC} )," - let "card_index = ${card_index} + 1" - done - while [ ${hfcports} -gt 0 ]; - do - if [ ! -z ${protocol[${port_index}]} ]; then - hfcmulti_prot="${hfcmulti_prot}$(echo "obase=16;\"0x\";${protocol[${port_index}]}" | ${BC})," - else - hfcmulti_prot="${hfcmulti_prot}0x2," - fi - if [ ! -z ${layermask[${port_index}]} ]; then - hfcmulti_layer="${hfcmulti_layer}${layermask[${port_index}]}," - else - hfcmulti_layer="${hfcmulti_layer}0xf," - fi - let "port_index = ${port_index} + 1" - let "hfcports = ${hfcports} - 1" - done - hfcmulti_type="$(echo ${hfcmulti_type} | sed -e 's/^\(.*\),$/\1/')" - hfcmulti_prot="$(echo ${hfcmulti_prot} | sed -e 's/^\(.*\),$/\1/')" - hfcmulti_layer="$(echo ${hfcmulti_layer} | sed -e 's/^\(.*\),$/\1/')" - hfcmulti_cmd="${MODPROBE} --ignore-install hfcmulti ${hfcmulti_type} ${hfcmulti_prot} ${hfcmulti_layer}" - if [ ! -z ${poll} ]; then - hfcmulti_cmd="${hfcmulti_cmd} poll=${poll}" - fi - if [ ! -z ${pcm} ]; then - hfcmulti_cmd="${hfcmulti_cmd} pcm=${pcm}" - fi - if [ ! -z ${debug} ]; then - hfcmulti_cmd="${hfcmulti_cmd} debug=${debug}" - fi - - if [ ! -z ${timer} ]; then - hfcmulti_cmd="${hfcmulti_cmd} timer=${timer}" - fi - - if [ -z "$1" ] ; then - echo ${hfcmulti_cmd} - eval ${hfcmulti_cmd} - else - if [ "$1" = "hfcmulti" ] ; then - echo ${hfcmulti_cmd} - eval ${hfcmulti_cmd} - fi - fi - else - # MODPROBE COMMAND FOR _NON_ hfcmulti CARD - other_mod="${other_card[${card_index}]}" - other_cmd="${MODPROBE} --ignore-install ${other_mod}" - if [ ! -z ${protocol[${port_index}]} ]; then - other_prot="protocol=$(echo "obase=16;\"0x\";${protocol[${port_index}]}" | ${BC})," - else - other_prot="protocol=0x2," - fi - if [ ! -z ${layermask[${port_index}]} ]; then - other_layer="layermask=${layermask[${port_index}]}," - else - other_layer="layermask=0xf," - fi - other_extra="" - modinfo $other_mod | egrep -q 'parm: *poll' && other_extra="$other_extra ${poll_option}" - - let "prev = ${card_index}" - let "card_index = ${card_index} + 1" - let "port_index = ${port_index} + 1" - while [ "${other_card[${card_index}]}" == "${other_card[${prev}]}" ]; - do - if [ ! -z ${protocol[${port_index}]} ]; then - other_prot="${other_prot}$(echo "obase=16;\"0x\";${protocol[${port_index}]}" | ${BC})," - else - other_prot="${other_prot}0x2," - fi - if [ ! -z ${layermask[${port_index}]} ]; then - other_layer="${other_layer}${layermask[${port_index}]}," - else - other_layer="${other_layer}0xf," - fi - let "prev = ${card_index}" - let "card_index = ${card_index} + 1" - let "port_index = ${port_index} + 1" - done - - other_prot="$(echo ${other_prot} | sed -e 's/^\(.*\),$/\1/')" - other_layer="$(echo ${other_layer} | sed -e 's/^\(.*\),$/\1/')" - other_cmd="${other_cmd} ${other_prot} ${other_layer} ${other_extra}" - - if [ -z "$1" ] ; then - echo "${other_cmd}" - eval ${other_cmd} - else - if [ "$1" = "${other_card[${prev}]}" ] ; then - echo ${other_cmd} - eval ${other_cmd} - fi - fi - - - fi - done -} - -function unload_card_modules { - - IFS=$'\n' - - for line in $(sed -ne '/^[^#]/p' ${misdn_init_conf}); - do - var=$(echo "${line}" | ${CUT} -d "=" -f 1) - val=$(echo "${line}" | ${CUT} -d "=" -f 2) - - case "${var}" in - card) - nr=$(echo "${val}" | ${CUT} -d "," -f 1) - mod=$(echo "${val}" | ${CUT} -d "," -f 2) - case "${mod}" in - 2E1) - modulelist[${nr}]=hfcmulti - ;; - 0x*) - modulelist[${nr}]=hfcmulti - ;; - *) - modulelist[${nr}]=${mod} - ;; - esac - ;; - esac - - done - - echo "-------------------------------------------" - echo " Unloading module(s) for your misdn-cards:" - echo "-------------------------------------------" - - rmmod_cmd="${RMMOD} ${modulelist[1]}" - echo "${rmmod_cmd}" - eval ${rmmod_cmd} - - index=2 - prev=1 - while [ ! -z ${modulelist[${index}]} ]; - do - if [ ${modulelist[${index}]} != ${modulelist[${prev}]} ]; then - rmmod_cmd="${RMMOD} ${modulelist[${index}]}" - echo "${rmmod_cmd}" - eval ${rmmod_cmd} - fi - let "prev = ${index}" - let "index = ${index} + 1" - done -} - -function create_misdn_init_conf { - cardline="" - cardcount=1 - portcount=0 - cardconf="" - IFS=$'\n' - NL=" -" - carddb=$(create_card_db) - - for line in $carddb ; do - tmp="card=$(echo $line | ${CUT} -d, -f1,3)" - let "portcount = ${portcount} + $(echo $line | ${CUT} -d, -f2)" - cardline="${cardline}${tmp}${NL}" - done - - function die { - echo "[!!] ${1}" - exit 1 - } - - if [ "${1}" == "scan" ]; then - echo "[OK] found the following devices:" - echo "${cardline}[ii] run \"/usr/sbin/misdn-init config\" to store this information to ${misdn_init_conf}" - else - - index=1 - portline="te_ptmp=" - while [ ${index} -le ${portcount} ]; do - portline="${portline}${index}," - let "index = ${index} + 1" - done - portline="$(echo ${portline} | sed -e 's/^\(.*\),$/\1/')" - - misdn_cfg_pt1="# -# Configuration file for your misdn hardware -# -# Usage: /usr/sbin/misdn-init start|stop|restart|config|scan|help -# - -# -# Card Settings -# -# Syntax: card=,[,