From d8b3b9c701e76a49f872f8de1f1572d6ed04a064 Mon Sep 17 00:00:00 2001 From: Leo Sandoval Date: Wed, 23 Apr 2025 13:27:15 -0600 Subject: [PATCH] Don't try to switch to a BLS config if GRUB_ENABLE_BLSCFG is already set There's no point on executing the script if GRUB_ENABLE_BLSCFG has already been set. Commit taken (see below) and modified from rhel-10-branch but adopted for rhel-8-main branch. 298aa12e * Only execute grub2-switch-to-blscfg if GRUB_ENABLE_BLSCFG isn't set Resolves: #RHEL-86913 Signed-off-by: Leo Sandoval --- grub2.spec | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/grub2.spec b/grub2.spec index 112d5c1..dd560c7 100644 --- a/grub2.spec +++ b/grub2.spec @@ -7,7 +7,7 @@ Name: grub2 Epoch: 1 Version: 2.02 -Release: 165%{?dist} +Release: 166%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base License: GPLv3+ @@ -307,7 +307,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 @@ -523,6 +526,10 @@ fi %endif %changelog +* 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 - Resolves: #RHEL-86553