nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0250-10_linux_bls-add-missing-menu-entries-options.patch

d9d99f
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
d9d99f
From: Javier Martinez Canillas <javierm@redhat.com>
d9d99f
Date: Thu, 22 Nov 2018 16:12:19 +0100
d9d99f
Subject: [PATCH] 10_linux_bls: add missing menu entries options
d9d99f
d9d99f
The script that generates menu entries in the grub.cfg from BLS snippets
d9d99f
wasn't filling some important options, like the --id, --class and --user
d9d99f
if these were defined in the BLS.
d9d99f
d9d99f
Resolves: rhbz#1652434
d9d99f
d9d99f
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
d9d99f
---
d9d99f
 util/grub.d/10_linux_bls.in | 15 ++++++++++++++-
d9d99f
 1 file changed, 14 insertions(+), 1 deletion(-)
d9d99f
d9d99f
diff --git a/util/grub.d/10_linux_bls.in b/util/grub.d/10_linux_bls.in
b71686
index 8745e598d..8cff4c58a 100644
d9d99f
--- a/util/grub.d/10_linux_bls.in
d9d99f
+++ b/util/grub.d/10_linux_bls.in
d9d99f
@@ -127,6 +127,9 @@ read_config()
d9d99f
     initrd=""
d9d99f
     options=""
d9d99f
     linux=""
d9d99f
+    grub_users=""
d9d99f
+    grub_arg=""
d9d99f
+    grub_class=""
d9d99f
 
d9d99f
     while read -r line
d9d99f
     do
d9d99f
@@ -145,6 +148,15 @@ read_config()
d9d99f
             "options")
d9d99f
                 options=${value}
d9d99f
                 ;;
d9d99f
+            "grub_users")
d9d99f
+                grub_users=${value}
d9d99f
+                ;;
d9d99f
+            "grub_arg")
d9d99f
+                grub_arg=${value}
d9d99f
+                ;;
d9d99f
+            "grub_class")
d9d99f
+                grub_class=${value}
d9d99f
+                ;;
d9d99f
         esac
d9d99f
     done < ${config_file}
d9d99f
 }
d9d99f
@@ -167,7 +179,8 @@ populate_menu()
d9d99f
 
d9d99f
     for bls in "${files[@]}" ; do
d9d99f
         read_config "${blsdir}/${bls}.conf"
d9d99f
-        menu="${menu}menuentry '${title}' {\n"
d9d99f
+
d9d99f
+        menu="${menu}menuentry '${title}' --class ${grub_class} ${grub_arg} --users ${grub_users} --id ${bls} {\n"
d9d99f
         menu="${menu}\t linux ${linux} ${options}\n"
d9d99f
         if [ -n "${initrd}" ] ; then
d9d99f
             menu="${menu}\t initrd ${boot_prefix}${initrd}\n"