diff --git a/99-grub-mkconfig.install b/99-grub-mkconfig.install index 57e2cd21e0e388dd12585da1e6c1e1392bce79a9..473636763720b1583220e8c3f3c38b97f65716dd 100755 --- a/99-grub-mkconfig.install +++ b/99-grub-mkconfig.install @@ -8,9 +8,19 @@ ARCH=$(uname -m) [[ -f /etc/default/grub ]] && . /etc/default/grub -# Can't assume a BLS capable bootloader on ppc64 -if [[ x$GRUB_ENABLE_BLSCFG = xtrue && - $ARCH != "ppc64" && $ARCH != "ppc64le" ]]; then +# Assume GRUB_ENABLE_BLSCFG is true if +# GRUB_ENABLE_BLSCFG is not set, e.g. /etc/default/grub does not exist +# GRUB_ENABLE_BLSCFG is set to true +if [[ x$GRUB_ENABLE_BLSCFG != xfalse ]]; then + # Can't assume a BLS capable bootloader on ppc64 + if [[ $ARCH = "ppc64" || $ARCH = "ppc64le" ]]; then + RUN_MKCONFIG="true" + fi +fi + +# A traditional grub configuration file needs to be generated only in the case when +# the bootloaders are not capable of populating a menu entry from the BLS fragments. +if [[ $RUN_MKCONFIG != "true" ]]; then exit 0 fi diff --git a/grub2.spec b/grub2.spec index 38301695793dbbb932a32da52bf7560e9690d211..a0c8baec75e424061dc1014726171816dd2d05d4 100644 --- a/grub2.spec +++ b/grub2.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.2 +%define anolis_release .0.1 %undefine _hardened_build %global tarversion 2.02 @@ -12,7 +12,7 @@ Name: grub2 Epoch: 1 Version: 2.02 -Release: 165%{anolis_release}%{?dist} +Release: 167%{anolis_release}%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base License: GPLv3+ @@ -320,7 +320,10 @@ if [ "$1" = 1 ]; then fi if [ "$1" = 2 ]; then - /sbin/grub2-switch-to-blscfg --backup-suffix=.rpmsave &>/dev/null || : + if [ -f /etc/default/grub ]; then + ! grep -q '^GRUB_ENABLE_BLSCFG=.*' /etc/default/grub && \ + /sbin/grub2-switch-to-blscfg --backup-suffix=.rpmsave &>/dev/null || : + fi fi %posttrans common @@ -536,10 +539,7 @@ fi %endif %changelog -* Tue May 27 2025 happy_orange - 2.02-165.0.2 -- fix the tdx error in grub2 - -* Wed Apr 30 2025 Bo Ren - 2.02-165.0.1 +* Mon Sep 15 2025 Bo Ren - 2.02-167.0.1 - Build pc-modules package on x86_64 (geliwei@openanolis.org) - Add loongarch64 base support (zhangwenlong@loongson.cn)(chenguoqi@loongson.cn) - Fix a bug in bls_make_list, blscfg. (zhonglingh@linux.alibaba.com) @@ -549,6 +549,15 @@ fi - Remove dtb dir with correct argument (Liwei Ge) - Support use confidential computing provisioned secrets for disk decryption(hanliyang@hygon.cn) - Update for loongarch64 in sync with latest v2.04(liuxue@loongson.cn) +- fix the tdx error in grub2 + +* Thu Apr 24 2025 Leo Sandoval - 2.02-167 +- 99-grub-mkconfig.install: fix condition allowing correct checks if GRUB_ENABLE_BLSCFG is not present +- Resolves: #RHEL-80168 + +* Wed Apr 23 2025 Leo Sandoval - 2.02-166 +- Don't try to switch to a BLS config if GRUB_ENABLE_BLSCFG is already set +- Resolves: #RHEL-86913 * Thu Apr 17 2025 Nicolas Frayer - 2.02-165 - fs/ext2: Rework of OOB read patch