From efe1183890339a2a01698279fb81ad67a79e1eca Mon Sep 17 00:00:00 2001 From: Nicolas Frayer Date: Tue, 29 Aug 2023 16:51:00 +0200 Subject: [PATCH] grub2-mkconfig: Pass all boot params when used by anaconda Resolves: #RHEL-2185 Signed-off-by: Nicolas Frayer --- ...ass-all-boot-params-when-used-by-ana.patch | 37 +++++++++++++++++++ grub.patches | 1 + grub2.spec | 6 ++- 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 0328-grub2-mkconfig-Pass-all-boot-params-when-used-by-ana.patch diff --git a/0328-grub2-mkconfig-Pass-all-boot-params-when-used-by-ana.patch b/0328-grub2-mkconfig-Pass-all-boot-params-when-used-by-ana.patch new file mode 100644 index 00000000..e74d3c67 --- /dev/null +++ b/0328-grub2-mkconfig-Pass-all-boot-params-when-used-by-ana.patch @@ -0,0 +1,37 @@ +From f4f134582912851628e15df4963b3b8a6652aa26 Mon Sep 17 00:00:00 2001 +From: Marta Lewandowska +Date: Tue, 29 Aug 2023 16:40:47 +0200 +Subject: [PATCH] grub2-mkconfig: Pass all boot params when used by anaconda + +Previous patch makes it so that the machine can boot, but not all +boot params are passed from /etc/default/grub to BLS snippets +because /etc/default/grub gets written by anaconda during boot +loader installation, long after grub rpms first got installed. + +Signed-off-by: Marta Lewandowska +--- + util/grub.d/10_linux.in | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 76fc21fb6528..041a11529588 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -265,9 +265,11 @@ if [ -z "\${kernelopts}" ]; then + fi + EOF + +- if [ "x${GRUB_UPDATE_BLS_CMDLINE}" = "xyes" ] || \ +- ( [ -w /etc/kernel ] && [[ ! -f /etc/kernel/cmdline ]] && \ +- [ "x${GRUB_GRUBENV_UPDATE}" = "xyes" ] ); then ++ if [ "x${GRUB_UPDATE_BLS_CMDLINE}" = "xyes" ] || [[ -d /run/install ]]; then ++ # only update the bls cmdline if the user specifically requests it or _anytime_ ++ # in the installer environment: /run/install directory only exists during the ++ # installation and not in cloud images, so this should get all the boot params ++ # from /etc/default/grub into BLS snippets + update_bls_cmdline + fi + +-- +2.41.0 + diff --git a/grub.patches b/grub.patches index 2f47a840..38f43d8b 100644 --- a/grub.patches +++ b/grub.patches @@ -325,3 +325,4 @@ Patch0324: 0324-kern-ieee1275-init-Convert-plain-numbers-to-constant.patch Patch0325: 0325-kern-ieee1275-init-Extended-support-in-Vec5.patch Patch0326: 0326-efi-http-change-uint32_t-to-uintn_t.patch Patch0327: 0327-grub-mkconfig-dont-overwrite-BLS-cmdline-if-BLSCFG.patch +Patch0328: 0328-grub2-mkconfig-Pass-all-boot-params-when-used-by-ana.patch diff --git a/grub2.spec b/grub2.spec index b2e64d86..c0d364bd 100644 --- a/grub2.spec +++ b/grub2.spec @@ -16,7 +16,7 @@ Name: grub2 Epoch: 1 Version: 2.06 -Release: 69%{?dist} +Release: 70%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -533,6 +533,10 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg %endif %changelog +* Tue Aug 29 2023 Nicolas Frayer - 2.06-70 +- grub2-mkconfig: Pass all boot params when used by anaconda +- Resolves: #RHEL-2185 + * Thu Aug 24 2023 Nicolas Frayer - 2.06-69 - grub2-mkconfig: dont overwrite BLS cmdline if BLSCFG is true - This is an updated version of the 2.06-67 patch