grub2 and Previous Linux versions submenu

Colin Watson cjwatson at ubuntu.com
Fri Apr 13 11:39:22 UTC 2012


On Thu, Apr 12, 2012 at 09:06:53AM -0400, Evan Huus wrote:
> On Thu, Apr 12, 2012 at 5:36 AM, Christoph Mathys <eraserix at gmail.com>wrote:
> > Since some time grub started to hide old kernel entries. This is
> > usually a good thing. However, on work we routinly boot
> > older/different kernels and its tedious to always navigate into
> > "Previous Linux versions" and choose the correct kernel. Is there a
> > simple switch that disables the new-style grub menu?
> 
> It's not a simple switch exactly, but:
> 
> Those entries are generated by the shell script /etc/grub.d/10_linux
> I believe your best choice at this point is to edit that file so that it
> doesn't create the submenu.

Indeed; sorry about that.  This patch would do it.

--- /etc/grub.d/10_linux.orig	2012-03-06 13:40:33.000000000 +0000
+++ /etc/grub.d/10_linux	2012-04-13 12:37:50.000000000 +0100
@@ -183,7 +183,6 @@
 if [ "\$linux_gfx_mode" != "text" ]; then load_video; fi
 EOF
 
-in_submenu=false
 while [ "x$list" != "x" ] ; do
   linux=`version_find_latest $list`
   echo "Found linux image: $linux" >&2
@@ -242,13 +241,4 @@
   fi
 
   list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
-
-  if [ "$list" ] && ! $in_submenu; then
-    echo "submenu \"Previous Linux versions\" {"
-    in_submenu=:
-  fi
 done
-
-if $in_submenu; then
-  echo "}"
-fi

-- 
Colin Watson                                       [cjwatson at ubuntu.com]




More information about the Ubuntu-devel-discuss mailing list