From e86397de24f4efa6d36e2bb5ae84b7d9ec69b72d Mon Sep 17 00:00:00 2001 From: Antonio Alvarez Feijoo Date: Mon, 24 Jan 2022 16:38:45 +0100 Subject: [PATCH] fix(dracut-initramfs-restore.sh): add missing compression options The unpack fails if the initrd is not compressed or compressed with bzip2 or LZO. Fix issue #1463 --- dracut-initramfs-restore.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh index aa9aec92..3c70b42c 100644 --- a/dracut-initramfs-restore.sh +++ b/dracut-initramfs-restore.sh @@ -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