|
|
18971c |
From c2196a25b7ff4bd54f3cab64392535b755e4ff88 Mon Sep 17 00:00:00 2001
|
|
|
18971c |
From: Harald Hoyer <harald@redhat.com>
|
|
|
18971c |
Date: Thu, 20 Mar 2014 13:18:13 +0100
|
|
|
18971c |
Subject: [PATCH] dracut-initramfs-restore: fix unpacking with early microcode
|
|
|
18971c |
|
|
|
18971c |
(cherry picked from commit 0626cbe923732d45739ea6da4b816c78c44503ef)
|
|
|
18971c |
---
|
|
|
18971c |
dracut-initramfs-restore.sh | 10 +++++++---
|
|
|
18971c |
1 file changed, 7 insertions(+), 3 deletions(-)
|
|
|
18971c |
|
|
|
18971c |
diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh
|
|
|
18971c |
index f29c8146..0dd1938d 100644
|
|
|
18971c |
--- a/dracut-initramfs-restore.sh
|
|
|
18971c |
+++ b/dracut-initramfs-restore.sh
|
|
|
18971c |
@@ -6,6 +6,10 @@ set -e
|
|
|
18971c |
|
|
|
18971c |
KERNEL_VERSION="$(uname -r)"
|
|
|
18971c |
|
|
|
18971c |
+[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
|
|
18971c |
+SKIP="$dracutbasedir/skipcpio"
|
|
|
18971c |
+[[ -x $SKIP ]] || SKIP=cat
|
|
|
18971c |
+
|
|
|
18971c |
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
|
|
18971c |
|
|
|
18971c |
if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
|
|
|
18971c |
@@ -16,11 +20,11 @@ fi
|
|
|
18971c |
cd /run/initramfs
|
|
|
18971c |
|
|
|
18971c |
[ -f .need_shutdown -a -f "$IMG" ] || exit 1
|
|
|
18971c |
-if zcat "$IMG" | cpio -id --quiet >/dev/null; then
|
|
|
18971c |
+if $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
|
|
18971c |
rm -f -- .need_shutdown
|
|
|
18971c |
-elif xzcat "$IMG" | cpio -id --quiet >/dev/null; then
|
|
|
18971c |
+elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
|
|
18971c |
rm -f -- .need_shutdown
|
|
|
18971c |
-elif lz4 -d -c "$IMG" | cpio -id --quiet >/dev/null; then
|
|
|
18971c |
+elif $SKIP "$IMG" | lz4 -d -c | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
|
|
18971c |
rm -f -- .need_shutdown
|
|
|
18971c |
else
|
|
|
18971c |
# something failed, so we clean up
|