Blame SOURCES/0394-Disable-early-microcode-for-non-x86-architecures.patch

a0a3b4
From ced0638e2c0d8805551b1153b9e153241c646262 Mon Sep 17 00:00:00 2001
a0a3b4
From: Harald Hoyer <harald@redhat.com>
a0a3b4
Date: Wed, 29 Jun 2016 10:45:22 +0200
a0a3b4
Subject: [PATCH] Disable early microcode for non-x86 architecures
a0a3b4
a0a3b4
---
a0a3b4
 dracut.sh | 28 +++++++++++++++++++++-------
a0a3b4
 1 file changed, 21 insertions(+), 7 deletions(-)
a0a3b4
a0a3b4
diff --git a/dracut.sh b/dracut.sh
1755ca
index 6bbde70b..b85d42dd 100755
a0a3b4
--- a/dracut.sh
a0a3b4
+++ b/dracut.sh
a0a3b4
@@ -819,13 +819,6 @@ readonly initdir="$(mktemp --tmpdir="$TMPDIR/" -d -t initramfs.XXXXXX)"
a0a3b4
     exit 1
a0a3b4
 }
a0a3b4
 
a0a3b4
-if [[ $early_microcode = yes ]] || ( [[ $acpi_override = yes ]] && [[ -d $acpi_table_dir ]] ); then
a0a3b4
-    readonly early_cpio_dir="$(mktemp --tmpdir="$TMPDIR/" -d -t early_cpio.XXXXXX)"
a0a3b4
-    [ -d "$early_cpio_dir" ] || {
a0a3b4
-        printf "%s\n" "dracut: mktemp --tmpdir=\"$TMPDIR/\" -d -t early_cpio.XXXXXX failed." >&2
a0a3b4
-        exit 1
a0a3b4
-    }
a0a3b4
-fi
a0a3b4
 # clean up after ourselves no matter how we die.
a0a3b4
 trap '
a0a3b4
     ret=$?;
a0a3b4
@@ -879,6 +872,26 @@ fi
a0a3b4
 dracutfunctions=$dracutbasedir/dracut-functions.sh
a0a3b4
 export dracutfunctions
a0a3b4
 
a0a3b4
+
a0a3b4
+
a0a3b4
+case "$(arch)" in
a0a3b4
+    i686|x86_64)
a0a3b4
+        ;;
a0a3b4
+    *)
a0a3b4
+        early_microcode=no
a0a3b4
+        dinfo "Disabling early microcode for $(arch)"
a0a3b4
+        ;;
a0a3b4
+esac
a0a3b4
+
a0a3b4
+if [[ $early_microcode = yes ]] || ( [[ $acpi_override = yes ]] && [[ -d $acpi_table_dir ]] ); then
a0a3b4
+    readonly early_cpio_dir="$(mktemp --tmpdir="$TMPDIR/" -d -t early_cpio.XXXXXX)"
a0a3b4
+    [ -d "$early_cpio_dir" ] || {
a0a3b4
+        printf "%s\n" "dracut: mktemp --tmpdir=\"$TMPDIR/\" -d -t early_cpio.XXXXXX failed." >&2
a0a3b4
+        exit 1
a0a3b4
+    }
a0a3b4
+fi
a0a3b4
+
a0a3b4
+
a0a3b4
 if (( ${#drivers_l[@]} )); then
a0a3b4
     drivers=''
a0a3b4
     while pop drivers_l val; do
a0a3b4
@@ -1470,6 +1483,7 @@ if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
a0a3b4
 
a0a3b4
     dinfo "*** Stripping files done ***"
a0a3b4
 fi
a0a3b4
+
a0a3b4
 if [[ $early_microcode = yes ]]; then
a0a3b4
     dinfo "*** Generating early-microcode cpio image ***"
a0a3b4
     ucode_dir=(amd-ucode intel-ucode)