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

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