x86: add intel microcode entries to grub config

Create initrd enries for x86 images, that'll load intel microcode as
early as possible. To achieve that the test module for grub is enabled
which provides shell-like conditionals. Also restrict the late load of
microcode to AMD processors.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
This commit is contained in:
Tomasz Maciej Nowak
2018-11-20 17:20:43 +01:00
committed by John Crispin
parent ad83fde30d
commit 546fced2a2
4 changed files with 12 additions and 4 deletions

View File

@@ -2,8 +2,10 @@
# Copyright (C) 2018 OpenWrt.org
do_load_x86_ucode() {
if [ -e "/sys/devices/system/cpu/microcode/reload" ]; then
echo 1 > /sys/devices/system/cpu/microcode/reload
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
}