grml-live.txt: output dir mount options; manifold
[grml-live.git] / grml-live
index 3a8c8e7..cd9290e 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -347,9 +347,13 @@ adjust_boot_files() {
       sed -i "s/%GRML_NAME%/$GRML_NAME/g"          "${file}"
       if [ -n "${fixed_squashfs_name}" ] ; then
         sed -i "s/%SQUASHFS_NAME%/${fixed_squashfs_name}/g" "${file}"
+      else
+        ewarn "Variable fixed_squashfs_name is unset, can't adjust %SQUASHFS_NAME% in templates." ; eend 1
       fi
       if [ -n "${fixed_release_info}" ] ; then
         sed -i "s/%RELEASE_INFO%/${fixed_release_info}/g"   "${file}"
+      else
+        ewarn "Variable fixed_release_info is unset, can't adjust %RELEASE_INFO% in templates." ; eend 1
       fi
       sed -i "s/%SHORT_NAME%/$SHORT_NAME/g"        "${file}"
       sed -i "s/%VERSION%/$VERSION/g"              "${file}"
@@ -1231,6 +1235,15 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
 
     # make sure the squashfs filename is set accordingly:
     SQUASHFS_NAME="$GRML_NAME.squashfs"
+    # adjust bootsplash accordingly but make sure the string has the according length
+    fixed_squashfs_name="$(cut_string 20 "$SQUASHFS_NAME")"
+    fixed_squashfs_name="$(extend_string_end 20 "$fixed_squashfs_name")"
+    for file in f4 f5 ; do
+      if [ -r "${BUILD_OUTPUT}/boot/isolinux/${file}" ] ; then
+        sed -i "s/%SQUASHFS_NAME%/${fixed_squashfs_name}/" "${BUILD_OUTPUT}/boot/isolinux/${file}"
+        sed -i "s/%SQUASHFS_NAME%/${fixed_squashfs_name}/" "${BUILD_OUTPUT}/boot/isolinux/${file}"
+      fi
+    done
 
     # adjust all variables in the templates with the according distribution information
     adjust_boot_files "${BUILD_OUTPUT}"/boot/isolinux/*.cfg \
@@ -1245,16 +1258,6 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
       done
     done
 
-    # adjust bootsplash accordingly but make sure the string has the according length
-    fixed_squashfs_name="$(cut_string 20 "$SQUASHFS_NAME")"
-    fixed_squashfs_name="$(extend_string_end 20 "$fixed_squashfs_name")"
-    for file in f4 f5 ; do
-      if [ -r "${BUILD_OUTPUT}/boot/isolinux/${file}" ] ; then
-        sed -i "s/%SQUASHFS_NAME%/${fixed_squashfs_name}/" "${BUILD_OUTPUT}/boot/isolinux/${file}"
-        sed -i "s/%SQUASHFS_NAME%/${fixed_squashfs_name}/" "${BUILD_OUTPUT}/boot/isolinux/${file}"
-      fi
-    done
-
     # generate addon list
     rm -f "${BUILD_OUTPUT}/${ADDONS_LIST_FILE}"
     for name in "${BUILD_OUTPUT}"/boot/isolinux/addon_*.cfg ; do
@@ -1589,9 +1592,19 @@ else
       eend $?
 
       log "$MKISOFS -V '${GRML_NAME} ${VERSION}' -publisher 'grml-live | grml.org' -l -r -J $BOOT_ARGS $EFI_ARGS -no-pad -o ${ISO_OUTPUT}/${ISO_NAME} ."
+      einfo "Generating ISO file..."
       $MKISOFS -V "${GRML_NAME} ${VERSION}" -publisher 'grml-live | grml.org' \
               -l -r -J $BOOT_ARGS $EFI_ARGS -no-pad \
               -o "${ISO_OUTPUT}/${ISO_NAME}" . ; RC=$?
+      eend $RC
+
+      # do not continue on errors, otherwise we might generate/overwrite the ISO with dd if=... stuff
+      if [ "$RC" != 0 ] ; then
+        log    "Error: critical error while generating ISO [exit code ${RC}]. Exiting."
+        eerror "Error: critical error while generating ISO [exit code ${RC}]. Exiting." ; eend 1
+        bailout $RC
+      fi
+
       # both of these need core.img there, so it’s easier to write it here
       if [ "$BOOT_METHOD" = "grub2" ] || [ "$HYBRID_METHOD" = "grub2" ]; then
          # must be <= 30720 bytes