diff options
-rw-r--r-- | Makefile | 6 | ||||
-rwxr-xr-x | dahdi.init | 39 | ||||
-rw-r--r-- | init.conf.sample (renamed from init.conf) | 0 | ||||
-rw-r--r-- | modules.sample | 37 |
4 files changed, 64 insertions, 18 deletions
@@ -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) @@ -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.sample index 3f24fa8..3f24fa8 100644 --- a/init.conf +++ b/init.conf.sample 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 |