Bug 2068422

Summary: Default value for GRUB_ENABLE_BLSCFG is not correctly handled
Product: Red Hat Enterprise Linux 8 Reporter: Renaud Métrich <rmetrich>
Component: grub2Assignee: Bootloader engineering team <bootloader-eng-team>
Status: NEW --- QA Contact: Release Test Team <release-test-team>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.5CC: pjanda, raravind, sbarcomb
Target Milestone: rcKeywords: TestCaseNeeded
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Renaud Métrich 2022-03-25 09:20:07 UTC
Description of problem:

When not specifying GRUB_ENABLE_BLSCFG at all in `/etc/default/grub`, I would assume it defaults to either "true" or "false" but it appears no proper default is considered, which causes the Grub menu to not be updated upon updating the kernel.

When updating the kernel, the following operations are performed:

1. /usr/lib/kernel/install.d/20-grub.install executes, which creates the BLS entries

2. /usr/lib/kernel/install.d/99-grub-mkconfig.install executes

  This script checks if x$GRUB_ENABLE_BLSCFG!=xfalse and in such case, does nothing.
  Otherwise it calls grub2-mkconfig.

  This is an issue if GRUB_ENABLE_BLSCFG is not set (hence condition evaluate to true) because the grub2-mkconfig will not execute, keeping the old menu (not using BLS) in place.


Version-Release number of selected component (if applicable):

grub2-common-2.02-122.el8


How reproducible:

Always

Steps to Reproduce:
1. Remove GRUB_ENABLE_BLSCFG from /etc/default/grub
2. Rebuild the Grub menu through using the kernel post-install operation

  # KERNEL_INSTALL_MACHINE_ID=29542a35af3c4f41b05de03513f1d85e bash -x /usr/lib/kernel/install.d/99-grub-mkconfig.install add

Actual results:

+ [[ -n 29542a35af3c4f41b05de03513f1d85e ]]
++ uname -m
+ ARCH=x86_64
+ [[ -f /etc/default/grub ]]
+ . /etc/default/grub
+++ sed 's, release .*$,,g' /etc/system-release
++ GRUB_DISTRIBUTOR='Red Hat Enterprise Linux'
++ GRUB_DEFAULT=saved
++ GRUB_DISABLE_SUBMENU=true
++ GRUB_DISABLE_RECOVERY=true
++ GRUB_TIMEOUT=5
++ GRUB_TERMINAL_OUTPUT='serial console'
++ GRUB_TERMINAL='serial console'
++ GRUB_SERIAL_COMMAND='serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1'
++ GRUB_CMDLINE_LINUX='crashkernel=auto rd.lvm.lv=rhel/root console=tty0 console=ttyS0,115200n8 resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/swap fips=0 boot=UUID=17c2c80a-afad-4b64-a31b-55b21ced3740'
++ GRUB_INITRD_OVERLAY='$tuned_initrd'
+ [[ x != xfalse ]]
+ [[ x86_64 != \p\p\c\6\4 ]]
+ [[ x86_64 != \p\p\c\6\4\l\e ]]
+ exit 0

--> no grub2-config executed because of "[[ x != xfalse ]]" test returning True.

Expected results:

grub2-mkconfig executed

Comment 1 raravind 2023-03-23 15:08:50 UTC
Hello Renaud,

So On RHEL 8, grub2-mkconfig is never run on kernel upgrade even if GRUB_ENABLE_BLSCFG=false[if GRUB_ENABLE_BLSCFG is removed, its entry is assumed FALSE right)?
https://access.redhat.com/solutions/6929571.