From c9f3b1b231dd7fda29b1ddeca140634d5572fe2c Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Tue, 5 Mar 2024 07:07:34 +1300 Subject: [PATCH] Call grub2-mkconfig with --update-bls-cmdline Recent versions of redhat grub2-mkconfig no longer automatically update kernel arguments in BLS entries[1]. This change optionally adds the --update-bls-cmdline argument where supported so this previous behaviour continues to work. [1] https://pkgs.devel.redhat.com/cgit/rpms/grub2/tree/0327-grub-mkconfig-dont-overwrite-BLS-cmdline-if-BLSCFG.patch?h=rhel-9.3.0 Change-Id: I568c34ef9b00b3a4e28ae13e013018fd6cedafa2 --- .../elements/bootloader/finalise.d/50-bootloader | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/diskimage_builder/elements/bootloader/finalise.d/50-bootloader b/diskimage_builder/elements/bootloader/finalise.d/50-bootloader index 4fe58968e..0786154bc 100755 --- a/diskimage_builder/elements/bootloader/finalise.d/50-bootloader +++ b/diskimage_builder/elements/bootloader/finalise.d/50-bootloader @@ -57,6 +57,11 @@ if [[ ! $($GRUBNAME --version) =~ ' 2.' ]]; then exit 1 fi +# Ensure BLS entries are updated with default args +if [[ $($GRUB_MKCONFIG --help) =~ '--update-bls-cmdline' ]]; then + GRUB_MKCONFIG="$GRUB_MKCONFIG --update-bls-cmdline" +fi + # Some distros keep things in /boot/grub2, others in /boot/grub if [ -d /boot/grub2 ]; then GRUB_CFG=/boot/grub2/grub.cfg