x86: add amd microcode entries to grub config

Create initrd enries for x86 images, that'll load amd microcode as early
as possible. Also remove the preinit script responsible for late load of
microcode.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
master
Tomasz Maciej Nowak 6 years ago committed by John Crispin
parent 946ffe470d
commit a822283c7e
  1. 12
      target/linux/x86/base-files/lib/preinit/02_load_x86_ucode
  2. 9
      target/linux/x86/image/grub-iso.cfg
  3. 9
      target/linux/x86/image/grub.cfg

@ -1,12 +0,0 @@
#!/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

@ -7,7 +7,12 @@ set root='(cd)'
menuentry "@TITLE@" { menuentry "@TITLE@" {
linux /boot/vmlinuz @CMDLINE@ noinitrd linux /boot/vmlinuz @CMDLINE@ noinitrd
if [ -s /boot/intel-ucode.img ]; then set amd="/boot/amd-ucode.img"
initrd /boot/intel-ucode.img set intel="/boot/intel-ucode.img"
if [ -s "$amd" ]; then
initrd $amd $intel
fi
if [ -s "$intel" ]; then
initrd $intel $amd
fi fi
} }

@ -7,8 +7,13 @@ set root='(@ROOT@)'
menuentry "@TITLE@" { menuentry "@TITLE@" {
linux /boot/vmlinuz @CMDLINE@ noinitrd linux /boot/vmlinuz @CMDLINE@ noinitrd
if [ -s /boot/intel-ucode.img ]; then set amd="/boot/amd-ucode.img"
initrd /boot/intel-ucode.img set intel="/boot/intel-ucode.img"
if [ -s "$amd" ]; then
initrd $amd $intel
fi
if [ -s "$intel" ]; then
initrd $intel $amd
fi fi
} }
menuentry "@TITLE@ (failsafe)" { menuentry "@TITLE@ (failsafe)" {

Loading…
Cancel
Save