From f43c9a0145cba8ceffafce35f354ea48f52724dd Mon Sep 17 00:00:00 2001 From: tzafrir Date: Thu, 3 Jan 2008 23:37:53 +0000 Subject: * Use inline perl to get list of module instead of script from xpp/utils, as xpp/utils is not copied to remote rsync copy. * Make sure we set environment early enough to run perl code. git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3607 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- live_zap | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'live_zap') diff --git a/live_zap b/live_zap index 524564b..7aa5c22 100755 --- a/live_zap +++ b/live_zap @@ -8,7 +8,6 @@ MODULES_DIR="$DESTDIR/lib/modules/$KVERS/misc" XPP_SYNC=auto AST_SCRIPT=/etc/init.d/asterisk # Use this file to pass options to modules: -MODPROBE_FILE=$DESTDIR/modprobe.conf PERLLIBDIR=`perl -V:sitelib | cut -d "'" -f 2` # Manual list of modules. They will be loaded by insmod. @@ -23,8 +22,25 @@ REMOVE_MODULES="zaptel" if [ -r $DESTDIR/live.conf ]; then . $DESTDIR/live.conf; fi +# Give priority to our installed binaries: +PATH=$DESTDIR/sbin:$DESTDIR/usr/sbin:$PATH +export PATH + +# TODO: If you already use PERL5DIR, please fix this part: +PERL5LIB="$DESTDIR/$PERLLIBDIR" +export PERL5LIB + +# the same as xpp/utils/zaptel_drivers . +# 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); + ' +} + # Detect the modules used in the system: -for mod in `xpp/utils/zaptel_drivers`; do +for mod in `zaptel_drivers`; do case "$mod" in xpp_usb) MODULES_LOAD="$MODULES_LOAD xpp/xpp xpp/xpd_fxs" @@ -99,14 +115,6 @@ usage() { echo "$me load /etc/init.d/zaptel start" } -# Give priority to our installed binaries: -PATH=$DESTDIR/sbin:$DESTDIR/usr/sbin:$PATH -export PATH - -# TODO: If you already use PERL5DIR, please fix this part: -PERL5LIB="$DESTDIR/$PERLLIBDIR" -export PERL5LIB - case "$1" in install) shift @@ -115,7 +123,6 @@ install) config) shift make config DESTDIR=$DESTDIR "$@" - touch $MODPROBE_FILE mkdir -p $DESTDIR/etc/asterisk ;; rsync) -- cgit v1.2.3