From 10a6622774249c2548a3279c584c792d1d009d4b Mon Sep 17 00:00:00 2001 From: Oron Peled Date: Tue, 15 Oct 2013 20:09:30 +0300 Subject: [PATCH] udev scripts now read /etc/dahdi/init.conf Added two override variables in init.conf: * DAHDI_UDEV_DISABLE_DEVICES * DAHDI_UDEV_DISABLE_SPANS Signed-off-by: Tzafrir Cohen Acked-by: Russ Meyerriecks --- handle_device | 10 ++++++++++ init.conf.sample | 4 ++++ span_config | 10 ++++++++++ 3 files changed, 24 insertions(+) diff --git a/handle_device b/handle_device index 4a95b7b..825f1ab 100755 --- a/handle_device +++ b/handle_device @@ -25,6 +25,16 @@ set -e #echo >&2 "$0($ACTION): DEBUG($# args): '$*'" +# Do we have a configuration? +if [ -f /etc/dahdi/init.conf ]; then + . /etc/dahdi/init.conf +fi + +if [ "$DAHDI_UDEV_DISABLE_DEVICES" = 'yes' ]; then + echo "DAHDI_UDEV_DISABLE_DEVICES=yes. Skip $DEVPATH" | $LOGGER + exit 0 +fi + # Check if we can safely do our job if [ ! -f /sys/module/dahdi/parameters/auto_assign_spans ]; then echo "Old driver (no auto_assign_spans parameter). Skip $DEVPATH" | $LOGGER diff --git a/init.conf.sample b/init.conf.sample index 58edec5..e431f1a 100644 --- a/init.conf.sample +++ b/init.conf.sample @@ -17,3 +17,7 @@ #XPP_FIRMWARE_DIR=/usr/share/dahdi #XPP_HOTPLUG_DISABLED=yes #XPP_HOTPLUG_DAHDI=yes + +# Disable udev handling: +#DAHDI_UDEV_DISABLE_DEVICES=yes +#DAHDI_UDEV_DISABLE_SPANS=yes diff --git a/span_config b/span_config index 64a6ede..c2e87cd 100755 --- a/span_config +++ b/span_config @@ -25,6 +25,16 @@ set -e #echo >&2 "$0($ACTION): DEBUG($# args): '$*'" +# Do we have a configuration? +if [ -f /etc/dahdi/init.conf ]; then + . /etc/dahdi/init.conf +fi + +if [ "$DAHDI_UDEV_DISABLE_SPANS" = 'yes' ]; then + echo "DAHDI_UDEV_DISABLE_SPANS=yes. Skip $DEVPATH" | $LOGGER + exit 0 +fi + # Can we pass a different value so we can use # alternate (testing) configuration? # Meanwhile, make it hard-coded.