67f07b7
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
67f07b7
From: Javier Martinez Canillas <javierm@redhat.com>
67f07b7
Date: Thu, 17 Jun 2021 14:31:42 +0200
67f07b7
Subject: [PATCH] Don't update the cmdline when generating legacy menuentry
67f07b7
 commands
67f07b7
67f07b7
On OPAL ppc64le machines with an old petitboot version that doesn't have
67f07b7
support to parse BLS snippets, the grub2-mkconfig script is executed to
67f07b7
generate menuentry commands from the BLS snippets.
67f07b7
67f07b7
In this case, the script is executed with the --no-grubenv-update option
67f07b7
that indicates that no side effects should happen when running the script.
67f07b7
67f07b7
But the options field in the BLS snippets are updated regardless, only do
67f07b7
the update if --no-grubenv-update was not used.
67f07b7
67f07b7
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
67f07b7
---
67f07b7
 util/grub.d/10_linux.in | 4 +++-
67f07b7
 1 file changed, 3 insertions(+), 1 deletion(-)
67f07b7
67f07b7
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
e622855
index c02c1f0820..6af84b44e1 100644
67f07b7
--- a/util/grub.d/10_linux.in
67f07b7
+++ b/util/grub.d/10_linux.in
3e40727
@@ -256,7 +256,9 @@ if [ -z "\${kernelopts}" ]; then
67f07b7
 fi
67f07b7
 EOF
67f07b7
 
67f07b7
-  update_bls_cmdline
67f07b7
+  if [ "x${GRUB_GRUBENV_UPDATE}" = "xyes" ]; then
67f07b7
+      update_bls_cmdline
67f07b7
+  fi
67f07b7
 
67f07b7
   if [ "x${BLS_POPULATE_MENU}" = "xtrue" ]; then
67f07b7
       populate_menu