From b3ccefd237138e94466b4eb402b974c201b55c77 Mon Sep 17 00:00:00 2001 From: tzafrir Date: Tue, 23 Jun 2009 19:31:52 +0000 Subject: live_zap: adjust to recent changes in Zaptel * Adjust to changes in Zaptel. * Detect OSLEC if it happens to be in our tree. * Don't bomb-out on some legitimate errors. git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4660 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- live_zap | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/live_zap b/live_zap index 3c4d169..e47420f 100755 --- a/live_zap +++ b/live_zap @@ -20,6 +20,11 @@ MODULES_LOAD="zaptel" # as Zaptel depends on them. REMOVE_MODULES="zaptel" +if [ -r drivers/oslec/oslec.h ]; then + MODULES_LOAD="oslec/oslec zaptel" + REMOVE_MODULES="zaptel oslec" +fi + if [ -r $DESTDIR/live.conf ]; then . $DESTDIR/live.conf; fi # Give priority to our installed binaries: @@ -41,8 +46,8 @@ xpp_ARGS="$xpp_ARGS initdir=$FIRMWARE_DIR" # With the remote mode, I can't rely on files in the source directory. zaptel_drivers() { perl -MZaptel::Hardware -e ' - my $hardware = Zaptel::Hardware->scan; - print join(" ", $hardware->drivers); + Zaptel::Hardware->scan; + print join(" ", Zaptel::Hardware::drivers("dummy") ); ' } @@ -74,10 +79,7 @@ done # installed the zaptel-perl utilities. xpp_startup() { # do nothing if there are no astribank devices: - if ! grep -q connected /proc/xpp/xbuses 2>/dev/null; then return 0; fi - - echo "Waiting for Astribank devices to initialize:" - cat /proc/xpp/XBUS-[0-9]*/waitfor_xpds 2>/dev/null || true + $DESTDIR/usr/share/zaptel/waitfor_xpds # overriding locales for the above two, as perl can be noisy # when locales are missing. @@ -94,7 +96,7 @@ xpp_startup() { # returns: the result from unload_module() { module="$1" - line=`lsmod 2>/dev/null | grep "^$1 "` + line=`lsmod 2>/dev/null | grep "^$1 "` || true if [ "$line" = '' ]; then return; fi # module was not loaded set -- $line @@ -147,7 +149,7 @@ rsync) rsync -ai "$0" $DESTDIR "$2:/tmp/" ;; unload) - $AST_SCRIPT stop + $AST_SCRIPT stop || : for mod in $REMOVE_MODULES; do unload_module $mod done -- cgit v1.2.3