live-build/helpers/lh_source_iso

115 lines
2.4 KiB
Plaintext
Raw Normal View History

2007-09-23 08:04:46 +00:00
#!/bin/sh
2007-09-23 08:05:10 +00:00
# lh_source_iso(1) - build iso source 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
2007-09-23 08:05:10 +00:00
DESCRIPTION="build iso source image"
2007-09-23 08:04:48 +00:00
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
2007-09-23 08:04:52 +00:00
Read_conffile config/common
2007-09-23 08:04:49 +00:00
Read_conffile config/bootstrap
Read_conffile config/chroot
2007-09-23 08:04:52 +00:00
Read_conffile config/binary
Read_conffile config/source
2007-09-23 08:04:46 +00:00
Set_defaults
2007-09-23 08:04:50 +00:00
if [ "${LIVE_SOURCE}" != "enabled" ]
2007-09-23 08:04:46 +00:00
then
exit 0
fi
2007-09-23 08:05:09 +00:00
for IMAGE in ${LIVE_SOURCE_IMAGES}
2007-09-23 08:04:46 +00:00
do
if [ "${IMAGE}" = "iso" ]
then
2007-09-23 08:05:09 +00:00
Breakpoint "source_iso: Init"
2007-09-23 08:04:46 +00:00
# Requiring stage file
2007-09-23 08:05:09 +00:00
Require_stagefile .stage/source_debian
2007-09-23 08:04:46 +00:00
2007-09-23 08:04:50 +00:00
# Checking stage file
Check_stagefile .stage/source_iso
2007-09-23 08:04:46 +00:00
# Checking lock file
2007-09-23 08:04:47 +00:00
Check_lockfile .lock
2007-09-23 08:04:46 +00:00
# Creating lock file
2007-09-23 08:04:47 +00:00
Create_lockfile .lock
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:09 +00:00
# Checking depends
Check_package chroot/usr/bin/"${LH_GENISOIMAGE}" ${LH_GENISOIMAGE}
# Installing depends
Install_package
2007-09-23 08:05:10 +00:00
# Remove old iso image
2007-09-23 08:04:47 +00:00
if [ -f source.iso ]
2007-09-23 08:04:46 +00:00
then
2007-09-23 08:04:47 +00:00
rm -f source.iso
2007-09-23 08:04:46 +00:00
fi
2007-09-23 08:05:09 +00:00
if [ "${LH_VERBOSE}" = "enabled" ]
then
GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -v"
fi
2007-09-23 08:05:10 +00:00
if [ -n "${LIVE_ISO_APPLICATION}" ] && [ "${LIVE_ISO_APPLICATION}" != "none" ]
then
GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -A \"${LIVE_ISO_APPLICATION}\""
fi
if [ -n "${LIVE_ISO_PREPARER}" ] && [ "${LIVE_ISO_PREPARER}" != "none" ]
then
GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -p \"${LIVE_ISO_PREPARER}\""
fi
if [ -n "${LIVE_ISO_PUBLISHER}" ] && [ "${LIVE_ISO_PUBLISHER}" != "none" ]
then
GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -publisher \"${LIVE_ISO_PUBLISHER}\""
fi
if [ -n "${LIVE_ISO_VOLUME}" ] && [ "${LIVE_ISO_VOLUME}" != "none" ]
then
GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -V \"${LIVE_ISO_VOLUME}\""
fi
2007-09-23 08:05:09 +00:00
# Moving image
mv source chroot
cat >> chroot/source.sh << EOF
2007-09-23 08:05:10 +00:00
${LH_GENISOIMAGE} ${GENISOIMAGE_OPTIONS} -o source.iso -r -J -l -cache-inodes source
2007-09-23 08:05:09 +00:00
EOF
Chroot "sh source.sh"
# Move image
mv chroot/source chroot/source.iso ./
rm -f chroot/source.sh
# Removing depends
Remove_package
2007-09-23 08:04:46 +00:00
# Creating stage file
2007-09-23 08:04:47 +00:00
Create_stagefile .stage/source_iso
2007-09-23 08:04:46 +00:00
fi
done