From 8378a93e6079d5d02275a53a100ce1fb6cd031c2 Mon Sep 17 00:00:00 2001 From: Nicolas Frayer Date: Thu, 13 Jul 2023 11:19:21 +0200 Subject: [PATCH] grub2-mkconfig: don't overwrite BLS cmdline if BLSCFG is true Resolves: #2203203 Resolves: #2212320 Resolves: #2221543 Signed-off-by: Nicolas Frayer --- ...dont-overwrite-BLS-cmdline-if-BLSCFG.patch | 72 +++++++++++++++++++ grub.patches | 1 + grub2.spec | 8 ++- 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 0327-grub-mkconfig-dont-overwrite-BLS-cmdline-if-BLSCFG.patch diff --git a/0327-grub-mkconfig-dont-overwrite-BLS-cmdline-if-BLSCFG.patch b/0327-grub-mkconfig-dont-overwrite-BLS-cmdline-if-BLSCFG.patch new file mode 100644 index 00000000..080374ff --- /dev/null +++ b/0327-grub-mkconfig-dont-overwrite-BLS-cmdline-if-BLSCFG.patch @@ -0,0 +1,72 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Marta Lewandowska +Date: Mon, 17 Jul 2023 16:03:39 -0400 +Subject: [PATCH] grub-mkconfig dont overwrite BLS cmdline if BLSCFG + +If GRUB_ENABLE_BLSCFG is true, running grub2-mkconfig will not +overwrite kernel cmdline in BLS snippets with what is in +GRUB_CMDLINE_LINUX in /etc/default/grub. Update can be forced by +sending new arg --update-bls-cmdline, thus decoupling cmdline +updates from updates of other parameters. GRUB_GRUBENV_UPDATE +remains 'yes' by default. + +Signed-off-by: mkl +--- + util/grub-mkconfig.in | 9 +++++++++ + util/grub.d/10_linux.in | 2 +- + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in +index 520a672cd2c8..34f7c13fc521 100644 +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -51,6 +51,7 @@ export TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAINDIR="@localedir@" + + export GRUB_GRUBENV_UPDATE="yes" ++export GRUB_UPDATE_BLS_CMDLINE="yes" + + . "${pkgdatadir}/grub-mkconfig_lib" + +@@ -62,6 +63,7 @@ usage () { + echo + print_option_help "-o, --output=$(gettext FILE)" "$(gettext "output generated config to FILE [default=stdout]")" + print_option_help "--no-grubenv-update" "$(gettext "do not update variables in the grubenv file")" ++ print_option_help "--update-bls-cmdline" "$(gettext "overwrite BLS cmdline args with default args")" + print_option_help "-h, --help" "$(gettext "print this message and exit")" + print_option_help "-V, --version" "$(gettext "print the version information and exit")" + echo +@@ -100,6 +102,9 @@ do + --no-grubenv-update) + GRUB_GRUBENV_UPDATE="no" + ;; ++ --update-bls-cmdline) ++ bls_cmdline_update=true ++ ;; + -*) + gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2 + usage +@@ -167,6 +172,10 @@ fi + + eval "$("${grub_get_kernel_settings}")" || true + ++if [ "x${GRUB_ENABLE_BLSCFG}" = "xtrue" ] && [ "x${bls_cmdline_update}" != "xtrue" ]; then ++ GRUB_UPDATE_BLS_CMDLINE="no" ++fi ++ + if [ "x${GRUB_DISABLE_UUID}" = "xtrue" ]; then + if [ -z "${GRUB_DISABLE_LINUX_UUID}" ]; then + GRUB_DISABLE_LINUX_UUID="true" +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 4795a63b4ce6..72b75effe448 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -265,7 +265,7 @@ if [ -z "\${kernelopts}" ]; then + fi + EOF + +- if [ "x${GRUB_GRUBENV_UPDATE}" = "xyes" ]; then ++ if [ "x${GRUB_UPDATE_BLS_CMDLINE}" = "xyes" ]; then + update_bls_cmdline + fi + diff --git a/grub.patches b/grub.patches index 00743255..2f47a840 100644 --- a/grub.patches +++ b/grub.patches @@ -324,3 +324,4 @@ Patch0323: 0323-util-Enable-default-kernel-for-updates.patch 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 diff --git a/grub2.spec b/grub2.spec index 3797e247..8a33a681 100644 --- a/grub2.spec +++ b/grub2.spec @@ -16,7 +16,7 @@ Name: grub2 Epoch: 1 Version: 2.06 -Release: 66%{?dist} +Release: 67%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -533,6 +533,12 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg %endif %changelog +* Mon Jul 24 2023 Nicolas Frayer - 2.06-67 +- grub2-mkconfig: dont overwrite BLS cmdline if BLSCFG is true +- Resolves: #2203203 +- Resolves: #2212320 +- Resolves: #2221543 + * Thu Jul 20 2023 Nicolas Frayer - 2.06-66 - build with baseline ISA flags - Resolves: #2215860