aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZoltan HERPAI <wigyori@uid0.hu>2018-02-10 19:16:37 +0100
committerZoltan HERPAI <wigyori@uid0.hu>2018-03-04 17:37:15 +0100
commit571d3def6baf2047f5417182f810a689085ccbd7 (patch)
treea54897bd9acddfb33ba349a9ae260e7a2588e6e8
parent681aaaf719ecae48126ea3be0fe6e150c5ee3b31 (diff)
downloadupstream-571d3def6baf2047f5417182f810a689085ccbd7.tar.gz
upstream-571d3def6baf2047f5417182f810a689085ccbd7.tar.bz2
upstream-571d3def6baf2047f5417182f810a689085ccbd7.zip
x86: add preinit hook to reload microcode
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
-rw-r--r--target/linux/x86/base-files/lib/preinit/02_load_x86_ucode10
1 files changed, 10 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..fb309c75c1
--- /dev/null
+++ b/target/linux/x86/base-files/lib/preinit/02_load_x86_ucode
@@ -0,0 +1,10 @@
+#!/bin/sh
+# 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
+ fi
+}
+
+boot_hook_add preinit_main do_load_x86_ucode