Implement -b option via use of FAI's skiptask
authorMichael Prokop <devnull@localhost>
Sun, 16 Dec 2007 12:57:49 +0000 (13:57 +0100)
committerMichael Prokop <devnull@localhost>
Sun, 16 Dec 2007 12:57:49 +0000 (13:57 +0100)
debian/changelog
docs/grml-live.txt
etc/grml/fai/config/hooks/updatebase.GRMLBASE
grml-live

index dd315c6..6deb80c 100644 (file)
@@ -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
index 94a22d4..74a9356 100644 (file)
@@ -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**::
 
index b47973c..359c7ba 100755 (executable)
@@ -4,11 +4,14 @@
 # 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 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 #################################################################
index dff9efd..e30aa12 100755 (executable)
--- 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