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

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