From: Harald Hoyer Date: Thu, 5 Apr 2012 11:49:31 +0000 (+0200) Subject: do not use dracut shutdown, if something failed while unpacking X-Git-Tag: 018~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50bc2253d3e962499b39eb7fbdd60928aa8f3830;p=thirdparty%2Fdracut.git do not use dracut shutdown, if something failed while unpacking also require "xzcat" --- diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh index 26b698b90..06e2939fb 100644 --- a/dracut-initramfs-restore.sh +++ b/dracut-initramfs-restore.sh @@ -6,5 +6,14 @@ set -e cd /run/initramfs IMG="/boot/initramfs-$(uname -r).img" [ -f .need_shutdown -a -f "$IMG" ] || exit 1 -zcat "$IMG" | cpio -id >/dev/null 2>&1 -rm .need_shutdown +if zcat "$IMG" | cpio -id >/dev/null 2>&1; then + rm .need_shutdown +elif xzcat "$IMG" | cpio -id >/dev/null 2>&1; then + rm .need_shutdown +else + # something failed, so we clean up + rm -f /run/initramfs/shutdown + exit 1 +fi + +exit 0 diff --git a/dracut.spec b/dracut.spec index fa3fa39a0..074cb10a4 100644 --- a/dracut.spec +++ b/dracut.spec @@ -73,7 +73,7 @@ Requires: filesystem >= 2.1.0 Requires: findutils Requires: grep Requires: hardlink -Requires: gzip +Requires: gzip xz Requires: module-init-tools >= 3.7-9 Requires: sed Requires: udev > 166