fgrose / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone
d3ceae4
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
d3ceae4
From: Javier Martinez Canillas <javierm@redhat.com>
d3ceae4
Date: Tue, 15 Oct 2019 09:08:25 +0200
d3ceae4
Subject: [PATCH] 10_linux.in: Also use GRUB_CMDLINE_LINUX_DEFAULT to set
d3ceae4
 kernelopts
d3ceae4
d3ceae4
The GRUB documentation mentions that there are two variables to set the
d3ceae4
linux kernel cmdline: GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT.
d3ceae4
d3ceae4
The former is added to all the menuentry commands and the latter is not
d3ceae4
added to the recovery mode menu entries. But the blscfg module doesn't
d3ceae4
populate recovery entries from the BLS snippets, so the values set in the
d3ceae4
GRUB_CMDLINE_LINUX_DEFAULT variable should also be included in kernelopts.
d3ceae4
d3ceae4
This is needed because the GRUB_CMDLINE_LINUX_DEFAULT option is mentioned
d3ceae4
in the GRUB documentation so users assume that the kernel cmdline options
d3ceae4
can be changed by setting this option and running the grub2-mkconfig tool.
d3ceae4
d3ceae4
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
d3ceae4
---
d3ceae4
 util/grub.d/10_linux.in | 4 ++--
d3ceae4
 1 file changed, 2 insertions(+), 2 deletions(-)
d3ceae4
d3ceae4
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
d3ceae4
index 1520b7e47c1..0471464e68e 100644
d3ceae4
--- a/util/grub.d/10_linux.in
d3ceae4
+++ b/util/grub.d/10_linux.in
d3ceae4
@@ -118,7 +118,7 @@ if [ "x${GRUB_ENABLE_BLSCFG}" = "xtrue" ]; then
d3ceae4
   populate_header_warn
d3ceae4
 
d3ceae4
   cat << EOF
d3ceae4
-set default_kernelopts="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX}"
d3ceae4
+set default_kernelopts="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
d3ceae4
 
d3ceae4
 insmod blscfg
d3ceae4
 blscfg
d3ceae4
@@ -134,7 +134,7 @@ EOF
d3ceae4
           fi
d3ceae4
       fi
d3ceae4
 
d3ceae4
-      ${grub_editenv} - set kernelopts="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX}"
d3ceae4
+      ${grub_editenv} - set kernelopts="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
d3ceae4
       if [ -n "${GRUB_EARLY_INITRD_LINUX_CUSTOM}" ]; then
d3ceae4
           ${grub_editenv} - set early_initrd="${GRUB_EARLY_INITRD_LINUX_CUSTOM}"
d3ceae4
       fi