do not use dracut shutdown, if something failed while unpacking
authorHarald Hoyer <harald@redhat.com>
Thu, 5 Apr 2012 11:49:31 +0000 (13:49 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 5 Apr 2012 11:54:38 +0000 (13:54 +0200)
also require "xzcat"

dracut-initramfs-restore.sh
dracut.spec

index 26b698b..06e2939 100644 (file)
@@ -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
index fa3fa39..074cb10 100644 (file)
@@ -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