Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1PLJ3R-0004x0-0q for mharc-grub-devel@gnu.org; Wed, 24 Nov 2010 12:22:49 -0500 Received: from [140.186.70.92] (port=44270 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PLJ2q-0004ti-Rf for grub-devel@gnu.org; Wed, 24 Nov 2010 12:22:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PLJ29-0007gd-Fz for grub-devel@gnu.org; Wed, 24 Nov 2010 12:22:12 -0500 Received: from smarthost03.mail.zen.net.uk ([212.23.3.142]:45522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PLJ29-0007fg-Au for grub-devel@gnu.org; Wed, 24 Nov 2010 12:21:29 -0500 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost03.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1PLJ27-0000Fy-El for grub-devel@gnu.org; Wed, 24 Nov 2010 17:21:27 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) for grub-devel@gnu.org id 1PLJ1z-0004nF-00; Wed, 24 Nov 2010 17:21:19 +0000 Date: Wed, 24 Nov 2010 17:21:19 +0000 From: Colin Watson To: grub-devel@gnu.org Message-ID: <20101124172029.GN21862@riva.ucam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost03-IP: [82.69.40.219] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [PATCH] Use submenus for 10_linux X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Nov 2010 17:22:48 -0000 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 * 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 [cjwatson@ubuntu.com]