diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2009-06-23 19:31:52 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2009-06-23 19:31:52 +0000 |
commit | b3ccefd237138e94466b4eb402b974c201b55c77 (patch) | |
tree | ea71925c0dbe37317655479eb54f4cf639a58122 | |
parent | c31fd1e104bc963efb481d0c3832d9947821fae8 (diff) |
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
-rwxr-xr-x | live_zap | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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 |