Create initrd enries for x86 images, that'll load amd microcode as early
as possible. Also remove the preinit script responsible for late load of
microcode.
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
+++ /dev/null
-#!/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
menuentry "@TITLE@" {
linux /boot/vmlinuz @CMDLINE@ noinitrd
- if [ -s /boot/intel-ucode.img ]; then
- initrd /boot/intel-ucode.img
+ set amd="/boot/amd-ucode.img"
+ set intel="/boot/intel-ucode.img"
+ if [ -s "$amd" ]; then
+ initrd $amd $intel
+ fi
+ if [ -s "$intel" ]; then
+ initrd $intel $amd
fi
}
menuentry "@TITLE@" {
linux /boot/vmlinuz @CMDLINE@ noinitrd
- if [ -s /boot/intel-ucode.img ]; then
- initrd /boot/intel-ucode.img
+ set amd="/boot/amd-ucode.img"
+ set intel="/boot/intel-ucode.img"
+ if [ -s "$amd" ]; then
+ initrd $amd $intel
+ fi
+ if [ -s "$intel" ]; then
+ initrd $intel $amd
fi
}
menuentry "@TITLE@ (failsafe)" {