# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2 or any later version.
-# Latest change: Sun Dec 09 16:24:55 CET 2007 [mika]
+# Latest change: Sun Dec 09 18:18:27 CET 2007 [mika]
################################################################################
# read configuration files, set some misc variables {{{
# exit on any error:
set -e
-GRML_LIVE_VERSION='0.0.11'
+GRML_LIVE_VERSION='0.0.12'
CMDLINE="$0 $@"
ISO_DATE="$(date +%Y-%m-%d)"
touch $LOGFILE
chown root:adm $LOGFILE
chmod 640 $LOGFILE
-# clean/zero grml-live logfile:
-if [ -n "$ZERO_LOGFILE" ] ; then
- echo -n > $LOGFILE
-fi
-
-# clean/zero/remove old FAI directory:
-if [ -n "$ZERO_FAI_LOGFILE" ] ; then
- if [ -d /var/log/fai/"$HOSTNAME" ] ; then
- rm -rf /var/log/fai/"$HOSTNAME"/"$(readlink /var/log/fai/"$HOSTNAME"/last)"
- rm -rf /var/log/fai/"$HOSTNAME"/"$(readlink /var/log/fai/"$HOSTNAME"/last-dirinstall)"
- rm -rf /var/log/fai/"$HOSTNAME"/"$(readlink /var/log/fai/"$HOSTNAME"/last-softupdate)"
- fi
-fi
NFSROOT_CONF=/etc/grml/fai/make-fai-nfsroot.conf
log "No $LOCAL_CONFIG found, not sourcing it"
LOCAL_CONFIG=''
fi
+
+# clean/zero grml-live logfile:
+if [ -n "$ZERO_LOGFILE" ] ; then
+ echo -n > $LOGFILE
+fi
+
+# clean/zero/remove old FAI directory:
+if [ -n "$ZERO_FAI_LOGFILE" ] ; then
+ if [ -d /var/log/fai/"$HOSTNAME" ] ; then
+ rm -rf /var/log/fai/"$HOSTNAME"/"$(readlink /var/log/fai/"$HOSTNAME"/last)"
+ rm -rf /var/log/fai/"$HOSTNAME"/"$(readlink /var/log/fai/"$HOSTNAME"/last-dirinstall)"
+ rm -rf /var/log/fai/"$HOSTNAME"/"$(readlink /var/log/fai/"$HOSTNAME"/last-softupdate)"
+ rm -f /var/log/fai/"$HOSTNAME"/last \
+ /var/log/fai/"$HOSTNAME"/last-dirinstall \
+ /var/log/fai/"$HOSTNAME"/last-softupdate
+ fi
+fi
+
# }}}
# ask user whether the setup is ok {{{
if [ -n "$UPDATE" ] ; then
if ! [ -r "$CHROOT_OUTPUT/etc/grml_version" ] ; then
- log "Error: It does not look like you have a working chroot system. Updating not possible."
- eerror "Error: It does not look like you have a working chroot system. Updating not possible."
+ log "Error: does not look like you have a working chroot. Updating not possible."
+ eerror "Error: does not look like you have a working chroot. Updating not possible. (Drop -u option?)"
eend 1
bailout 20
fi
ewarn "$ISO_OUTPUT exists already, skipping stage 'iso build'" ; eend 0
else
mkdir -p "$ISO_OUTPUT" || bailout 6 "Problem with creating $ISO_OUTPUT for stage 'iso build'"
+
CURRENT_DIR=$(pwd)
- cd "$BUILD_OUTPUT" &&
- log "mkisofs -V grml '$VERSION' -publisher 'grml-live | grml.org' -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b $BOOT_FILE -o ${ISO_OUTPUT}/${ISO_NAME} ."
- mkisofs -V "grml $VERSION" -publisher 'grml-live | grml.org' \
- -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table \
- -b $BOOT_FILE \
- -o "${ISO_OUTPUT}/${ISO_NAME}" . ; RC=$?
- cd $CURRENT_DIR
+ if cd "$BUILD_OUTPUT" ; then
+ log "mkisofs -V grml '$VERSION' -publisher 'grml-live | grml.org' -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b $BOOT_FILE -o ${ISO_OUTPUT}/${ISO_NAME} ."
+ mkisofs -V "grml $VERSION" -publisher 'grml-live | grml.org' \
+ -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table \
+ -b $BOOT_FILE \
+ -o "${ISO_OUTPUT}/${ISO_NAME}" . ; RC=$?
+
+ # generate md5sum of ISO if we are using class 'RELEASE':
+ case $CLASSES in *RELEASE*)
+ [ "$RC" = 0 ] && \
+ ( cd $ISO_OUTPUT && \
+ md5sum ${ISO_NAME} > ${ISO_NAME}.md5 && \
+ touch -r ${ISO_NAME} ${ISO_NAME}.md5 )
+ ;;
+ esac
+
+ cd $CURRENT_DIR
+ fi
+
if [ "$RC" = 0 ] ; then
log "Finished execution of stage 'iso build' [$(date)]"
einfo "Finished execution of stage 'iso build'" ; eend 0