From 8ead5a735df6b999c8853f0bdad81164b1a0917b Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 27 Nov 2018 18:58:35 +0100 Subject: [PATCH] Revert "x86: add amd microcode entries to grub config" This reverts commit a822283c7e56bb3b409712e0eb9af5a91aac247d. Signed-off-by: John Crispin --- .../x86/base-files/lib/preinit/02_load_x86_ucode | 12 ++++++++++++ target/linux/x86/image/grub-iso.cfg | 9 ++------- target/linux/x86/image/grub.cfg | 9 ++------- 3 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 target/linux/x86/base-files/lib/preinit/02_load_x86_ucode diff --git a/target/linux/x86/base-files/lib/preinit/02_load_x86_ucode b/target/linux/x86/base-files/lib/preinit/02_load_x86_ucode new file mode 100644 index 0000000000..d3a23e24b2 --- /dev/null +++ b/target/linux/x86/base-files/lib/preinit/02_load_x86_ucode @@ -0,0 +1,12 @@ +#!/bin/sh +# Copyright (C) 2018 OpenWrt.org + +do_load_x86_ucode() { + if grep -q AuthenticAMD /proc/cpuinfo; then + if [ -e "/sys/devices/system/cpu/microcode/reload" ]; then + echo 1 > /sys/devices/system/cpu/microcode/reload + fi + fi +} + +boot_hook_add preinit_main do_load_x86_ucode diff --git a/target/linux/x86/image/grub-iso.cfg b/target/linux/x86/image/grub-iso.cfg index c624cbe0ee..5d128aa3aa 100644 --- a/target/linux/x86/image/grub-iso.cfg +++ b/target/linux/x86/image/grub-iso.cfg @@ -7,12 +7,7 @@ set root='(cd)' menuentry "@TITLE@" { linux /boot/vmlinuz @CMDLINE@ noinitrd - set amd="/boot/amd-ucode.img" - set intel="/boot/intel-ucode.img" - if [ -s "$amd" ]; then - initrd $amd $intel - fi - if [ -s "$intel" ]; then - initrd $intel $amd + if [ -s /boot/intel-ucode.img ]; then + initrd /boot/intel-ucode.img fi } diff --git a/target/linux/x86/image/grub.cfg b/target/linux/x86/image/grub.cfg index 21d719261b..a665686863 100644 --- a/target/linux/x86/image/grub.cfg +++ b/target/linux/x86/image/grub.cfg @@ -7,13 +7,8 @@ set root='(@ROOT@)' menuentry "@TITLE@" { linux /boot/vmlinuz @CMDLINE@ noinitrd - set amd="/boot/amd-ucode.img" - set intel="/boot/intel-ucode.img" - if [ -s "$amd" ]; then - initrd $amd $intel - fi - if [ -s "$intel" ]; then - initrd $intel $amd + if [ -s /boot/intel-ucode.img ]; then + initrd /boot/intel-ucode.img fi } menuentry "@TITLE@ (failsafe)" {