# disable for now since it seems to cause some problems
# set -e
+# The line following this line is patched by debian/rules.
+GRML_LIVE_VERSION='***UNRELEASED***'
+
# global variables
-GRML_LIVE_VERSION='0.17.0'
PN="$(basename $0)"
CMDLINE="$0 $@"
ADDONS_LIST_FILE='/boot/isolinux/addons_list.cfg'
Usage: $PN [options, see as follows]
-a <architecture> architecture; available values: i386 and amd64
- -A ensure clean build and pack artifacts
+ -A clean build directories before and after running
-b build the ISO without updating the chroot via FAI
-B build the ISO without touching the chroot (skips cleanup)
-c <classe[s]> classes to be used for building the ISO via FAI
umount_all
[ -n "$1" ] && EXIT="$1" || EXIT="1"
[ -n "$2" ] && eerror "$2">&2
- if [ -n "$PACK_ARTIFACTS" ]; then
+ if [ -n "$CLEAN_ARTIFACTS" ]; then
log "Cleaning up"
einfo "Cleaning up"
[ -n "${BUILD_OUTPUT}" -a -d "${BUILD_OUTPUT}" ] && rm -r "${BUILD_OUTPUT}"
[ -n "${ISO_OUTPUT}" -a -d "${ISO_OUTPUT}" ] && chown -R "${CHOWN_USER}:" "${ISO_OUTPUT}"
[ -n "${LOG_OUTPUT}" -a -d "${LOG_OUTPUT}" ] && chown -R "${CHOWN_USER}:" "${LOG_OUTPUT}"
[ -n "${NETBOOT}" -a -d "${NETBOOT}" ] && chown -R "${CHOWN_USER}:" "${NETBOOT}"
- [ -n "${CHROOT_ARCHIVE}" -a -f "${CHROOT_ARCHIVE}" ] && chown -R "${CHOWN_USER}:" "${CHROOT_ARCHIVE}"
eend 0
fi
log "------------------------------------------------------------------------------"
while getopts "a:C:c:d:D:e:g:i:I:o:r:s:t:U:v:AbBFnNqQuVz" opt; do
case "$opt" in
a) ARCH="$OPTARG" ;;
- A) PACK_ARTIFACTS=1 ;;
+ A) CLEAN_ARTIFACTS=1 ;;
b) BUILD_ONLY=1 ;;
B) BUILD_DIRTY=1 ;;
c) CLASSES="$OPTARG" ;;
[ -n "$OUTPUT" ] || OUTPUT='/grml/grml-live'
[ -n "$BUILD_OUTPUT" ] || BUILD_OUTPUT="$OUTPUT/grml_cd"
[ -n "$CHROOT_OUTPUT" ] || CHROOT_OUTPUT="$OUTPUT/grml_chroot"
-[ -n "$CHROOT_ARCHIVE" ] || CHROOT_ARCHIVE="$OUTPUT/$(basename $CHROOT_OUTPUT).tgz"
[ -n "$ISO_OUTPUT" ] || ISO_OUTPUT="$OUTPUT/grml_isos"
[ -n "$LOG_OUTPUT" ] || LOG_OUTPUT="$OUTPUT/grml_logs"
[ -n "$REPORTS" ] || REPORTS="${LOG_OUTPUT}/reports/"
[ -n "$SQUASHFS_ZLIB" ] && echo " Using ZLIB (instead of LZMA/XZ) compression."
[ -n "$SQUASHFS_OPTIONS" ] && echo " Using SQUASHFS_OPTIONS ${SQUASHFS_OPTIONS}"
[ -n "$VERBOSE" ] && echo " Using VERBOSE mode."
- [ -n "$PACK_ARTIFACTS" ] && echo " Will prepare packed artifacts and ensure clean build."
+ [ -n "$CLEAN_ARTIFACTS" ] && echo " Will clean output before and after running."
[ -n "$UPDATE" ] && echo " Executing UPDATE instead of fresh installation."
if [ -n "$BOOTSTRAP_ONLY" ] ; then
echo " Bootstrapping only and not building (files for) ISO."
# }}}
# clean up before start {{{
-if [ -n "${PACK_ARTIFACTS}" ]; then
+if [ -n "${CLEAN_ARTIFACTS}" ]; then
echo "Wiping old artifacts"
[ -n "${CHROOT_OUTPUT}" -a -d "${CHROOT_OUTPUT}" ] && rm -r "${CHROOT_OUTPUT}"
[ -n "${BUILD_OUTPUT}" -a -d "${BUILD_OUTPUT}" ] && rm -r "${BUILD_OUTPUT}"
extract_iso
# }}}
-# cleanup CHROOT_ARCHIVE now {{{
-if [ -n "${PACK_ARTIFACTS}" ]; then
- [ -n "${CHROOT_ARCHIVE}" -a -f "${CHROOT_ARCHIVE}" ] && rm "${CHROOT_ARCHIVE}"
-fi
-# }}}
-
# on-the-fly configuration {{{
if [ -n "$FAI_DEBOOTSTRAP" ] ; then
sed "s#^FAI_DEBOOTSTRAP=.*#FAI_DEBOOTSTRAP=\"$FAI_DEBOOTSTRAP\"#" "$NFSROOT_CONF" | sponge "$NFSROOT_CONF"
create_netbootpackage
# }}}
-# pack artifacts {{{
-if [ -n "$PACK_ARTIFACTS" ]; then
- log "Packing artifcats"
- einfo "Packing artifacts"
- [ -f "${CHROOT_ARCHIVE}" ] && rm -r "${CHROOT_ARCHIVE}"
- tar -c -a -f ${CHROOT_ARCHIVE} --preserve-permissions -C "$(dirname ${CHROOT_OUTPUT})" "$(basename ${CHROOT_OUTPUT})"
- eend 0
-fi
-# }}}
-
# log build information to database if grml-live-db is installed and enabled {{{
dpkg_to_db() {
if [ -d /usr/share/grml-live-db ] ; then