diff options
author | Daniel Baumann <daniel@debian.org> | 2007-09-23 10:05:11 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 18:18:30 +0100 |
commit | 85c342c299231131d22764c0dfdcf977c57ce147 (patch) | |
tree | 1226c8a7ad43a2dd53e411c2e379969424e88e32 /helpers/lh_binary_net | |
parent | d1ee66e44c8272bb7a0053a456a3d8b0bd152268 (diff) | |
download | vyos-live-build-85c342c299231131d22764c0dfdcf977c57ce147.tar.gz vyos-live-build-85c342c299231131d22764c0dfdcf977c57ce147.zip |
Adding live-helper 1.0~a13-1.
Diffstat (limited to 'helpers/lh_binary_net')
-rwxr-xr-x | helpers/lh_binary_net | 85 |
1 files changed, 42 insertions, 43 deletions
diff --git a/helpers/lh_binary_net b/helpers/lh_binary_net index 6ebe7ea74..03476630f 100755 --- a/helpers/lh_binary_net +++ b/helpers/lh_binary_net @@ -9,21 +9,21 @@ set -e -# Source common functions -for FUNCTION in /usr/share/live-helper/functions/*.sh +# Including common functions +LH_BASE="${LH_BASE:-/usr/share/live-helper}" + +for FUNCTION in "${LH_BASE}"/functions/*.sh do - . ${FUNCTION} + . "${FUNCTION}" done -# Set static variables +# Setting static variables DESCRIPTION="build netboot binary image" HELP="" USAGE="${PROGRAM} [--force]" Arguments "${@}" -Echo_debug "Init ${PROGRAM}" - # Reading configuration files Read_conffile config/common Read_conffile config/bootstrap @@ -32,51 +32,50 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -Breakpoint "binary_net: Init" +if ! echo "${LIVE_BINARY_IMAGES}" | grep -qs net +then + exit 0 +fi -for IMAGE in ${LIVE_BINARY_IMAGES} -do - if [ "${IMAGE}" = "net" ] - then - # Requiring stage file - Require_stagefile .stage/bootstrap +Echo_message "Begin building binary netboot image..." - # Checking stage file - Check_stagefile .stage/binary_net +# Requiring stage file +Require_stagefile .stage/bootstrap - # Checking lock file - Check_lockfile .lock +# Checking stage file +Check_stagefile .stage/binary_net - # Creating lock file - Create_lockfile .lock +# Checking lock file +Check_lockfile .lock - # Remove old binary - if [ -f binary-net.tar.gz ] - then - rm -f binary-net.tar.gz - fi +# Creating lock file +Create_lockfile .lock - # Creating image file - if [ "`basename ${LIVE_NET_PATH}`" = "chroot" ] - then - mv chroot chroot.tmp - fi +# Remove old binary +if [ -f binary-net.tar.gz ] +then + rm -f binary-net.tar.gz +fi - mv binary "`basename ${LIVE_NET_PATH}`" +# Creating image file +if [ "`basename ${LIVE_NET_PATH}`" = "chroot" ] +then + mv chroot chroot.tmp +fi - cd .. - tar cfz binary-net.tar.gz "`basename ${OLDPWD}`/`basename ${LIVE_NET_PATH}`" "`basename ${OLDPWD}`/tftpboot" - mv binary-net.tar.gz "${OLDPWD}" - cd "${OLDPWD}" +mv binary "`basename ${LIVE_NET_PATH}`" - mv "`basename ${LIVE_NET_PATH}`" binary +cd .. +tar cfz binary-net.tar.gz "`basename ${OLDPWD}`/`basename ${LIVE_NET_PATH}`" "`basename ${OLDPWD}`/tftpboot" +mv binary-net.tar.gz "${OLDPWD}" +cd "${OLDPWD}" - if [ "`basename ${LIVE_NET_PATH}`" = "chroot" ] - then - mv chroot.tmp chroot - fi +mv "`basename ${LIVE_NET_PATH}`" binary - # Creating stage file - Create_stagefile .stage/binary_net - fi -done +if [ "`basename ${LIVE_NET_PATH}`" = "chroot" ] +then + mv chroot.tmp chroot +fi + +# Creating stage file +Create_stagefile .stage/binary_net |