remove microcode check based on CONFIG_MICROCODE_[AMD|INTEL]

This commit is contained in:
wangyuhang 2024-04-18 10:45:28 +08:00
parent 0a79a12214
commit b43e6bf42a
2 changed files with 54 additions and 1 deletions

View File

@ -0,0 +1,48 @@
From 6c80408c8644a0add1907b0593eb83f90d6247b1 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Mon, 14 Aug 2023 12:28:11 +0200
Subject: [PATCH] fix(dracut.sh): remove microcode check based on
CONFIG_MICROCODE_[AMD|INTEL]
`CONFIG_MICROCODE_AMD` and `CONFIG_MICROCODE_INTEL` are hidden since
https://lore.kernel.org/all/20230810160805.081212701@linutronix.de/, therefore
this check is wrong and early microcode is always disabled.
---
dracut.sh | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index e0abdb3b..3b292910 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1561,23 +1561,20 @@ fi
if [[ $early_microcode == yes ]]; then
if [[ $hostonly ]]; then
- if [[ $(get_cpu_vendor) == "AMD" ]]; then
- check_kernel_config CONFIG_MICROCODE_AMD || unset early_microcode
- elif [[ $(get_cpu_vendor) == "Intel" ]]; then
- check_kernel_config CONFIG_MICROCODE_INTEL || unset early_microcode
+ if [[ $(get_cpu_vendor) == "AMD" || $(get_cpu_vendor) == "Intel" ]]; then
+ check_kernel_config CONFIG_MICROCODE || unset early_microcode
else
unset early_microcode
fi
else
- ! check_kernel_config CONFIG_MICROCODE_AMD \
- && ! check_kernel_config CONFIG_MICROCODE_INTEL \
+ ! check_kernel_config CONFIG_MICROCODE \
&& unset early_microcode
fi
# Do not complain on non-x86 architectures as it makes no sense
case "${DRACUT_ARCH:-$(uname -m)}" in
x86_64 | i?86)
[[ $early_microcode != yes ]] \
- && dwarn "Disabling early microcode, because kernel does not support it. CONFIG_MICROCODE_[AMD|INTEL]!=y"
+ && dwarn "Disabling early microcode, because kernel does not support it. CONFIG_MICROCODE!=y"
;;
*) ;;
esac
--
2.33.0

View File

@ -9,7 +9,7 @@
Name: dracut Name: dracut
Version: 059 Version: 059
Release: 4 Release: 6
Summary: Initramfs generator using udev Summary: Initramfs generator using udev
@ -38,6 +38,8 @@ Patch11: backport-fix-fs-lib-remove-quoting-form-the-first-argument-of.patch
# Unbreak systemd 255 # Unbreak systemd 255
Patch12: backport-feat-systemd-install-systemd-executor.patch Patch12: backport-feat-systemd-install-systemd-executor.patch
Patch6000: backport-fix-dracut.sh-remove-microcode-check-based-on-CONFIG.patch
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
Source2: openEuler.conf.example Source2: openEuler.conf.example
@ -525,6 +527,9 @@ rm -f 51-dracut-rescue-postinst.sh
%endif %endif
%changelog %changelog
* Thu Apr 18 2024 wangyuhang <wangyuhang27@huawei.com> - 059-6
- Backport patches to remove microcode check based on CONFIG_MICROCODE_[AMD|INTEL]
* Mon Jan 22 2024 huyubiao <huyubiao@huawei.com> - 059-5 * Mon Jan 22 2024 huyubiao <huyubiao@huawei.com> - 059-5
- Backport patches to fix compatibility with systemd 255 - Backport patches to fix compatibility with systemd 255