Blob Blame History Raw
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Mon, 13 Jan 2020 15:44:42 +0100
Subject: [PATCH] 10_linux.in: Also use GRUB_CMDLINE_LINUX_DEFAULT to set
 kernelopts

The GRUB documentation mentions that there are two variables to set the
linux kernel cmdline: GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT.

The former is added to all the menuentry commands and the latter is not
added to the recovery mode menu entries. But the blscfg module doesn't
populate recovery entries from the BLS snippets, so the values set in the
GRUB_CMDLINE_LINUX_DEFAULT variable should also be included in kernelopts.

This is needed because the GRUB_CMDLINE_LINUX_DEFAULT option is mentioned
in the GRUB documentation so users assume that the kernel cmdline options
can be changed by setting this option and running the grub2-mkconfig tool.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
 util/grub.d/10_linux.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 350903fa5ab..79b028b6155 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -158,7 +158,7 @@ linux_entry ()
     populate_header_warn
 
     cat << EOF
-set default_kernelopts="root=${linux_root_device_thisversion} ro ${args}"
+set default_kernelopts="root=${linux_root_device_thisversion} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
 
 insmod blscfg
 blscfg
@@ -174,7 +174,7 @@ EOF
             fi
         fi
 
-	${grub_editenv} - set kernelopts="root=${linux_root_device_thisversion} ro ${args}"
+	${grub_editenv} - set kernelopts="root=${linux_root_device_thisversion} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
 	if [ -n "${GRUB_EARLY_INITRD_LINUX_CUSTOM}" ]; then
 	    ${grub_editenv} - set early_initrd="${GRUB_EARLY_INITRD_LINUX_CUSTOM}"
 	fi