Changed isolinux vesamenu layout to support better multiiso layout
[grml-live.git] / grml-live
index 8fe8db2..895fc78 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -23,7 +23,7 @@ fi
 set -e
 
 # global variables
 set -e
 
 # global variables
-GRML_LIVE_VERSION='0.9.23'
+GRML_LIVE_VERSION='0.9.24-pre1'
 PN="$(basename $0)"
 CMDLINE="$0 $@"
 ISO_DATE="$(date +%Y-%m-%d)"
 PN="$(basename $0)"
 CMDLINE="$0 $@"
 ISO_DATE="$(date +%Y-%m-%d)"
@@ -44,7 +44,7 @@ Usage: $PN [options, see as follows]
    -c <classe[s]>          classes to be used for building the ISO via FAI
    -C <configfile>         configuration file for grml-live
    -F                      force execution without prompting
    -c <classe[s]>          classes to be used for building the ISO via FAI
    -C <configfile>         configuration file for grml-live
    -F                      force execution without prompting
-   -g <grml_name>]         set the grml flavour name
+   -g <grml_name>          set the grml flavour name
    -h                      display short usage information and exit
    -i <iso_name>           name of ISO
    -I <src_directory>      directory which provides files that should become
    -h                      display short usage information and exit
    -i <iso_name>           name of ISO
    -I <src_directory>      directory which provides files that should become
@@ -52,7 +52,7 @@ Usage: $PN [options, see as follows]
    -n                      skip generation of ISO
    -o <output_directory>   main output directory of the build process
    -q                      skip mksquashfs
    -n                      skip generation of ISO
    -o <output_directory>   main output directory of the build process
    -q                      skip mksquashfs
-   -r <release_name<       release name
+   -r <release_name>       release name
    -s <suite>              Debian suite; values: etch, lenny, squeeze, sid
    -t <template_directory> place of the templates
    -u                      update existing chroot instead of rebuilding it from scratch
    -s <suite>              Debian suite; values: etch, lenny, squeeze, sid
    -t <template_directory> place of the templates
    -u                      update existing chroot instead of rebuilding it from scratch
@@ -561,8 +561,8 @@ else
          einfo "Finished execution of stage 'fai dirinstall'"
       fi
 
          einfo "Finished execution of stage 'fai dirinstall'"
       fi
 
-      einfo "Find FAI build logs at $(readlink -f /var/log/fai/$HOSTNAME/last)."
-      log   "Find FAI build logs at $(readlink -f /var/log/fai/$HOSTNAME/last)."
+      einfo "Find FAI build logs at $(readlink -f /var/log/fai/$HOSTNAME/last)"
+      log   "Find FAI build logs at $(readlink -f /var/log/fai/$HOSTNAME/last)"
       eend 0
    fi
 fi # BUILD_DIRTY?
       eend 0
    fi
 fi # BUILD_DIRTY?
@@ -692,10 +692,12 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
          sed -i "s/%ARCH%/$ARCH/"                  "$BUILD_OUTPUT"/boot/isolinux/grml.cfg
       fi
 
          sed -i "s/%ARCH%/$ARCH/"                  "$BUILD_OUTPUT"/boot/isolinux/grml.cfg
       fi
 
-      sed -i "s/%VERSION%/$VERSION/"           "$BUILD_OUTPUT"/boot/isolinux/grml.cfg
-      sed -i "s/%GRML_LONG_NAME%/$GRML_NAME/"  "$BUILD_OUTPUT"/boot/isolinux/grml.cfg
-      sed -i "s/%GRML_NAME%/$SHORT_GRML_NAME/" "$BUILD_OUTPUT"/boot/isolinux/grml.cfg
-      sed -i "s/%ARCH%/$ARCH/"                 "$BUILD_OUTPUT"/boot/isolinux/grml.cfg
+      for FILE in grml default ; do
+         sed -i "s/%VERSION%/$VERSION/"           "$BUILD_OUTPUT"/boot/isolinux/${FILE}.cfg
+         sed -i "s/%GRML_LONG_NAME%/$GRML_NAME/"  "$BUILD_OUTPUT"/boot/isolinux/${FILE}.cfg
+         sed -i "s/%GRML_NAME%/$SHORT_GRML_NAME/" "$BUILD_OUTPUT"/boot/isolinux/${FILE}.cfg
+         sed -i "s/%ARCH%/$ARCH/"                 "$BUILD_OUTPUT"/boot/isolinux/${FILE}.cfg
+      done
 
       sed -i "s/%DISTRI_INFO%/$DISTRI_INFO/" "$BUILD_OUTPUT"/boot/isolinux/vesamenu.cfg
       sed -i "s/%DISTRI_SPLASH%/$DISTRI_SPLASH/" "$BUILD_OUTPUT"/boot/isolinux/vesamenu.cfg
 
       sed -i "s/%DISTRI_INFO%/$DISTRI_INFO/" "$BUILD_OUTPUT"/boot/isolinux/vesamenu.cfg
       sed -i "s/%DISTRI_SPLASH%/$DISTRI_SPLASH/" "$BUILD_OUTPUT"/boot/isolinux/vesamenu.cfg
@@ -712,9 +714,16 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
       sed -i "s/%GRML_NAME_SQUASHFS%/$GRML_NAME_SQUASHFS/" "$BUILD_OUTPUT"/boot/isolinux/f5
 
       if ! [ -r "${BUILD_OUTPUT}/boot/isolinux/${DISTRI_NAME}.cfg" ] || [ "$DISTRI_NAME" = "grml" ] ; then
       sed -i "s/%GRML_NAME_SQUASHFS%/$GRML_NAME_SQUASHFS/" "$BUILD_OUTPUT"/boot/isolinux/f5
 
       if ! [ -r "${BUILD_OUTPUT}/boot/isolinux/${DISTRI_NAME}.cfg" ] || [ "$DISTRI_NAME" = "grml" ] ; then
