What is GRUB_ENABLE_BLSCFG in /etc/default/grub?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9
  • Red Hat Enterprise Linux 10
  • GRUB 2

Issue

  • After upgrading to RHEL 8 from RHEL 7, GRUB_ENABLE_BLSCFG=true was added in /etc/default/grub file.
  • What if I delete GRUB_ENABLE_BLSCFG=true from /etc/default/grub file?

Resolution

  • With GRUB_ENABLE_BLSCFG=true in /etc/default/grub, GRUB2 uses blscfg files and entries in /boot/loader instead of menuentry entries in grub.cfg. It's the standard configuration since RHEL 8.
  • On RHEL 8, if GRUB_ENABLE_BLSCFG is removed or set to "false", grub.cfg generated by grub2-mkconfig will define the menu entries just as RHEL 7.
  • The default value of GRUB_ENABLE_BLSCFG is "true" on RHEL 9. Deleting GRUB_ENABLE_BLSCFG=true from /etc/default/grub won't disable BLS. User has to set GRUB_ENABLE_BLSCFG=false to disable BLS.
  • Note On RHEL 8, grub2-mkconfig is never run on kernel upgrade even if GRUB_ENABLE_BLSCFG=false, user has to run grub2-mkconfig after upgrading kernel. The issue is fixed in RHSA-2022:2110.
  • Note On RHEL 8, when GRUB_ENABLE_BLSCFG is not set in /etc/default/grub, grub2-mkconfig is never run on kernel upgrade. User has to run grub2-mkconfig after upgrading kernel.

Diagnostic Steps

Disable BLS:

# grep BLS /etc/default/grub
GRUB_ENABLE_BLSCFG=false
# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.14.0-42.el9.x86_64
Found initrd image: /boot/initramfs-5.14.0-42.el9.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-6c50dcebbd4843e89cd5bfb715c156a4
Found initrd image: /boot/initramfs-0-rescue-6c50dcebbd4843e89cd5bfb715c156a4.img
Adding boot menu entry for UEFI Firmware Settings ...
done
# grep ^menuent /boot/grub2/grub.cfg | awk -F\' '{ print $2 }'
Red Hat Enterprise Linux (5.14.0-42.el9.x86_64) 9.0 (Plow)     
Red Hat Enterprise Linux (0-rescue-6c50dcebbd4843e89cd5bfb715c156a4) 9.0 (Plow)

Enable BLS:

# grep BLS /etc/default/grub
GRUB_ENABLE_BLSCFG=true
# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Adding boot menu entry for UEFI Firmware Settings ...
done
# grep ^menuent /boot/grub2/grub.cfg | awk -F\' '{ print $2 }'
#                                       <== nothing output
SBR
Components

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.