Blame SOURCES/0007-dracut-Generlize-microcode-early-cpio-usage.patch

18971c
From 4b1aa19fa0fad0e607961995dbbe971be2ef9f81 Mon Sep 17 00:00:00 2001
18971c
From: Thomas Renninger <trenn@suse.de>
18971c
Date: Fri, 27 Sep 2013 20:10:37 +0200
18971c
Subject: [PATCH] dracut: Generlize microcode early cpio usage
18971c
18971c
ACPI early table override also may need to place files into an early cpio.
18971c
Reflect this in variable and file names.
18971c
This change is renaming only and does not introduce any real change.
18971c
18971c
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
18971c
Signed-off-by: Thomas Renninger <trenn@suse.de>
18971c
---
18971c
 dracut.sh | 17 +++++++++--------
18971c
 1 file changed, 9 insertions(+), 8 deletions(-)
18971c
18971c
diff --git a/dracut.sh b/dracut.sh
18971c
index 177e66d5..b3b80886 100755
18971c
--- a/dracut.sh
18971c
+++ b/dracut.sh
18971c
@@ -704,9 +704,9 @@ readonly initdir="$(mktemp --tmpdir="$TMPDIR/" -d -t initramfs.XXXXXX)"
18971c
 }
18971c
 
18971c
 if [[ $early_microcode = yes ]]; then
18971c
-    readonly microcode_dir="$(mktemp --tmpdir="$TMPDIR/" -d -t early_microcode.XXXXXX)"
18971c
-    [ -d "$microcode_dir" ] || {
18971c
-        printf "%s\n" "dracut: mktemp --tmpdir=\"$TMPDIR/\" -d -t early_microcode.XXXXXX failed." >&2
18971c
+    readonly early_cpio_dir="$(mktemp --tmpdir="$TMPDIR/" -d -t early_cpio.XXXXXX)"
18971c
+    [ -d "$early_cpio_dir" ] || {
18971c
+        printf "%s\n" "dracut: mktemp --tmpdir=\"$TMPDIR/\" -d -t early_cpio.XXXXXX failed." >&2
18971c
         exit 1
18971c
     }
18971c
 fi
18971c
@@ -715,7 +715,7 @@ trap '
18971c
     ret=$?;
18971c
     [[ $outfile ]] && [[ -f $outfile.$$ ]] && rm -f -- "$outfile.$$";
18971c
     [[ $keep ]] && echo "Not removing $initdir." >&2 || { [[ $initdir ]] && rm -rf -- "$initdir"; };
18971c
-    [[ $keep ]] && echo "Not removing $microcode_dir." >&2 || { [[ $microcode_dir ]] && rm -Rf -- "$microcode_dir"; };
18971c
+    [[ $keep ]] && echo "Not removing $early_cpio_dir." >&2 || { [[ $early_cpio_dir ]] && rm -Rf -- "$early_cpio_dir"; };
18971c
     [[ $_dlogdir ]] && rm -Rf -- "$_dlogdir";
18971c
     exit $ret;
18971c
     ' EXIT
18971c
@@ -1311,7 +1311,7 @@ if [[ $early_microcode = yes ]]; then
18971c
     dinfo "*** Generating early-microcode cpio image ***"
18971c
     ucode_dir=(amd-ucode intel-ucode)
18971c
     ucode_dest=(AuthenticAMD.bin GenuineIntel.bin)
18971c
-    _dest_dir="$microcode_dir/d/kernel/x86/microcode"
18971c
+    _dest_dir="$early_cpio_dir/d/kernel/x86/microcode"
18971c
     _dest_idx="0 1"
18971c
     mkdir -p $_dest_dir
18971c
     if [[ $hostonly ]]; then
18971c
@@ -1331,14 +1331,15 @@ if [[ $early_microcode = yes ]]; then
18971c
             fi
18971c
         done
18971c
     done
18971c
-    (cd "$microcode_dir/d"; find . -print0 | cpio --null -o -H newc --quiet >../ucode.cpio)
18971c
+    create_early_cpio="yes"
18971c
 fi
18971c
 
18971c
 rm -f -- "$outfile"
18971c
 dinfo "*** Creating image file ***"
18971c
-if [[ $early_microcode = yes ]]; then
18971c
+if [[ $create_early_cpio = yes ]]; then
18971c
     # The microcode blob is _before_ the initramfs blob, not after
18971c
-    mv $microcode_dir/ucode.cpio $outfile.$$
18971c
+    (cd "$early_cpio_dir/d"; find . -print0 | cpio --null -o -H newc --quiet >../early.cpio)
18971c
+    mv $early_cpio_dir/early.cpio $outfile.$$
18971c
 fi
18971c
 if ! ( umask 077; cd "$initdir"; find . -print0 | cpio --null -R 0:0 -H newc -o --quiet| \
18971c
     $compress >> "$outfile.$$"; ); then