[devel-distro] [PATCH 3/4] sub.in/stage2/scripts: add microcode update trigger

Konstantin A. Lepikhov lakostis at altlinux.ru
Tue Jul 5 17:24:46 MSK 2016


We need to run this during boot because nobody cares about this now.
Right way is early microcode update but latter possible only on standalone
configuration not install/live target.
---
 sub.in/stage2/image-scripts.d/99-microcode-update | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 sub.in/stage2/image-scripts.d/99-microcode-update

diff --git a/sub.in/stage2/image-scripts.d/99-microcode-update b/sub.in/stage2/image-scripts.d/99-microcode-update
new file mode 100644
index 0000000..48f8500
--- /dev/null
+++ b/sub.in/stage2/image-scripts.d/99-microcode-update
@@ -0,0 +1,23 @@
+#!/bin/sh -e
+# initiate CPU microcode update on boot
+
+cat << EOF > /usr/local/sbin/microcode_update
+#!/bin/sh -e
+echo 1 > /sys/devices/system/cpu/microcode/reload
+EOF
+chmod +x /usr/local/sbin/microcode_update
+
+cat << EOF > /etc/systemd/system/microcode.service
+[Unit]
+Description=Reload CPU microcode
+
+[Service]
+ExecStart=/usr/local/sbin/microcode_update
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=default.target
+EOF
+
+systemctl enable microcode.service
-- 
2.7.4



More information about the devel-distro mailing list