Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/dahdi-tools/files/
Date: Thu, 26 Jan 2017 22:37:38
Message-Id: 1485470193.95a826e2c8e33a425626fb6bb5db8384f88a20c3.soap@gentoo
1 commit: 95a826e2c8e33a425626fb6bb5db8384f88a20c3
2 Author: Michael Mair-Keimberger (asterix) <m.mairkeimberger <AT> gmail <DOT> com>
3 AuthorDate: Tue Jan 24 16:42:44 2017 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 26 22:36:33 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95a826e2
7
8 net-misc/dahdi-tools: remove unused file
9
10 Closes: https://github.com/gentoo/gentoo/pull/3628
11
12 net-misc/dahdi-tools/files/dahdi-autoconf.init3 | 226 ------------------------
13 1 file changed, 226 deletions(-)
14
15 diff --git a/net-misc/dahdi-tools/files/dahdi-autoconf.init3 b/net-misc/dahdi-tools/files/dahdi-autoconf.init3
16 deleted file mode 100644
17 index ac18611..00000000
18 --- a/net-misc/dahdi-tools/files/dahdi-autoconf.init3
19 +++ /dev/null
20 @@ -1,226 +0,0 @@
21 -#!/sbin/openrc-run
22 -# Copyright 1999-2012 Ultimate Linux Solutions CC
23 -# Distributed under the terms of the GNU General Public License v2
24 -
25 -depend() {
26 - before dahdi
27 - after wanrouter
28 -}
29 -
30 -dahdi_load_modules() {
31 - local hwlist loc status mod mod_vname pciid desc
32 -
33 - hwlist=$(/usr/sbin/dahdi_hardware)
34 -
35 - if [ -z "${hwlist}" ]; then
36 - einfo "No digium hardware found."
37 - ebegin "Loading module dahdi_dummy"
38 - /sbin/modprobe dahdi_dummy
39 - eend $?
40 - return
41 - fi
42 -
43 - echo "${hwlist}" | while read loc mod pciid desc; do
44 - status="${mod:${#mod}-1:1}"
45 - mod="${mod%[+-]}"
46 - mod_vname="mod_${mod}"
47 -
48 - einfo "Found $desc at $loc (module: $mod)"
49 -
50 - if [ "${status}" = "-" -a "${!mod_vname-notloaded}" = "notloaded" ]; then
51 - ebegin "Loading module $mod"
52 - /sbin/modprobe $mod
53 - eend
54 -
55 - [ $? -eq 0 ] && eval "$mod_vname=loaded"
56 - fi
57 - done
58 -}
59 -
60 -dahdi_module_unload() {
61 - local mod=$1 s
62 - [ -d /sys/module/${mod} ] || return 0
63 -
64 - for s in $(find /sys/module/${mod}/holders -type l); do
65 - dahdi_module_unload $(basename $s)
66 - done
67 -
68 - ebegin "Removing dahdi module: $mod"
69 - /sbin/rmmod $mod
70 - eend $?
71 -}
72 -
73 -dahdi_gen_fxo_config() {
74 - local port=$1
75 -
76 - echo "fxs${DAHDI_FXO_SIGNALLING-ks}=${port}"
77 - [ "${DAHDI_FXO_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${port}"
78 -}
79 -
80 -dahdi_gen_fxs_config() {
81 - local port=$1
82 -
83 - echo "fxo${DAHDI_FXO_SIGNALLING-ks}=${port}"
84 - [ "${DAHDI_FXS_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${port}"
85 -}
86 -
87 -dahdi_gen_bri_te_config() {
88 - span=$1
89 - port=$2
90 - basechan=$3
91 -
92 - echo "span=${span},${port},0,${DAHDI_BRI_FRAMING-CSS},${DAHDI_BRI_CODING-AMI}"
93 - echo "bchan=${basechan}-$(( basechan + 1 ))"
94 - echo "hardhdlc=$(( basechan + 2 ))"
95 - [ "${DAHDI_BRI_TE_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${basechan}-$(( basechan + 1 ))"
96 -}
97 -
98 -dahdi_gen_bri_nt_config() {
99 - span=$1
100 - port=$2
101 - basechan=$3
102 -
103 - echo "span=${span},0,0,${DAHDI_BRI_FRAMING-CSS},${DAHDI_BRI_CODING-AMI}"
104 - echo "bchan=${basechan}-$(( basechan + 1 ))"
105 - echo "hardhdlc=$(( basechan + 2 ))"
106 - [ "${DAHDI_BRI_NT_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${basechan}-$(( basechan + 1 ))"
107 -}
108 -
109 -dahdi_gen_e1_cpe_config() {
110 - span=$1
111 - port=$2
112 - basechan=$3
113 -
114 - echo "span=${span},${port},0,${DAHDI_E1_FRAMING-CCS},${DAHDI_E1_CODING-HDB3,CRC4}"
115 - bchans="${basechan}-$(( basechan + 14 )),$(( basechan + 16 ))-$(( basechan + 30 ))"
116 - echo "bchan=${bchans}"
117 - echo "dchan=$(( basechan + 15 ))"
118 - [ "${DAHDI_E1_CPE_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${bchans}"
119 -}
120 -
121 -dahdi_gen_e1_net_config() {
122 - span=$1
123 - port=$2
124 - basechan=$3
125 -
126 - echo "span=${span},0,0,${DAHDI_E1_FRAMING-CCS},${DAHDI_E1_CODING-HDB3,CRC4}"
127 - bchans="${basechan}-$(( basechan + 14 )),$(( basechan + 16 ))-$(( basechan + 30 ))"
128 - echo "bchan=${bchans}"
129 - echo "dchan=$(( basechan + 15 ))"
130 - [ "${DAHDI_E1_NET_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${bchans}"
131 -}
132 -
133 -dahdi_conf_span() {
134 - local span=$1
135 - local type=$2
136 - local desc=$3
137 - local port=$4
138 - local basechan=$5
139 - local vname=""
140 -
141 - # Analog we need to deal with on a port-by-port basis.
142 - [ "${type}" = "analog" ] && return 0
143 -
144 - echo -e "\n# ${desc}"
145 - case "${type}" in
146 - digital-TE)
147 - dahdi_gen_bri_te_config "${span}" "${port}" "${basechan}"
148 - ;;
149 - digital-NT)
150 - dahdi_gen_bri_nt_config "${span}" "${port}" "${basechan}"
151 - ;;
152 - digital-E1)
153 - # Use CPE by default. Unfortunately there is no easy
154 - # way to detect CPE vs NET as far as I know and specifying
155 - # in a config that you want NET mode seems the sanest way.
156 - vname="PRI_SPAN_${span}_NET"
157 - if [[ "${!vname}" = [Yy][Ee][Ss] ]]; then
158 - dahdi_gen_e1_net_config "${span}" "${port}" "${basechan}"
159 - else
160 - dahdi_gen_e1_cpe_config "${span}" "${port}" "${basechan}"
161 - fi
162 - ;;
163 - *)
164 - echo "# Don't know how to configure this (type=${type})."
165 - echo "# Please file a bug on bugs.gentoo.org and add jaco@××××××.za as CC."
166 - ;;
167 - esac
168 -}
169 -
170 -dahdi_gen_config() {
171 - local type manufacturer devicetype basechan aport atype
172 - local span=
173 - local tfile="$(mktemp)"
174 - local sfile="$(mktemp)"
175 - local plocation=""
176 - local isdnport=0
177 -
178 - /usr/sbin/dahdi_scan > "${sfile}"
179 - exec 3<"${sfile}"
180 -
181 - echo "# Automatically dahdi-autoconf generated file ($(date))." >> "${tfile}"
182 - echo "# This file WILL get regenerated whenever you restart dahdi-autoconf." >> "${tfile}"
183 -
184 - while read LINE <&3; do
185 - case "$LINE" in
186 - [[]*[]])
187 - [ -n "${span}" ] && dahdi_conf_span "${span}" "${type}" "${manufacturer} ${devicetype} (${name})" "${isdnport}" "${basechan}" >> "${tfile}"
188 - span="${LINE%?}"
189 - span="${span#?}"
190 - ;;
191 - type=*|manufacturer=*|devicetype=*|basechan=*|name=*)
192 - eval "${LINE%%=*}='${LINE#*=}'"
193 - ;;
194 - location=*)
195 - eval "${LINE%%=*}='${LINE#*=}'"
196 - if [ "${location}" == "${plocation}" ]; then
197 - (( ++isdnport ))
198 - else
199 - plocation="${location}"
200 - isdnport=1
201 - fi
202 - ;;
203 - port=*)
204 - # For analog cards only.
205 - aport="${LINE#*=}"; aport="${aport%,*}"
206 - atype="${LINE#*,}"
207 - [ "${aport}" -eq "${basechan}" ] && echo -e "\n# ${manufacturer} ${devicetype} (${name})" >> "${tfile}"
208 - case "${atype}" in
209 - FXO)
210 - dahdi_gen_fxo_config $aport >> "${tfile}"
211 - ;;
212 - FXS)
213 - dahdi_gen_fxs_config $aport >> "${tfile}"
214 - ;;
215 - esac
216 - ;;
217 - esac
218 - done
219 -
220 - [ -n "${span}" ] && dahdi_conf_span "${span}" "${type}" "${manufacturer} ${devicetype} (${name})" "${isdnport}" "${basechan}" >> "${tfile}"
221 -
222 - echo -e "\nloadzone = ${DAHDI_ZONE}\ndefaultzone = ${DAHDI_ZONE}\n## END OF AUTOCONFIGURED FILE ##" >> "${tfile}"
223 -
224 - exec 3<&-
225 -
226 - rm -f "${sfile}"
227 - mv /etc/dahdi/system.conf /etc/dahdi/system.conf.bck
228 - mv "${tfile}" /etc/dahdi/system.conf
229 -}
230 -
231 -start() {
232 - dahdi_load_modules
233 -
234 - if [ ! -r /dev/dahdi/ctl ]; then
235 - eerror "No DAHDI compatible cards detected."
236 - return 1
237 - fi
238 -
239 - ebegin "Generating DAHDI Configuration"
240 - dahdi_gen_config
241 - eend $?
242 -}
243 -
244 -stop() {
245 - dahdi_module_unload dahdi
246 -}