span_types: Fix bug that would prevent matching on devpath.
If a configuration file was specified that used the devpath, like: # Device: [] @Board_ID_Switch_0 /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/pci:0000:02:08.0 /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/pci:0000:02:08.0 1:E1 /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/pci:0000:02:08.0 2:E1 /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/pci:0000:02:08.0 3:E1 /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/pci:0000:02:08.0 4:E1 Then the span_types script would silently fail to match the configuration lines for the device and silently fail to change the linemodes. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Oron Peled <oron.peled@xorcom.com>
This commit is contained in:
parent
a97d373d95
commit
e298eb1237
|
@ -188,6 +188,7 @@ filter_conf() {
|
||||||
conf_spans() {
|
conf_spans() {
|
||||||
hardware_id="$1"
|
hardware_id="$1"
|
||||||
location="$2"
|
location="$2"
|
||||||
|
devpath="$3"
|
||||||
filter_conf | (
|
filter_conf | (
|
||||||
# Collect device spans
|
# Collect device spans
|
||||||
# in a subshell, so $SPANS is not lost
|
# in a subshell, so $SPANS is not lost
|
||||||
|
@ -206,6 +207,12 @@ conf_spans() {
|
||||||
SPANS="$SPANS $spans"
|
SPANS="$SPANS $spans"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
case "$devpath" in
|
||||||
|
$id)
|
||||||
|
#echo >&2 "match([$id]): $spans"
|
||||||
|
SPANS="$SPANS $spans"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
echo "$SPANS"
|
echo "$SPANS"
|
||||||
)
|
)
|
||||||
|
@ -217,7 +224,7 @@ device_set_spantype() {
|
||||||
devpath=`cd "$device" && pwd -P`
|
devpath=`cd "$device" && pwd -P`
|
||||||
location='@'`attr_clean "$device/location"`
|
location='@'`attr_clean "$device/location"`
|
||||||
hardware_id=`attr_clean "$device/hardware_id"`
|
hardware_id=`attr_clean "$device/hardware_id"`
|
||||||
spanspecs=`conf_spans "$hardware_id" "$location"`
|
spanspecs=`conf_spans "$hardware_id" "$location" "$devpath"`
|
||||||
#echo >&2 "MATCHED($device): $spanspecs"
|
#echo >&2 "MATCHED($device): $spanspecs"
|
||||||
cut -d: -f1 "$attr_file" | while read spanno; do
|
cut -d: -f1 "$attr_file" | while read spanno; do
|
||||||
for sp in $spanspecs
|
for sp in $spanspecs
|
||||||
|
|
Loading…
Reference in New Issue