Package: grub-common
Version: 2.00-22
I didn't read this bug report before trying to understand the issue; I
used to keep GRUB_DEFAULT=saved and the introduction of the submenu
catched me unprepared. Going to give my 2 cents by telling my thoughts.
I started to think that the creation of a submenu should be avoided in
any case when GRUB_DEFAULT is not set to 0: at next boot, if the default
entry is in the submenu, grub will show the submenu as selected without
showing what's going to boot, which doesn't make any sense IMO.
The attached patch, which applies to v2.00-22, tried to deal with this
issue by simply preventing first entry and submenu generation in such
circumstances.
Thanks
Maurizio
--- /etc/grub.d/10_linux 2014-01-16 01:36:27.970279591 +0100
+++ /etc/grub.d/10_linux.new 2014-01-16 01:36:17.853371786 +0100
@@ -329,7 +329,7 @@
linux_root_device_thisversion=${GRUB_DEVICE}
fi
- if [ "x$is_first_entry" = xtrue ]; then
+ if [ "x$is_first_entry" = xtrue -a "x$GRUB_DEFAULT" = "x0" ]; then
linux_entry "${OS}" "${version}" simple \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
@@ -355,7 +355,7 @@
# If at least one kernel was found, then we need to
# add a closing '}' for the submenu command.
-if [ x"$is_first_entry" != xtrue ]; then
+if [ x"$is_first_entry" != xtrue -a "x$GRUB_DEFAULT" = "x0" ]; then
echo '}'
fi