Revert "x86: add amd microcode entries to grub config"
authorJohn Crispin <john@phrozen.org>
Tue, 27 Nov 2018 17:58:35 +0000 (18:58 +0100)
committerJohn Crispin <john@phrozen.org>
Tue, 27 Nov 2018 17:58:35 +0000 (18:58 +0100)
This reverts commit a822283c7e56bb3b409712e0eb9af5a91aac247d.

Signed-off-by: John Crispin <john@phrozen.org>
target/linux/x86/base-files/lib/preinit/02_load_x86_ucode [new file with mode: 0644]
target/linux/x86/image/grub-iso.cfg
target/linux/x86/image/grub.cfg

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 (file)
index 0000000..d3a23e2
--- /dev/null
@@ -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
index c624cbe0ee1d137e88f378b5a3832bbe9f637e45..5d128aa3aab17ec4df050479dea16e51a5d9783b 100644 (file)
@@ -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
 }
index 21d719261b1a7b03f081b2a8b5b08701cc0666d6..a665686863e230822b9ad26d43e9ffc54dcf0229 100644 (file)
@@ -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)" {