From d0f3ed8fe2e08ecb1cf38f4e896086a2ea41e13f Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Wed, 13 Apr 2016 23:19:05 +0200 Subject: iso2usb.sh: use XZ for compressing/decompressing the initrd. --- iso2usb.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'iso2usb.sh') diff --git a/iso2usb.sh b/iso2usb.sh index c519035..5a3d87d 100644 --- a/iso2usb.sh +++ b/iso2usb.sh @@ -59,6 +59,10 @@ ISOMNT="" CNTMNT="" USBMNT="" +# Compressor used on the initrd ("gzip" or "xz --check=crc32"); +# Note that the kernel's XZ decompressor does not understand CRC64: +COMPR="xz --check=crc32" + # # -- function definitions -- # @@ -124,13 +128,22 @@ cat </dev/null) + OLDWAIT=$(uncompressfs ${IMGFILE} |cpio -i --to-stdout wait-for-root 2>/dev/null) if [ "$OLDWAIT" = "$WAIT" -a $DOLUKS -eq 0 ]; then return fi @@ -148,7 +161,7 @@ update_initrd() { echo "--- Extracting Slackware initrd and adding rootdelay for USB..." cd ${IMGDIR} - gunzip -cd ${IMGFILE} \ + uncompressfs ${IMGFILE} \ | cpio -i -d -H newc --no-absolute-filenames echo "--- Updating 'waitforroot' time from '$OLDWAIT' to '$WAIT':" echo ${WAIT} > wait-for-root @@ -162,7 +175,7 @@ update_initrd() { echo "--- Compressing the initrd image again:" chmod 0755 ${IMGDIR} - find . |cpio -o -H newc |gzip > ${IMGFILE} + find . |cpio -o -H newc |$COMPR > ${IMGFILE} cd - 2>/dev/null rm -rf $IMGDIR/* } # End of update_initrd() -- cgit v1.2.3