home *** CD-ROM | disk | FTP | other *** search
- #!/bin/bash
- # Use module while running LiveCD
- # include it into live directory structure on the fly
- # Author: Tomas M. <http://www.linux-live.org>
- #
-
- if [ "$1" = "" ]; then
- echo
- echo "Use module on the fly while running Live CD"
- echo "Usage: $0 module.mo"
- exit
- fi
-
- if [ -a ./liblinuxlive ]; then
- . ./liblinuxlive
- else
- . /usr/lib/liblinuxlive || exit 1
- fi
-
- allow_only_root
- IMAGES=/mnt/live/memory/images
-
- # unionfs must be compiled with -DSETUP_BROKEN_LOSETUP=1 else this won't work!
- MOD="`union_insert_module / \"$1\" $IMAGES`"
- if [ $? -ne 0 ]; then echo "error inserting module to live filesystem" >&2; exit 1; fi
-
- # all executables in /etc/rc.d/ from this module will be started
- # with two arguments: start mo. This happens only by this script (uselivemod),
- # not in the case when module is loaded during OS startup.
- find $IMAGES/$MOD/etc/rc.d -type f 2>/dev/null | while read SCRIPT; do
- if [ "$SCRIPT" != "" -a -x "$SCRIPT" -a ! -d "$SCRIPT" ]; then
- ${SETUP##$IMAGES/$MOD} start mo
- fi
- done
-
- # update ld cache
- /sbin/ldconfig
-