2007-09-23 08:04:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-09-02 11:12:37 +00:00
|
|
|
## live-build(7) - System Build Scripts
|
|
|
|
## Copyright (C) 2006-2010 Daniel Baumann <daniel@debian.org>
|
|
|
|
##
|
|
|
|
## 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.
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Including common functions
|
2010-08-14 18:29:05 +00:00
|
|
|
. "${LH_BASE:-/usr/share/live/build}"/scripts/build.sh
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Setting static variables
|
2009-01-15 01:37:42 -01:00
|
|
|
DESCRIPTION="$(Echo 'build iso source image')"
|
2007-09-23 08:04:48 +00:00
|
|
|
HELP=""
|
|
|
|
USAGE="${PROGRAM} [--force]"
|
|
|
|
|
|
|
|
Arguments "${@}"
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Reading configuration files
|
2008-10-28 14:26:17 -01:00
|
|
|
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
|
2007-09-23 08:04:46 +00:00
|
|
|
Set_defaults
|
|
|
|
|
2009-12-13 19:17:45 -01:00
|
|
|
if [ "${LH_SOURCE}" != "true" ]
|
2007-09-23 08:04:46 +00:00
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2010-02-18 15:34:29 -01:00
|
|
|
case "${LH_SOURCE_IMAGES}" in
|
|
|
|
iso*)
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|
2007-09-23 08:05:09 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
Echo_message "Begin building source iso image..."
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Requiring stage file
|
2008-10-14 19:32:50 +00:00
|
|
|
Require_stagefile .stage/config .stage/source_debian
|
2007-09-23 08:04:50 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Checking stage file
|
|
|
|
Check_stagefile .stage/source_iso
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Checking lock file
|
|
|
|
Check_lockfile .lock
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Creating lock file
|
|
|
|
Create_lockfile .lock
|
2007-09-23 08:05:09 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Checking depends
|
2007-10-19 10:54:26 +00:00
|
|
|
Check_package chroot/usr/bin/genisoimage genisoimage
|
2007-09-23 08:05:09 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Installing depends
|
|
|
|
Install_package
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Remove old iso image
|
|
|
|
if [ -f source.iso ]
|
|
|
|
then
|
|
|
|
rm -f source.iso
|
|
|
|
fi
|
2007-09-23 08:05:09 +00:00
|
|
|
|
2009-12-13 19:17:45 -01:00
|
|
|
if [ "${_QUIET}" = "true" ]
|
2007-09-23 12:05:14 +00:00
|
|
|
then
|
|
|
|
GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -quiet"
|
|
|
|
fi
|
|
|
|
|
2009-12-13 19:17:45 -01:00
|
|
|
if [ "${_VERBOSE}" = "true" ]
|
2007-09-23 08:05:11 +00:00
|
|
|
then
|
|
|
|
GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -v"
|
|
|
|
fi
|
2007-09-23 08:05:10 +00:00
|
|
|
|
2007-09-23 08:05:17 +00:00
|
|
|
if [ -n "${LH_ISO_APPLICATION}" ] && [ "${LH_ISO_APPLICATION}" != "none" ]
|
2007-09-23 08:05:11 +00:00
|
|
|
then
|
2007-09-23 08:05:17 +00:00
|
|
|
GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -A \"${LH_ISO_APPLICATION}\""
|
2007-09-23 08:05:11 +00:00
|
|
|
fi
|
2007-09-23 08:05:10 +00:00
|
|
|
|
2007-09-23 08:05:17 +00:00
|
|
|
if [ -n "${LH_ISO_PREPARER}" ] && [ "${LH_ISO_PREPARER}" != "none" ]
|
2007-09-23 08:05:11 +00:00
|
|
|
then
|
2007-09-23 08:05:17 +00:00
|
|
|
GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -p \"${LH_ISO_PREPARER}\""
|
2007-09-23 08:05:11 +00:00
|
|
|
fi
|
2007-09-23 08:05:10 +00:00
|
|
|
|
2007-09-23 08:05:17 +00:00
|
|
|
if [ -n "${LH_ISO_PUBLISHER}" ] && [ "${LH_ISO_PUBLISHER}" != "none" ]
|
2007-09-23 08:05:11 +00:00
|
|
|
then
|
2007-09-23 08:05:17 +00:00
|
|
|
GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -publisher \"${LH_ISO_PUBLISHER}\""
|
2007-09-23 08:05:11 +00:00
|
|
|
fi
|
2007-09-23 08:05:10 +00:00
|
|
|
|
2007-09-23 08:05:17 +00:00
|
|
|
if [ -n "${LH_ISO_VOLUME}" ] && [ "${LH_ISO_VOLUME}" != "none" ]
|
2007-09-23 08:05:11 +00:00
|
|
|
then
|
2007-09-23 08:05:17 +00:00
|
|
|
GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -V \"${LH_ISO_VOLUME}\""
|
2007-09-23 08:05:11 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Moving image
|
|
|
|
mv source chroot
|
2007-09-23 08:05:09 +00:00
|
|
|
|
|
|
|
cat >> chroot/source.sh << EOF
|
2007-10-19 10:54:26 +00:00
|
|
|
genisoimage ${GENISOIMAGE_OPTIONS} -o source.iso -r -J -l -cache-inodes source
|
2007-09-23 08:05:09 +00:00
|
|
|
EOF
|
|
|
|
|
2008-10-28 14:44:06 -01:00
|
|
|
Chroot chroot "sh source.sh"
|
2007-09-23 08:05:09 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Move image
|
|
|
|
mv chroot/source chroot/source.iso ./
|
|
|
|
rm -f chroot/source.sh
|
2007-09-23 08:05:09 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Removing depends
|
|
|
|
Remove_package
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Creating stage file
|
|
|
|
Create_stagefile .stage/source_iso
|