aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/x86/base-files
diff options
context:
space:
mode:
authorTomasz Maciej Nowak <tomek_n@o2.pl>2018-11-20 17:20:43 +0100
committerJohn Crispin <john@phrozen.org>2018-11-26 12:05:44 +0100
commit546fced2a23557e95dd34246744c3aa6cad92fe6 (patch)
treeb74e0145b0ae6db0f770da2acae64eb6d2a34143 /target/linux/x86/base-files
parentad83fde30de5d154bf723d0fd07f945a8cdb6510 (diff)
downloadupstream-546fced2a23557e95dd34246744c3aa6cad92fe6.tar.gz
upstream-546fced2a23557e95dd34246744c3aa6cad92fe6.tar.bz2
upstream-546fced2a23557e95dd34246744c3aa6cad92fe6.zip
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>
Diffstat (limited to 'target/linux/x86/base-files')
-rw-r--r--target/linux/x86/base-files/lib/preinit/02_load_x86_ucode6
1 files changed, 4 insertions, 2 deletions
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
index fb309c75c1..d3a23e24b2 100644
--- a/target/linux/x86/base-files/lib/preinit/02_load_x86_ucode
+++ b/target/linux/x86/base-files/lib/preinit/02_load_x86_ucode
@@ -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
}