grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Use submenus for 10_linux


From: Colin Watson
Subject: [PATCH] Use submenus for 10_linux
Date: Wed, 24 Nov 2010 17:21:19 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

What do people think of this?  It's a remarkably small change now that
Vladimir's implemented submenus, and I've had a number of requests for
it.

I wonder if it would be worth having some visual indication that a menu
entry is a submenu; but that probably ought to be done centrally.

I don't know whether this is 1.99 material or not, and would appreciate
comments.

2010-11-24  Colin Watson  <address@hidden>

        * util/grub.d/10_linux.in: Put second and subsequent menu entries in
        a submenu.

=== modified file 'util/grub.d/10_linux.in'
--- util/grub.d/10_linux.in     2010-11-01 11:49:40 +0000
+++ util/grub.d/10_linux.in     2010-11-24 17:15:27 +0000
@@ -114,6 +114,7 @@ list=`for i in /boot/vmlinuz-* /boot/vml
       done`
 prepare_boot_cache=
 
+in_submenu=false
 while [ "x$list" != "x" ] ; do
   linux=`version_find_latest $list`
   echo "Found linux image: $linux" >&2
@@ -159,4 +160,13 @@ while [ "x$list" != "x" ] ; do
   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                                       address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]