aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/x86/base-files/lib
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/x86/base-files/lib')
-rw-r--r--target/linux/x86/base-files/lib/preinit/02_load_x86_ucode12
1 files changed, 12 insertions, 0 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
new file mode 100644
index 0000000000..d3a23e24b2
--- /dev/null
+++ b/target/linux/x86/base-files/lib/preinit/02_load_x86_ucode
@@ -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