Skip to content

Commit

Permalink
fix(dracut-initramfs-restore.sh): add missing compression options
Browse files Browse the repository at this point in the history
The unpack fails if the initrd is not compressed or compressed with
bzip2 or LZO.

Fix issue #1463
  • Loading branch information
aafeijoo-suse authored and johannbg committed Feb 2, 2022
1 parent 7ab1d00 commit e86397d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dracut-initramfs-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e86397d

Please sign in to comment.