2010-09-02 11:12:37 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
## live-build(7) - System Build Scripts
|
2012-02-04 19:41:41 -01:00
|
|
|
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
|
2010-09-02 11:12:37 +00:00
|
|
|
##
|
|
|
|
## live-build comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
|
|
|
|
## This is free software, and you are welcome to redistribute it
|
|
|
|
## under certain conditions; see COPYING for details.
|
|
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Including common functions
|
2012-07-19 17:37:26 +00:00
|
|
|
( . "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || true ) || . /usr/lib/live/build.sh
|
2010-09-02 11:12:37 +00:00
|
|
|
|
|
|
|
# Setting static variables
|
|
|
|
DESCRIPTION="$(Echo 'utility to build Debian Live systems')"
|
|
|
|
HELP="FIXME"
|
|
|
|
USAGE="FIXME"
|
|
|
|
|
|
|
|
case "${1}" in
|
|
|
|
-h|--help)
|
|
|
|
if [ -x "$(which man 2>/dev/null)" ]
|
|
|
|
then
|
2011-01-01 15:55:57 -01:00
|
|
|
man lb
|
2010-09-02 11:12:37 +00:00
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
${0} --usage
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
""|-u|--usage)
|
|
|
|
Usage
|
|
|
|
;;
|
|
|
|
|
|
|
|
-v|--version)
|
2012-07-18 19:38:58 +00:00
|
|
|
echo "${VERSION}"
|
|
|
|
exit 0
|
2010-09-02 11:12:37 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2010-09-12 19:01:06 +00:00
|
|
|
COMMAND="lb_${1}"
|
2010-09-02 11:12:37 +00:00
|
|
|
shift
|
|
|
|
|
2012-06-06 19:32:08 +00:00
|
|
|
ENV=""
|
|
|
|
|
|
|
|
for _FILE in config/environment config/environment.binary
|
|
|
|
do
|
|
|
|
if [ -e "${_FILE}" ]
|
|
|
|
then
|
|
|
|
ENV="${ENV} $(grep -v '^#' ${_FILE})"
|
|
|
|
fi
|
|
|
|
done
|
2012-05-31 11:15:18 +00:00
|
|
|
|
2012-07-19 17:37:26 +00:00
|
|
|
if [ -x "${LIVE_BUILD}/scripts/build/${COMMAND}" ]
|
2010-09-02 11:12:37 +00:00
|
|
|
then
|
2012-07-19 17:37:26 +00:00
|
|
|
SCRIPT="${LIVE_BUILD}/scripts/build/${COMMAND}"
|
2012-07-19 00:59:55 +00:00
|
|
|
elif [ -x /usr/lib/live/build/${COMMAND} ]
|
2010-09-02 11:12:37 +00:00
|
|
|
then
|
2012-07-19 00:59:55 +00:00
|
|
|
SCRIPT=/usr/lib/live/build/"${COMMAND}"
|
2010-09-02 11:12:37 +00:00
|
|
|
elif [ -x "$(which ${COMMAND} 2>/dev/null)" ]
|
|
|
|
then
|
2012-01-12 20:22:57 -01:00
|
|
|
SCRIPT="${COMMAND}"
|
2010-09-02 11:12:37 +00:00
|
|
|
else
|
2012-07-03 14:05:31 +00:00
|
|
|
Echo_error "no such script: ${COMMAND}"
|
2010-09-02 11:12:37 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2012-01-12 20:22:57 -01:00
|
|
|
|
|
|
|
Echo "[%s] %s" "$(date +'%F %T')" "${COMMAND} ${*}"
|
2012-05-31 11:15:18 +00:00
|
|
|
LB=1 ${ENV} exec "${SCRIPT}" "${@}"
|
2010-09-02 11:12:37 +00:00
|
|
|
;;
|
|
|
|
esac
|