]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-initramfs-restore: fix unpacking with early microcode
authorHarald Hoyer <harald@redhat.com>
Thu, 20 Mar 2014 12:18:13 +0000 (13:18 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 29 Jul 2014 09:52:07 +0000 (11:52 +0200)
(cherry picked from commit 0626cbe923732d45739ea6da4b816c78c44503ef)

dracut-initramfs-restore.sh

index f29c8146edd3ef9b4fa2d79ef2769177a4ab3bb7..0dd1938db75656c13daa1f9f558fa673c59878f7 100644 (file)
@@ -6,6 +6,10 @@ set -e
 
 KERNEL_VERSION="$(uname -r)"
 
+[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
+SKIP="$dracutbasedir/skipcpio"
+[[ -x $SKIP ]] || SKIP=cat
+
 [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
 
 if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
@@ -16,11 +20,11 @@ fi
 cd /run/initramfs
 
 [ -f .need_shutdown -a -f "$IMG" ] || exit 1
-if zcat "$IMG"  | cpio -id --quiet >/dev/null; then
+if $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
     rm -f -- .need_shutdown
-elif xzcat "$IMG"  | cpio -id --quiet >/dev/null; then
+elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
     rm -f -- .need_shutdown
-elif lz4 -d -c "$IMG"  | cpio -id --quiet >/dev/null; then
+elif $SKIP "$IMG" | lz4 -d -c | cpio -id --no-absolute-filenames --quiet >/dev/null; then
     rm -f -- .need_shutdown
 else
     # something failed, so we clean up