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 <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
This commit is contained in:
Oron Peled 2013-10-15 20:09:30 +03:00 committed by Tzafrir Cohen
parent a4217f6977
commit 10a6622774
3 changed files with 24 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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.