summaryrefslogtreecommitdiff
path: root/live_zap
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-03 23:37:53 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-03 23:37:53 +0000
commitf43c9a0145cba8ceffafce35f354ea48f52724dd (patch)
tree18695b48e3c09247e2f84c8f2fbfa1cd6c7821f4 /live_zap
parent26633d9c1ba36cf69df9b2c180df852758d2c439 (diff)
* 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
Diffstat (limited to 'live_zap')
-rwxr-xr-xlive_zap29
1 files changed, 18 insertions, 11 deletions
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)