From 338bbb2a14b9680e6eab3578220b1ab6e9a5d2cc Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sun, 16 Dec 2007 13:57:49 +0100 Subject: [PATCH] Implement -b option via use of FAI's skiptask --- debian/changelog | 3 +-- docs/grml-live.txt | 3 +-- etc/grml/fai/config/hooks/updatebase.GRMLBASE | 5 ++++- grml-live | 17 +++-------------- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/debian/changelog b/debian/changelog index dd315c6..6deb80c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,6 @@ grml-live (0.0.13) unstable; urgency=low - * New option '-b' for "build-only", requires FAI patch - /usr/share/grml-live/patches/fai_chroot_update.patch + * New option '-b' for "build-only". * Replace mailx with bsd-mailx in GRML_FULL. http://packages.qa.debian.org/b/bsd-mailx/news/20071209T135336Z.html * Document grml2ram bootoption in grml-cheatcodes.txt diff --git a/docs/grml-live.txt b/docs/grml-live.txt index 94a22d4..74a9356 100644 --- a/docs/grml-live.txt +++ b/docs/grml-live.txt @@ -67,8 +67,7 @@ nature and the need of working in a chroot. Build the ISO without updating the chroot via FAI. This option is useful for example when working on stable releases: if you have a working base system/chroot and do not want to execute any further updates (via "-u" option) -but intend to only build the ISO. (Notice: This option requires a feature within -FAI which is not yet part of the official FAI release yet.) +but intend to only build the ISO. -c **CLASSES**:: diff --git a/etc/grml/fai/config/hooks/updatebase.GRMLBASE b/etc/grml/fai/config/hooks/updatebase.GRMLBASE index b47973c..359c7ba 100755 --- a/etc/grml/fai/config/hooks/updatebase.GRMLBASE +++ b/etc/grml/fai/config/hooks/updatebase.GRMLBASE @@ -4,11 +4,14 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # 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 19:07:51 CET 2007 [mika] +# Latest change: Sun Dec 16 13:56:58 CET 2007 [mika] ################################################################################ if [ "$FAI_ACTION" = "softupdate" ] ; then + # we want to use our own sources.list: skiptask updatebase + # skip the task if we want to build a new ISO only: + [ -n "$BUILD_ONLY" ] && skiptask instsoft fi ## END OF FILE ################################################################# diff --git a/grml-live b/grml-live index dff9efd..e30aa12 100755 --- a/grml-live +++ b/grml-live @@ -38,12 +38,6 @@ if [ -r /var/run/fai/fai_softupdate_is_running ] ; then exit 1 fi -if [ -r /var/run/fai/fai_chrootupdate_is_running ] ; then - echo "/usr/sbin/fai chrootupdate already running or was aborted before.">&2 - echo "You may remove /var/run/fai/fai_chrootupdate_is_running and try again.">&2 - exit 1 -fi - # make sure they are not set by default VERBOSE='' FORCE='' @@ -70,7 +64,6 @@ PN=$(basename $0) bailout() { [ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}" rm -f /var/run/fai/fai_softupdate_is_running \ - /var/run/fai/fai_chrootupdate_is_running \ /var/run/fai/FAI_INSTALLATION_IN_PROGRESS [ -n "$1" ] && EXIT="$1" || EXIT="1" [ -n "$2" ] && eerror "$2">&2 @@ -241,10 +234,8 @@ if [ -n "$ZERO_FAI_LOGFILE" ] ; 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 -rf /var/log/fai/"$HOSTNAME"/"$(readlink /var/log/fai/"$HOSTNAME"/last-chrootupdate)" rm -f /var/log/fai/"$HOSTNAME"/last \ /var/log/fai/"$HOSTNAME"/last-dirinstall \ - /var/log/fai/"$HOSTNAME"/last-chrootupdate \ /var/log/fai/"$HOSTNAME"/last-softupdate fi fi @@ -366,10 +357,8 @@ fi # CHROOT_OUTPUT - execute FAI {{{ [ -n "$CHROOT_OUTPUT" ] || CHROOT_OUTPUT="$OUTPUT/grml_chroot" -if [ -n "$UPDATE" ] ; then +if [ -n "$UPDATE" -o -n "$BUILD_ONLY" ] ; then FAI_ACTION=softupdate -elif [ -n "$BUILD_ONLY" ] ; then - FAI_ACTION=chrootupdate else FAI_ACTION=dirinstall fi @@ -395,8 +384,8 @@ else fi log "Executed FAI command line:" - log "fai $VERBOSE -C $GRML_FAI_CONFIG -c$CLASSES -u $HOSTNAME $FAI_ACTION $CHROOT_OUTPUT $FAI_ARGS" - fai $VERBOSE -C "$GRML_FAI_CONFIG" -c"$CLASSES" -u "$HOSTNAME" $FAI_ACTION "$CHROOT_OUTPUT" $FAI_ARGS | tee -a $LOGFILE + log "BUILD_ONLY=$BUILD_ONLY fai $VERBOSE -C $GRML_FAI_CONFIG -c$CLASSES -u $HOSTNAME $FAI_ACTION $CHROOT_OUTPUT $FAI_ARGS" + BUILD_ONLY="$BUILD_ONLY" fai $VERBOSE -C "$GRML_FAI_CONFIG" -c"$CLASSES" -u "$HOSTNAME" $FAI_ACTION "$CHROOT_OUTPUT" $FAI_ARGS | tee -a $LOGFILE log "Setting /etc/grml_version to $GRML_NAME $VERSION Release Codename $RELEASENAME [$ISO_DATE]" echo "$GRML_NAME $VERSION Release Codename $RELEASENAME [$ISO_DATE]" > $CHROOT_OUTPUT/etc/grml_version -- 2.1.4