From e88502949fd8cbe7edf37dd76c2b2c2286a88ff8 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Tue, 8 Jul 2008 21:10:02 +0000 Subject: - Renamed init.conf to init.conf.sample - Added /etc/dahdi/modules file that contains comments or the names of modules to load. - Removed the MODULES variable from /etc/dahdi/init.conf. git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@4578 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- Makefile | 6 +++++- dahdi.init | 39 ++++++++++++++++++++++----------------- init.conf | 39 --------------------------------------- init.conf.sample | 39 +++++++++++++++++++++++++++++++++++++++ modules.sample | 37 +++++++++++++++++++++++++++++++++++++ 5 files changed, 103 insertions(+), 57 deletions(-) delete mode 100644 init.conf create mode 100644 init.conf.sample create mode 100644 modules.sample diff --git a/Makefile b/Makefile index 8faf4ab..8f206d1 100644 --- a/Makefile +++ b/Makefile @@ -63,6 +63,7 @@ ifneq (,$(INITRD_DIR)) COPY_INITD := install -D dahdi.init $(INIT_TARGET) endif RCCONF_FILE = /etc/dahdi/init.conf +MODULES_FILE = /etc/dahdi/modules NETSCR_DIR := $(firstword $(wildcard /etc/sysconfig/network-scripts )) ifneq (,$(NETSCR_DIR)) @@ -256,7 +257,10 @@ ifneq (,$(COPY_INITD)) $(COPY_INITD) endif ifeq (,$(wildcard $(DESTDIR)$(RCCONF_FILE))) - $(INSTALL) -D -m 644 init.conf $(DESTDIR)$(RCCONF_FILE) + $(INSTALL) -D -m 644 init.conf.sample $(DESTDIR)$(RCCONF_FILE) +endif +ifeq (,$(wildcard $(DESTDIR)$(MODULES_FILE))) + $(INSTALL) -D -m 644 modules.sample $(DESTDIR)$(MODULES_FILE) endif ifneq (,$(COPY_NETSCR)) $(COPY_NETSCR) diff --git a/dahdi.init b/dahdi.init index 5d73bbc..c73d537 100755 --- a/dahdi.init +++ b/dahdi.init @@ -148,21 +148,27 @@ RETVAL=0 # See how we were called. case "$1" in start) - # Load drivers - if [ -z $MODULES ]; then - echo "There aren't any DAHDI hardware modules specified to " - echo "load. Please update /etc/dahdi/init.conf in order to " - echo "specify the modules to load." - exit 1 - fi - echo -n "Loading DAHDI hardware modules:" - for x in $MODULES; do - eval localARGS="\$${x}_ARGS" - if modprobe ${x} ${localARGS} 2> /dev/null; then - echo -n " $x" - echo "." + MODULES="" + cat "/etc/dahdi/modules" | grep "^[^\#]" | { + foundone=false + echo -ne $"Loading DAHDI hardware modules:\n" + while read line; do + foundone=true + echo -ne $" ${line}..." + if ! modprobe $line 2> /dev/null; then + echo -ne $"ERROR\n" + else + echo -ne $"DONE\n" + fi + done + echo -ne $"\n" + if ! $foundone; then + echo "There aren't any DAHDI hardware modules specified to " + echo "load. Please update /etc/dahdi/modules in order to " + echo "specify the modules to load." + exit 1 fi - done + } TMOUT=$DAHDI_DEV_TIMEOUT # max secs to wait while [ ! -d /dev/dahdi ] ; do sleep 1 @@ -204,11 +210,10 @@ case "$1" in stop) # Unload drivers #shutdown_dynamic # FIXME: needs test from someone with dynamic spans - echo -n "Unloading DAHDI hardware drivers:" + echo -ne $"Unloading DAHDI hardware drivers:" unload_module dahdi RETVAL=$? - echo "." - + echo -ne $" DONE\n" if [ "$LOCKFILE" != '' ]; then [ $RETVAL -eq 0 ] && rm -f $LOCKFILE fi diff --git a/init.conf b/init.conf deleted file mode 100644 index 3f24fa8..0000000 --- a/init.conf +++ /dev/null @@ -1,39 +0,0 @@ -# -# Shell settings for Dahdi initialization scripts. -# This replaces the old/per-platform files (/etc/sysconfig/zaptel, -# /etc/defaults/zaptel) -# - -# The maximal timeout (seconds) to wait for udevd to finish generating -# device nodes after the modules have loaded and before running dahdi_cfg. -#DAHDI_DEV_TIMEOUT=40 - -# Override settings for xpp_fxloader -#XPP_FIRMWARE_DIR=/usr/share/dahdi -#XPP_HOTPLUG_DISABLED=yes - -# By default, DAHDI will not load any modules. Please uncomment the -# as per your requirements; modules to load/unload -#Module Name Hardware -#MODULES="$MODULES wct4xxp" # TE405P - Quad Span T1/E1 Card (5v version) - # TE410P - Quad Span T1/E1 Card (3.3v version) -#wct4xxp_ARGS="t1e1override=15" # Additional parameters for TE4xxP driver -# or use /etc/modprobe.d/zaptel or /etc/modprobe.conf . - -#MODULES="$MODULES wcte12xp" # TE120P - Single Span T1/E1 Card - -#MODULES="$MODULES wct1xxp" # T100P - Single Span T1 Card - # E100P - Single Span E1 Card - -#MODULES="$MODULES wcte11xp" # TE110P - Single Span T1/E1 Card - -#MODULES="$MODULES wctdm24xxp" # TDM2400P - Modular FXS/FXO interface (1-24 ports) - -#MODULES="$MODULES wcfxo" # X100P - Single port FXO interface - # X101P - Single port FXO interface - -#MODULES="$MODULES wctdm" # TDM400P - Modular FXS/FXO interface (1-4 ports) - -#MODULES="$MODULES dahdi_dummy" # Zaptel Timing Only Interface - -#MODULES="$MODULES xpp_usb" # Xorcom Astribank Device diff --git a/init.conf.sample b/init.conf.sample new file mode 100644 index 0000000..3f24fa8 --- /dev/null +++ b/init.conf.sample @@ -0,0 +1,39 @@ +# +# Shell settings for Dahdi initialization scripts. +# This replaces the old/per-platform files (/etc/sysconfig/zaptel, +# /etc/defaults/zaptel) +# + +# The maximal timeout (seconds) to wait for udevd to finish generating +# device nodes after the modules have loaded and before running dahdi_cfg. +#DAHDI_DEV_TIMEOUT=40 + +# Override settings for xpp_fxloader +#XPP_FIRMWARE_DIR=/usr/share/dahdi +#XPP_HOTPLUG_DISABLED=yes + +# By default, DAHDI will not load any modules. Please uncomment the +# as per your requirements; modules to load/unload +#Module Name Hardware +#MODULES="$MODULES wct4xxp" # TE405P - Quad Span T1/E1 Card (5v version) + # TE410P - Quad Span T1/E1 Card (3.3v version) +#wct4xxp_ARGS="t1e1override=15" # Additional parameters for TE4xxP driver +# or use /etc/modprobe.d/zaptel or /etc/modprobe.conf . + +#MODULES="$MODULES wcte12xp" # TE120P - Single Span T1/E1 Card + +#MODULES="$MODULES wct1xxp" # T100P - Single Span T1 Card + # E100P - Single Span E1 Card + +#MODULES="$MODULES wcte11xp" # TE110P - Single Span T1/E1 Card + +#MODULES="$MODULES wctdm24xxp" # TDM2400P - Modular FXS/FXO interface (1-24 ports) + +#MODULES="$MODULES wcfxo" # X100P - Single port FXO interface + # X101P - Single port FXO interface + +#MODULES="$MODULES wctdm" # TDM400P - Modular FXS/FXO interface (1-4 ports) + +#MODULES="$MODULES dahdi_dummy" # Zaptel Timing Only Interface + +#MODULES="$MODULES xpp_usb" # Xorcom Astribank Device diff --git a/modules.sample b/modules.sample new file mode 100644 index 0000000..926b1b9 --- /dev/null +++ b/modules.sample @@ -0,0 +1,37 @@ +# Contains the list of modules to be loaded / unloaded by /etc/init.d/dahdi. +# +# NOTE: Please add/edit /etc/modprobe.d/dahdi or /etc/modprobe.conf if you +# would like to add any module parameters. +# + +# TE405P - Quad Span T1/E1 Card (5v version) +# TE410P - Quad Span T1/E1 Card (3.3v version) +wct4xxp + +# TE120P - Single Span T1/E1 Card +wcte12xp + +# T100P - Single Span T1 Card +# E100P - Single Span E1 Card +wct1xxp + +# TE110P - Single Span T1/E1 Card +wcte11xp + +# TDM2400P - Modular FXS/FXO interface (1-24 ports) +# TDM410P - Modular FXS/FXO interface (4 ports) +# TDM800P - Modular FXS/FXO interface (8 ports) +wctdm24xxp + +# X100P - Single port FXO interface +# X101P - Single port FXO interface +wcfxo + +# TDM400P - Modular FXS/FXO interface (1-4 ports) +wctdm + +# DAHDI timing only interface +dahdi_dummy + +# Xorcom Astribank Device +xpp_usb -- cgit v1.2.3