grub2/SOURCES/0579-Regenerate-kernelopts-if-missing-on-ppc.patch

37 lines
1.5 KiB
Diff
Raw Normal View History

From 8c74431327e0c7d7fe47462b0e69fcbe3bbac56e Mon Sep 17 00:00:00 2001
From: Marta Lewandowska <mlewando@redhat.com>
Date: Fri, 24 Mar 2023 09:14:29 -0400
Subject: [PATCH] Regenerate kernelopts if missing on ppc
Signed-off-by: Marta Lewandowska <mlewando@redhat.com>
---
util/grub.d/10_linux_bls.in | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/util/grub.d/10_linux_bls.in b/util/grub.d/10_linux_bls.in
index 855dbdd..f2281bc 100644
--- a/util/grub.d/10_linux_bls.in
+++ b/util/grub.d/10_linux_bls.in
@@ -117,6 +117,18 @@ cat <<EOF
# This section was generated by a script. Do not modify the generated file - all changes
# will be lost the next time file is regenerated. Instead edit the BootLoaderSpec files.
+# The kernelopts variable should be defined in the grubenv file. But to ensure that menu
+# entries populated from BootLoaderSpec files that use this variable work correctly even
+# without a grubenv file, define a fallback kernelopts variable if this has not been set.
+#
+# The kernelopts variable in the grubenv file can be modified using the grubby tool or by
+# executing the grub2-mkconfig tool. For the latter, the values of the GRUB_CMDLINE_LINUX
+# and GRUB_CMDLINE_LINUX_DEFAULT options from /etc/default/grub file are used to set both
+# the kernelopts variable in the grubenv file and the fallback kernelopts variable.
+if [ -z "\${kernelopts}" ]; then
+ set kernelopts="root=${linux_root_device_thisversion} ro ${args}"
+fi
+
EOF
}
--
2.39.1