You are not logged in.
The grub-mkconfig tool makes a submenu for differents kernels, but I don't think it's a good idea. I have searched google but find nothing to disable submenu. And the /etc/default/grub file contains nothing to disable submenu.
Solved, the solution is in #6
Last edited by zasdfgbnm (2012-03-28 06:07:07)
Offline
Moving to Newbie Corner
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
I don't use Grub2 so I'm not an expert but this might help: http://ubuntuforums.org/showthread.php?p=10720316
If it help, please add [SOLVED] to your topic title by editing first post
Last edited by masteryod (2012-03-27 15:43:46)
Offline
Edit: useless babbling.
Last edited by .:B:. (2012-03-27 17:44:52)
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
https://bugs.archlinux.org/task/25453
https://bugs.archlinux.org/task/29037?getfile=8444
https://bbs.archlinux.org/viewtopic.php … 2#p1074392
https://bbs.archlinux.org/viewtopic.php … 8#p1074558
Last edited by the.ridikulus.rat (2012-03-27 18:30:17)
Offline
reply to #3:
Thanks for your reply. The method for ubuntu doesn't support archlinux.
reply to #5:
These topics discussed grub's submenu, but they didn't give the method to disable it. But they do help me to find a method to disable the submenu. Thank you!
I add an option called GRUB_ENABLE_SUBMENU and set it to false,here is the patches:
patch for /usr/sbin/grub-mkconfig:
diff --git a/usr/sbin/grub-mkconfig b/usr/sbin/grub-mkconfig
index 81fea9f..124c6a4 100755
--- a/usr/sbin/grub-mkconfig
+++ b/usr/sbin/grub-mkconfig
@@ -184,6 +184,7 @@ export GRUB_DEVICE \
# These are optional, user-defined variables.
export GRUB_DEFAULT \
+ GRUB_ENABLE_SUBMENU \
GRUB_HIDDEN_TIMEOUT \
GRUB_HIDDEN_TIMEOUT_QUIET \
GRUB_TIMEOUT \
patch for /etc/grub.d/10_linux:
diff --git a/etc/grub.d/10_linux b/etc/grub.d/10_linux
index ee2d032..6f2a55b 100755
--- a/etc/grub.d/10_linux
+++ b/etc/grub.d/10_linux
@@ -249,6 +249,7 @@ while [ "x$list" != "x" ] ; do
done
fi
+if [ "x${GRUB_ENABLE_SUBMENU}" = xtrue ]; then
if [ "x$is_first_entry" = xtrue ]; then
linux_entry "${OS}" "${version}" simple \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
@@ -261,6 +262,7 @@ while [ "x$list" != "x" ] ; do
# TRANSLATORS: %s is replaced with an OS name
echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
fi
+fi
if [[ ! "$(grep "Arch Linux" /etc/os-release)" ]]; then
linux_entry "${OS}" "${version}" advanced \
@@ -278,10 +280,12 @@ done
# If at least one kernel was found, then we need to
# add a closing '}' for the submenu command.
+if [ "x${GRUB_ENABLE_SUBMENU}" = xtrue ]; then
if [[ ! "$(grep "Arch Linux" /etc/os-release)" ]]; then
if [ x"$is_first_entry" != xtrue ]; then
echo '}'
fi
fi
+fi
echo "$title_correction_code"
patch for /etc/default/grub:
diff --git a/etc/default/grub b/etc/default/grub
index 75be48c..009f91c 100644
--- a/etc/default/grub
+++ b/etc/default/grub
@@ -1,3 +1,4 @@
+GRUB_ENABLE_SUBMENU=false
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch Linux"
Last edited by zasdfgbnm (2012-03-28 06:04:45)
Offline
@zasdfgbnm: Can you rebase your patch to https://bugs.archlinux.org/task/29037?getfile=8444
Offline
Hmm so official Grub2 doesn't support this? It smells like an upstream feature request to me
Offline
Let the path grub-a be the source downloaded from gnu, grub-b be the source patched with archlinux_grub_mkconfig_fixes.patch, grub-c be the source after my modification.
the patch from grub-b to grub-c is:
diff --git a/grub-b/util/grub-mkconfig.in b/grub-c/util/grub-mkconfig.in
index 65a7fff..d33afaf 100644
--- a/grub-b/util/grub-mkconfig.in
+++ b/grub-c/util/grub-mkconfig.in
@@ -184,6 +184,7 @@ export GRUB_DEVICE \
# These are optional, user-defined variables.
export GRUB_DEFAULT \
+ GRUB_ENABLE_SUBMENU \
GRUB_HIDDEN_TIMEOUT \
GRUB_HIDDEN_TIMEOUT_QUIET \
GRUB_TIMEOUT \
diff --git a/grub-b/util/grub.d/10_linux.in b/grub-c/util/grub.d/10_linux.in
index 0d4a137..06b108b 100644
--- a/grub-b/util/grub.d/10_linux.in
+++ b/grub-c/util/grub.d/10_linux.in
@@ -250,6 +250,7 @@ while [ "x$list" != "x" ] ; do
done
fi
+if [ "x${GRUB_ENABLE_SUBMENU}" = xtrue ]; then
if [ "x$is_first_entry" = xtrue ]; then
linux_entry "${OS}" "${version}" simple \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
@@ -262,6 +263,7 @@ while [ "x$list" != "x" ] ; do
# TRANSLATORS: %s is replaced with an OS name
echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
fi
+fi
if ! test -e "/etc/arch-release" ; then
linux_entry "${OS}" "${version}" advanced \
@@ -279,10 +281,12 @@ done
# If at least one kernel was found, then we need to
# add a closing '}' for the submenu command.
+if [ "x${GRUB_ENABLE_SUBMENU}" = xtrue ]; then
if ! test -e "/etc/arch-release" ; then
if [ x"$is_first_entry" != xtrue ]; then
echo '}'
fi
fi
+fi
echo "$title_correction_code"
the patch for grub.default is:
diff --git a/grub.default b/grub.default.2
index 75be48c..fac8de4 100644
--- a/grub.default
+++ b/grub.default.2
@@ -1,4 +1,8 @@
GRUB_DEFAULT=0
+
+# Uncomment to place some kernels into submenu
+#GRUB_ENABLE_SUBMENU=true
+
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch Linux"
GRUB_CMDLINE_LINUX_DEFAULT="quiet add_efi_memmap"
Last edited by zasdfgbnm (2012-03-29 00:32:54)
Offline
Hmm so official Grub2 doesn't support this? It smells like an upstream feature request to me
No option to disable it. We can only edit the code.
Offline