x86: add preinit hook to reload microcode
authorZoltan HERPAI <wigyori@uid0.hu>
Sat, 10 Feb 2018 18:16:37 +0000 (19:16 +0100)
committerZoltan HERPAI <wigyori@uid0.hu>
Sun, 11 Feb 2018 13:39:24 +0000 (14:39 +0100)
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
target/linux/x86/base-files/lib/preinit/02_load_x86_ucode [new file with mode: 0644]

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 (file)
index 0000000..fb309c7
--- /dev/null
@@ -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