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
master
Antonio Alvarez Feijoo 2022-01-24 16:38:45 +01:00 committed by Jóhann B. Guðmundsson
parent 7ab1d00227
commit e86397de24
1 changed files with 7 additions and 7 deletions

View 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