From 85c3021108d3cf4fc3d76f3e6f341c9b81d9dede Mon Sep 17 00:00:00 2001 From: Leo Sandoval Date: Thu, 24 Apr 2025 10:49:54 -0600 Subject: [PATCH] 99-grub-mkconfig.install: fix condition allowing correct checks if GRUB_ENABLE_BLSCFG is not present Resolves: #RHEL-80168 Signed-off-by: Leo Sandoval --- 99-grub-mkconfig.install | 16 +++++++++++++--- grub2.spec | 6 +++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/99-grub-mkconfig.install b/99-grub-mkconfig.install index 57e2cd2..4736367 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 dd560c7..165444f 100644 --- a/grub2.spec +++ b/grub2.spec @@ -7,7 +7,7 @@ Name: grub2 Epoch: 1 Version: 2.02 -Release: 166%{?dist} +Release: 167%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base License: GPLv3+ @@ -526,6 +526,10 @@ fi %endif %changelog +* 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