]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(dracut-initramfs-restore.sh): add missing compression options
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Mon, 24 Jan 2022 15:38:45 +0000 (16:38 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Wed, 2 Feb 2022 22:55:49 +0000 (22:55 +0000)
The unpack fails if the initrd is not compressed or compressed with
bzip2 or LZO.

Fix issue #1463

dracut-initramfs-restore.sh

index aa9aec9255ec63f0fd46c1f15553362cbb98bbb5..3c70b42c3c9aa822d9c71aae1c946e058d3ed7df 100644 (file)
@@ -51,13 +51,13 @@ fi
 
 cd /run/initramfs
 
-if $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet > /dev/null; then
-    rm -f -- .need_shutdown
-elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet > /dev/null; then
-    rm -f -- .need_shutdown
-elif $SKIP "$IMG" | lz4 -d -c | cpio -id --no-absolute-filenames --quiet > /dev/null; then
-    rm -f -- .need_shutdown
-elif $SKIP "$IMG" | zstd -d -c | cpio -id --no-absolute-filenames --quiet > /dev/null; then
+if $SKIP "$IMG" | cpio -id --no-absolute-filenames --quiet > /dev/null \
+    || $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet > /dev/null \
+    || $SKIP "$IMG" | bzcat | cpio -id --no-absolute-filenames --quiet > /dev/null \
+    || $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet > /dev/null \
+    || $SKIP "$IMG" | lz4 -d -c | cpio -id --no-absolute-filenames --quiet > /dev/null \
+    || $SKIP "$IMG" | lzop -d -c | cpio -id --no-absolute-filenames --quiet > /dev/null \
+    || $SKIP "$IMG" | zstd -d -c | cpio -id --no-absolute-filenames --quiet > /dev/null; then
     rm -f -- .need_shutdown
 else
     # something failed, so we clean up