[dahdi-commits] tzafrir: linux/trunk r9162 - /linux/trunk/build_tools/live_dahdi

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Wed Aug 18 09:27:23 CDT 2010


Author: tzafrir
Date: Wed Aug 18 09:27:20 2010
New Revision: 9162

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9162
Log:
live_dahdi: allow testing dynamic local spans

Adds support for configuring dynamic spans through live_dahdi. To enable, set
in live/live.conf:

  DYNAMIC_LOC="yes"

It will generate an extra live/etc/dahdi/dynamic.conf (if one does not exist)
and use it to configure extra dynamic spans in the system.

Note that ATM this will make the system hang pretty easily at 'load' time.

Modified:
    linux/trunk/build_tools/live_dahdi

Modified: linux/trunk/build_tools/live_dahdi
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/build_tools/live_dahdi?view=diff&rev=9162&r1=9161&r2=9162
==============================================================================
--- linux/trunk/build_tools/live_dahdi (original)
+++ linux/trunk/build_tools/live_dahdi Wed Aug 18 09:27:20 2010
@@ -2,6 +2,7 @@
 
 LINUX_DIR=${LINUX_DIR:=.}
 TOOLS_DIR=${TOOLS_DIR:=../dahdi-tools}
+DYNAMIC_LOC="${DYNAMIC_LOC:-no}"
 DESTDIR=$PWD/live
 KVERS=${KVERS:-`uname -r`}
 XPP_SYNC=${XPP_SYNC:-auto}
@@ -56,7 +57,11 @@
 
 # make sure Astribank initialization scripts are from our tree.
 xpp_ARGS="$xpp_ARGS initdir=$FIRMWARE_DIR"
-dahdi_ARGS="$dahdi_ARGS initdir=$FIRMWARE_DIR"
+#dahdi_ARGS="$dahdi_ARGS initdir=$FIRMWARE_DIR"
+
+if [ "$DYNAMIC_LOC" = 'yes' ]; then
+	MODULES_LOAD="$MODULES_LOAD dahdi_dynamic dahdi_dynamic_loc"
+fi
 
 # the same as xpp/utils/dahdi_drivers .
 # With the remote mode, I can't rely on files in the source directory.
@@ -157,12 +162,29 @@
 	rmmod $module
 }
 
+load_dynamic() {
+	if [ "$DYNAMIC_LOC" != yes ]; then return; fi
+
+	local conf_file="$DESTDIR/etc/dahdi/dynamic.conf"
+	if [ ! -r "$conf_file" ]; then
+		cat <<EOF >"$conf_file"
+dynamic=loc,1:0,5,0
+dynamic=loc,1:1,5,0
+EOF
+	fi
+	
+	dahdi_cfg -c "$conf_file"
+}
+
 genconf() {
 	GENCONF_PARAMETERS=$DESTDIR/etc/dahdi/genconf_parameters \
 	DAHDI_CONF_FILE=$DESTDIR/etc/dahdi/system.conf \
 	DAHDI_MODS_FILE=$DESTDIR/etc/dahdi/modules \
 	CHAN_DAHDI_CHANNELS_FILE=$DESTDIR/etc/asterisk/dahdi-channels.conf \
 		dahdi_genconf
+	if [ "$DYNAMIC_LOC" = yes ]; then
+		cat "$DESTDIR/etc/dahdi/dynamic.conf" >>"$DESTDIR/etc/dahdi/system.conf"
+	fi
 	dahdi_cfg -c $DESTDIR/etc/dahdi/system.conf
 	# TODO: fxotune, hpec
 }
@@ -207,6 +229,12 @@
 	shift
 	cd "$TOOLS_DIR"; make config DESTDIR=$DESTDIR "$@"
 	mkdir -p $DESTDIR/etc/asterisk
+	cat >"$FIRMWARE_DIR/live-init.conf" <<EOF
+PATH="$PATH" # FIXME: add to existing \$PATH?
+export PATH
+dahdiconfdir="${DESTDIR}/etc/dahdi"
+export dahdiconfdir
+EOF
 	;;
 rsync)
 	if [ $# -ne 2 ]; then
@@ -236,6 +264,7 @@
 		insmod $MODULES_DIR/$module.ko $module_args
 	done
 	xpp_startup
+	load_dynamic
 	genconf
 	# or find a way to reuse init.d start sequence.
 




More information about the dahdi-commits mailing list