]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(dracut-initramfs-restore.sh): unpack uncompressed initrd as last option
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Fri, 18 Mar 2022 14:42:42 +0000 (15:42 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Wed, 30 Mar 2022 21:25:15 +0000 (21:25 +0000)
Attempting to unpack the initrd assuming it is uncompressed when
it is delays the shutdown process by several seconds. This must
be the last check.

dracut-initramfs-restore.sh

index b19be7de3cfff636fd8149ca4e04686606e32eb2..68ea3873b8f095ea671f1893a4afb4db57815d71 100644 (file)
@@ -51,13 +51,13 @@ fi
 
 cd /run/initramfs
 
-if $SKIP "$IMG" | cpio -id --no-absolute-filenames --quiet > /dev/null \
-    || $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet > /dev/null \
+if $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
+    || $SKIP "$IMG" | zstd -d -c | cpio -id --no-absolute-filenames --quiet > /dev/null \
+    || $SKIP "$IMG" | cpio -id --no-absolute-filenames --quiet > /dev/null; then
     rm -f -- .need_shutdown
 else
     # something failed, so we clean up