-         log "including grml.cfg in ${BUILD_OUTPUT}/boot/isolinux/distri.cfg"
-         echo "include grml.cfg" > "${BUILD_OUTPUT}/boot/isolinux/distri.cfg"
-         [ -n "$NO_ADDONS" ] || echo "include addons.cfg" >> "${BUILD_OUTPUT}/boot/isolinux/distri.cfg"
+         log "including grmlmain.cfg in ${BUILD_OUTPUT}/boot/isolinux/distri.cfg"
+         echo "include grmlmain.cfg" > "${BUILD_OUTPUT}/boot/isolinux/distri.cfg"
+         echo "include grml.cfg" > "${BUILD_OUTPUT}/boot/isolinux/grmlmain.cfg"
+         echo "include options.cfg" >> "${BUILD_OUTPUT}/boot/isolinux/grmlmain.cfg"
+         if [ ! -n "$NO_ADDONS" ] ; then
+            echo "include addons.cfg" >> "${BUILD_OUTPUT}/boot/isolinux/grmlmain.cfg"
+         fi
+         echo "include hd.cfg" >> "${BUILD_OUTPUT}/boot/isolinux/grmlmain.cfg"
+         echo "include isoprompt.cfg" >> "${BUILD_OUTPUT}/boot/isolinux/grmlmain.cfg"
+         echo "include hidden.cfg" >> "${BUILD_OUTPUT}/boot/isolinux/grmlmain.cfg"
       else # assume we are building a custom distribution:
          log "File ${BUILD_OUTPUT}/boot/isolinux/${DISTRI_NAME}.cfg found, using it."
          einfo "File ${BUILD_OUTPUT}/boot/isolinux/${DISTRI_NAME}.cfg found, using it."
       else # assume we are building a custom distribution:
          log "File ${BUILD_OUTPUT}/boot/isolinux/${DISTRI_NAME}.cfg found, using it."
          einfo "File ${BUILD_OUTPUT}/boot/isolinux/${DISTRI_NAME}.cfg found, using it."
@@ -906,8 +915,8 @@ else
    # make sure to drop the -nolzma option if it's not available:
    if echo "$SQUASHFS_OPTIONS" | grep -q -- "-nolzma" ; then
       if ! $SQUASHFS_BINARY --help 2>&1 | grep -q -- '-nolzma' ; then
    # make sure to drop the -nolzma option if it's not available:
    if echo "$SQUASHFS_OPTIONS" | grep -q -- "-nolzma" ; then
       if ! $SQUASHFS_BINARY --help 2>&1 | grep -q -- '-nolzma' ; then
-         log   "$SQUASHFS_BINARY does NOT support the nolzma option, dropping it and using default mode."
-         ewarn "$SQUASHFS_BINARY does NOT support the nolzma option, dropping it and using default mode."
+         log   "The $SQUASHFS_BINARY binary does NOT support the nolzma option, dropping it and using default mode."
+         ewarn "The $SQUASHFS_BINARY binary does NOT support the nolzma option, dropping it and using default mode."
          SQUASHFS_OPTIONS="$(echo $SQUASHFS_OPTIONS | sed 's/-nolzma//g')"
          eend 0
       fi
          SQUASHFS_OPTIONS="$(echo $SQUASHFS_OPTIONS | sed 's/-nolzma//g')"
          eend 0
       fi
@@ -916,8 +925,8 @@ else
    # make sure to drop the -lzma option if it's not available:
    if echo "$SQUASHFS_OPTIONS" | grep -q -- "-lzma" ; then
       if ! $SQUASHFS_BINARY --help 2>&1 | grep -q -- '-lzma' ; then
    # make sure to drop the -lzma option if it's not available:
    if echo "$SQUASHFS_OPTIONS" | grep -q -- "-lzma" ; then
       if ! $SQUASHFS_BINARY --help 2>&1 | grep -q -- '-lzma' ; then
-         log   "$SQUASHFS_BINARY does NOT support the lzma option, dropping it and using default mode."
-         ewarn "$SQUASHFS_BINARY does NOT support the lzma option, dropping it and using default mode."
+         log   "The $SQUASHFS_BINARY binary does NOT support the lzma option, dropping it and using default mode."
+         ewarn "The $SQUASHFS_BINARY binary does NOT support the lzma option, dropping it and using default mode."
          SQUASHFS_OPTIONS="$(echo $SQUASHFS_OPTIONS | sed 's/-lzma//g')"
          eend 0
       fi
          SQUASHFS_OPTIONS="$(echo $SQUASHFS_OPTIONS | sed 's/-lzma//g')"
          eend 0
       fi
@@ -993,7 +1002,7 @@ elif [ -n "$SKIP_MKISOFS" ] ; then
 else
    mkdir -p "$ISO_OUTPUT" || bailout 6 "Problem with creating $ISO_OUTPUT for stage 'iso build'"
 
 else
    mkdir -p "$ISO_OUTPUT" || bailout 6 "Problem with creating $ISO_OUTPUT for stage 'iso build'"
 
-   if $FORCE_ISO_REBUILD ; then
+   if $FORCE_ISO_REBUILD && ! [ -f "${ISO_OUTPUT}/${ISO_NAME}" ] ; then
       log   "Forcing rebuild of ISO because files on ISO have been modified."
       einfo "Forcing rebuild of ISO because files on ISO have been modified."
    fi
       log   "Forcing rebuild of ISO because files on ISO have been modified."
       einfo "Forcing rebuild of ISO because files on ISO have been modified."
    fi