You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

62 lines
1.9 KiB

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