Display progress of squashfs
authorMichael Prokop <devnull@localhost>
Sun, 17 Aug 2008 17:44:46 +0000 (19:44 +0200)
committerMichael Prokop <devnull@localhost>
Sun, 17 Aug 2008 17:44:46 +0000 (19:44 +0200)
debian/changelog
grml-live

index ecffab1..b4a9334 100644 (file)
@@ -27,8 +27,10 @@ grml-live (0.9) unstable; urgency=low
   * Display SQUASHFS_OPTIONS in configuration overview.
   * Make sure it's possible to get usage information without being
     root or actually executing the script.
+  * Display progress of squashfs, when building via a buildsystem
+    just set -no-progress in $SQUASHFS_OPTIONS instead.
 
- -- Michael Prokop <mika@grml.org>  Sun, 17 Aug 2008 13:19:24 +0200
+ -- Michael Prokop <mika@grml.org>  Sun, 17 Aug 2008 19:41:25 +0200
 
 grml-live (0.8) unstable; urgency=low
 
index f432721..2acc7b2 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -4,7 +4,7 @@
 # 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 Aug 17 13:19:16 CEST 2008 [mika]
+# Latest change: Sun Aug 17 19:44:27 CEST 2008 [mika]
 ################################################################################
 
 # read configuration files, set some misc variables {{{
@@ -587,18 +587,28 @@ else
       mksquashfs --help 2>&1 | grep -q -- "$SQUASHFS_ZLIB" || SQUASHFS_ZLIB=''
    fi
 
-   # execute squashfs:
-   if mksquashfs --help 2>&1 | grep -q -- -no-progress ; then
-      log "mksquashfs $CHROOT_OUTPUT/* $BUILD_OUTPUT/live/${GRML_NAME}.squashfs -noappend -no-progress $SQUASHFS_OPTIONS $SQUASHFS_ZLIB"
-      mksquashfs $CHROOT_OUTPUT/* $BUILD_OUTPUT/live/"${GRML_NAME}".squashfs -noappend -no-progress $SQUASHFS_OPTIONS $SQUASHFS_ZLIB
-   else
-      log "mksquashfs $CHROOT_OUTPUT/* $BUILD_OUTPUT/live/${GRML_NAME}.squashfs -noappend $SQUASHFS_OPTIONS $SQUASHFS_ZLIB"
-      mksquashfs $CHROOT_OUTPUT/* $BUILD_OUTPUT/live/"${GRML_NAME}".squashfs -noappend $SQUASHFS_OPTIONS $SQUASHFS_ZLIB
+   if echo "$SQUASHFS_OPTIONS" | grep -q -- "-nolzma" ; then
+      ewarn "mksquashfs does NOT support the nolzma option, falling back to zlib mode."
+      SQUASHFS_OPTIONS="$(echo $SQUASHFS_OPTIONS | sed 's/-nolzma//g')"
+      eend 0
    fi
 
-   echo "${GRML_NAME}.squashfs" > $BUILD_OUTPUT/live/filesystem.module
-   log "Finished execution of stage 'squashfs' [$(date)]"
-   einfo "Finished execution of stage 'squashfs'" ; eend 0
+   SQUASHFS_OUTPUT="$(mktemp -t grml-live.XXXXXX)"
+   log "mksquashfs $CHROOT_OUTPUT/* $BUILD_OUTPUT/live/${GRML_NAME}.squashfs -noappend $SQUASHFS_OPTIONS $SQUASHFS_ZLIB"
+   if mksquashfs $CHROOT_OUTPUT/* $BUILD_OUTPUT/live/"${GRML_NAME}".squashfs \
+      -noappend $SQUASHFS_OPTIONS $SQUASHFS_ZLIB 2>"${SQUASHFS_OUTPUT}" ; then
+      echo "${GRML_NAME}.squashfs" > $BUILD_OUTPUT/live/filesystem.module
+      log "Finished execution of stage 'squashfs' [$(date)]"
+      einfo "Finished execution of stage 'squashfs'" ; eend 0
+      rm -f "${SQUASHFS_OUTPUT}"
+   else
+      log "There was an error executing stage 'squashfs' [$(date)]:"
+      log "$(cat $SQUASHFS_OUTPUT)"
+      eerror "There was an error executing stage 'squashfs':" ; eend 1
+      cat "${SQUASHFS_OUTPUT}"
+      rm -f "${SQUASHFS_OUTPUT}"
+      bailout
+   fi
 fi
 
 # create md5sum file: