Bug#935582: dahdi: dahdi_genconf fail with .../spantype: No such file or directory

2019-08-24 Thread Petter Reinholdtsen
[Tzafrir Cohen]
> I believe that this is https://bugs.debian.org/cgi-bin/916577 .
>
> Could you please test this with the Bullseye package (I believe you
> should be able to install it as-is on the Buster system)?

I tested with dahdi_3.0.0-1_amd64.deb, and the 'cat' error is gone, but
I still do not get any valid configuration:

# dahdi_hardware 
pci::01:05.0 wctdm+   e159:0001 Wildcard TDM400P REV I
# dahdi_genconf -
Default parameters from /etc/dahdi/genconf_parameters
Empty configuration -- no spans
Generating /etc/dahdi/assigned-spans.conf
Empty configuration -- no spans
Generating /etc/dahdi/system.conf
Empty configuration -- no spans
Generating /etc/asterisk/dahdi-channels.conf
#

-- 
Happy hacking
Petter Reinholdtsen



Bug#935582: dahdi: dahdi_genconf fail with .../spantype: No such file or directory

2019-08-24 Thread Tzafrir Cohen
On 24/08/2019 10:49, Petter Reinholdtsen wrote:
> 
> Package: dahdi
> Version: 1:2.11.1-3
> Severity: important
> 
> I am trying to set up Asterisk on Debian Buster, and discovered that
> dahdi_genconf do not work, possibly because 'dahdi_span_assignments
> list' fail.

I believe that this is https://bugs.debian.org/cgi-bin/916577 .

Could you please test this with the Bullseye package (I believe you
should be able to install it as-is on the Buster system)?

-- Tzafrir



Bug#935582: dahdi: dahdi_genconf fail with .../spantype: No such file or directory

2019-08-24 Thread Petter Reinholdtsen


Package: dahdi
Version: 1:2.11.1-3
Severity: important

I am trying to set up Asterisk on Debian Buster, and discovered that
dahdi_genconf do not work, possibly because 'dahdi_span_assignments
list' fail.

This is the output when trying to configure dahdi:

# dahdi_genconf -v
Default parameters from /etc/dahdi/genconf_parameters
Empty configuration -- no spans
Generating /etc/dahdi/assigned-spans.conf
cut: '/sys/bus/dahdi_devices/devices/pci::01:05.0/spantype': No such file 
or directory
Empty configuration -- no spans
Generating /etc/dahdi/system.conf
Empty configuration -- no spans
Generating /etc/asterisk/dahdi-channels.conf
#

And this is the output from the failing command:

# dahdi_span_assignments list
cut: '/sys/bus/dahdi_devices/devices/pci::01:05.0/spantype': No such file 
or directory
#

The cause for this message seem to be that 'spantype' is no longer
available from the kernel driver.  There is a file named
'dahdi_spantype', perhaps it can be used?  I tried to modify the scripts
to use dahdi_spantype instead, and the error message went away, but
still no channels defined. :(

This is the patch I applied:

--- /usr/sbin/dahdi_span_assignments.orig   2017-10-11 08:13:56.0 
+0200
+++ /usr/sbin/dahdi_span_assignments2019-08-24 09:44:46.758596787 +0200
@@ -156,7 +156,7 @@
devpath=`cd "$device" && pwd -P`
location='@'`attr_clean "$device/location"`
hardware_id=`attr_clean "$device/hardware_id"`
-   for local_spanno in `cut -d: -f1 "$device/spantype"`
+   for local_spanno in `cut -d: -f1 "$device/dahdi_spantype"`
do
span=`grep 2>/dev/null -Hw "$local_spanno" 
"$device/span-"*"/local_spanno" | \
sed -e 's,/local_spanno:.*,,' -e 's,.*/,,'`
@@ -191,7 +191,7 @@
id="$devpath"
fi
echo "# Device: [$hardware_id] @$location $devpath"
-   for local_spanno in `cut -d: -f1 "$device/spantype"`
+   for local_spanno in `cut -d: -f1 "$device/dahdi_spantype"`
do
span=`grep 2>/dev/null -Hw "$local_spanno" 
"$device/span-"*"/local_spanno" | \
sed -e 's,/local_spanno:.*,,' -e 's,.*/,,'`
--- /usr/sbin/dahdi_span_types.orig 2019-08-24 09:42:29.335112098 +0200
+++ /usr/sbin/dahdi_span_types  2019-08-24 09:42:52.013050012 +0200
@@ -176,7 +176,7 @@
devpath=`cd "$device" && pwd -P`
location='@'`attr_clean "$device/location"`
hardware_id=`attr_clean "$device/hardware_id"`
-   cat "$device/spantype" | while read st; do
+   cat "$device/dahdi_spantype" | while read st; do
case "$st" in
*:[ETJ]1)
printf "%-10s %-20s %-30s %s\n" \
--- /usr/sbin/dahdi_waitfor_span_assignments.orig   2019-08-24 
09:44:03.650535925 +0200
+++ /usr/sbin/dahdi_waitfor_span_assignments2019-08-24 09:44:14.025592490 
+0200
@@ -28,7 +28,7 @@
 
 spans_of() {
dev="$1"
-   wc -l < "$dev/spantype"
+   wc -l < "$dev/dahdi_spantype"
 }
 
 assigned_spans_of() {

-- 
Happy hacking
Petter Reinholdtsen