+ case $KERNEL_IMAGE in
+ *vmlinuz-2.6.31-grml*|*vmlinuz-2.6.33-grml*)
+ SQUASHFS_BINARY='mksquashfs-lzma'
+
+ # if using zlib compression kernel 2.6.3{1,3}-grml can be used with
+ # mksquashfs as well, therefore try to fall back if mksquashfs-lzma
+ # is NOT available
+ if ! which $SQUASHFS_BINARY >/dev/null 2>&1 && [ -n "$SQUASHFS_ZLIB" ] ; then
+ log "Squashfs binary $SQUASHFS_BINARY not available but building with zlib..."
+ log "\`-> trying to fall back to mksquashfs."
+ ewarn "Squashfs binary $SQUASHFS_BINARY not available but building with zlib..."
+ ewarn "\`-> trying to fall back to mksquashfs."
+ SQUASHFS_BINARY='mksquashfs'
+ eend 0
+ fi
+ ;;
+
+ *vmlinuz-2.6.35-grml*)
+ SQUASHFS_BINARY='mksquashfs-lzma4'
+
+ # if using zlib compression kernel 2.6.35-grml can be used with
+ # mksquashfs-lzma as well, therefore try to fall back if
+ # mksquashfs-lzma4 is NOT available
+ if ! which $SQUASHFS_BINARY >/dev/null 2>&1 && [ -n "$SQUASHFS_ZLIB" ] ; then
+ log "Squashfs binary $SQUASHFS_BINARY not available but building with zlib..."
+ log "\`-> trying to fall back to mksquashfs-lzma."
+ ewarn "Squashfs binary $SQUASHFS_BINARY not available but building with zlib..."
+ ewarn "\`-> trying to fall back to mksquashfs-lzma."
+ SQUASHFS_BINARY='mksquashfs-lzma'
+ eend 0
+ fi
+
+ # squashfs-tools 1:4.0-x work with 2.6.35-grml as well with default
+ # options, they just lack proper LZMA compression, so fall back as
+ # last option and inform user
+ if ! which $SQUASHFS_BINARY >/dev/null 2>&1 ; then
+ log "Squashfs binary $SQUASHFS_BINARY not available either..."
+ log "\`-> trying to fall back to mksquashfs, WARNING: very probably lacks LZMA compression."
+ ewarn "Squashfs binary $SQUASHFS_BINARY not available either..."
+ ewarn "\`-> trying to fall back to mksquashfs, WARNING: very probably lacks LZMA compression."
+ SQUASHFS_BINARY='mksquashfs'
+ eend 0
+ fi
+ ;;
+
+ *vmlinuz-2.6.23-grml*|*vmlinuz-2.6.26-grml*|*vmlinuz-2.6.28-grml*)
+ log "Strongly outdated kernel version detected: $KERNEL_IMAGE"
+ eerror "Strongly outdated kernel version detected: $KERNEL_IMAGE"
+ eerror "|-> please update kernel version of live system to at *least* 2.6.31-grml[64]..."
+ eerror "\`-> or otherwise (not recommended though) set SQUASHFS_BINARY accordingly."
+ eend 1
+ bailout
+ ;;
+
+ *)
+ SQUASHFS_BINARY='mksquashfs'
+ log "Could not detect grml kernel version and SQUASHFS_BINARY is unset."
+ ewarn "Could not detect grml kernel version and SQUASHFS_BINARY is unset."
+ ewarn "\`-> Assuming you want to use mksquashfs binary, if it fails please override with \$SQUASHFS_BINARY."
+ eend 0
+ ;;
+ esac
+
+ # check whether we have the according binary available:
+ if ! which $SQUASHFS_BINARY >/dev/null 2>&1 ; then
+ log "Error: required mksquashfs binary (${SQUASHFS_BINARY}) could not be found. Exiting."
+ eerror "Error: required mksquashfs binary (${SQUASHFS_BINARY}) could not be found. Exiting."
+ eerror "|-> Make sure to install squashfs-tool, squashfs-lzma-tools and/or squashfs-lzma-tools4..."
+ eerror "|-> ... and set \$SQUASHFS_BINARY accordingly to the kernel version."
+ eerror "\`-> Visit http://grml.org/grml-live/#current_state for further details."
+ eend 1
+ bailout