live-build/helpers/lh_binary_net

82 lines
1.6 KiB
Plaintext
Raw Normal View History

2007-09-23 08:04:46 +00:00
#!/bin/sh
# lh_binary_net(1) - build netboot binary image
2007-09-23 08:04:48 +00:00
# Copyright (C) 2006-2007 Daniel Baumann <daniel@debian.org>
#
# live-helper 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.
2007-09-23 08:04:46 +00:00
set -e
# Source common functions
for FUNCTION in /usr/share/live-helper/functions/*.sh
do
. ${FUNCTION}
done
2007-09-23 08:04:48 +00:00
# Set static variables
DESCRIPTION="build netboot binary image"
HELP=""
USAGE="${PROGRAM} [--force]"
Arguments "${@}"
2007-09-23 08:04:49 +00:00
Echo_debug "Init ${PROGRAM}"
2007-09-23 08:04:46 +00:00
# Reading configuration files
Read_conffile config/bootstrap
2007-09-23 08:04:49 +00:00
Read_conffile config/chroot
Read_conffile config/common
2007-09-23 08:04:46 +00:00
Read_conffile config/image
Set_defaults
2007-09-23 08:04:49 +00:00
Breakpoint "binary_net: Init"
2007-09-23 08:04:46 +00:00
for IMAGE in ${LIVE_BINARY_IMAGE}
do
if [ "${IMAGE}" = "net" ]
then
2007-09-23 08:04:48 +00:00
# Requiring stage file
Require_stagefile .stage/bootstrap
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
# Checking stage file
Check_stagefile .stage/binary_net
2007-09-23 08:04:46 +00:00
# Remove old binary
2007-09-23 08:04:47 +00:00
if [ -f binary-net.tar.gz ]
2007-09-23 08:04:46 +00:00
then
2007-09-23 08:04:47 +00:00
rm -f binary-net.tar.gz
2007-09-23 08:04:46 +00:00
fi
# Creating image file
2007-09-23 08:04:49 +00:00
if [ "`basename ${LIVE_SERVER_PATH}`" = "chroot" ]
then
mv chroot chroot.tmp
fi
2007-09-23 08:04:47 +00:00
mv binary "`basename ${LIVE_SERVER_PATH}`"
cd ..
2007-09-23 08:04:49 +00:00
tar cfz binary-net.tar.gz "`basename ${OLDPWD}`/`basename ${LIVE_SERVER_PATH}`" "`basename ${OLDPWD}`/tftpboot"
2007-09-23 08:04:48 +00:00
mv binary-net.tar.gz "${OLDPWD}"
2007-09-23 08:04:47 +00:00
cd "${OLDPWD}"
2007-09-23 08:04:46 +00:00
mv "`basename ${LIVE_SERVER_PATH}`" binary
2007-09-23 08:04:49 +00:00
if [ "`basename ${LIVE_SERVER_PATH}`" = "chroot" ]
then
mv chroot.tmp chroot
fi
2007-09-23 08:04:46 +00:00
# Creating stage file
2007-09-23 08:04:47 +00:00
Create_stagefile .stage/binary_net
2007-09-23 08:04:46 +00:00
fi
done