x86: add intel microcode entries to grub config
[openwrt/staging/chunkeey.git] / target / linux / x86 / base-files / lib / preinit / 02_load_x86_ucode
index fb309c75c115c16436209f0f69df0c3f491bd19e..d3a23e24b231b52ddf16cf3cbc722a5c7c2400de 100644 (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
 }