From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Vd6sq-0002tv-5Z for mharc-grub-devel@gnu.org; Sun, 03 Nov 2013 18:15:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vd6sk-0002tM-Lp for grub-devel@gnu.org; Sun, 03 Nov 2013 18:15:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vd6sg-0004TH-Dq for grub-devel@gnu.org; Sun, 03 Nov 2013 18:14:58 -0500 Received: from mail-ee0-x22f.google.com ([2a00:1450:4013:c00::22f]:33126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vd6sg-0004Rn-2G for grub-devel@gnu.org; Sun, 03 Nov 2013 18:14:54 -0500 Received: by mail-ee0-f47.google.com with SMTP id c13so768177eek.6 for ; Sun, 03 Nov 2013 15:14:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=HXhkD8NZwbko9n6vnhIPyZv1p+34R3eBQUiXkksCfdY=; b=KZf9s3u4RJMzgUHWKXRssquVjBVkVJ3V9+YY/m20rgTPKaJWoYPB+Zf7p5+cLLATbx YlDnMd63oahE6vvZJhE+/mjTkO1b55zXX1z/3VJ6BddgaJWlpfJvFDzACCEzde4mImwH +7O+J2oEHsIDSItSeCoYdKNv84NH74uoDmPAmJNY5sC2tpa8QB2NfuZP80y89Bk5e1ZO nhQdCdOlXBF4BxaJVMA4DtfvOeY39BOEEjuMepP47yokfxUfheFYyCAAcQYz/1aQNfqv m7vNX+cRWW3vvZd28l5w+BLacfhnts92PqLkNe+gh544L7IdlIPPrElc1P81ZBJIk2rD W01g== X-Received: by 10.15.23.1 with SMTP id g1mr1689472eeu.63.1383520492770; Sun, 03 Nov 2013 15:14:52 -0800 (PST) Received: from [192.168.1.16] (31-249.1-85.cust.bluewin.ch. [85.1.249.31]) by mx.google.com with ESMTPSA id i1sm38991281eeg.0.2013.11.03.15.14.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 03 Nov 2013 15:14:51 -0800 (PST) Message-ID: <5276D8EA.6050305@gmail.com> Date: Mon, 04 Nov 2013 00:14:50 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: [PATCH]: Add GRUB_DISABLE_SUBMENU option References: <1359487413-14528-1-git-send-email-prarit@redhat.com> In-Reply-To: <1359487413-14528-1-git-send-email-prarit@redhat.com> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="----enig2BROWMRJSQRINRPEHHAPU" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::22f X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 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: Sun, 03 Nov 2013 23:15:03 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2BROWMRJSQRINRPEHHAPU Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I've committed a patch introducing the same option but more compact and accepting GRUB_DISABLE_SUBMENU=3Dn On 29.01.2013 20:23, Prarit Bhargava wrote: > I'm not sure what the proper patch posting protocol is on this list and= > I've never used bzr before. If this is incorrect, please email me and = let > me know what I've done wrong. >=20 > Thanks, >=20 > P. >=20 >=20 >=20 > ------------------------------------------------------------ > revno: 4686 > committer: Prarit Bhargava > branch nick: grub > timestamp: Tue 2013-01-29 14:14:01 -0500 > message: > Add GRUB_DISABLE_MENU option > =20 > When doing kernel development it is often advantageous to do the foll= owing: > =20 > 1. Select a kernel to boot with grub2-reboot > 2. Reboot, capture output from bad kernel. > 3. On subsequent reboot, boot known good or "default" kernel. > =20 > The problem is that the submenus get in the way of doing this. grub2= -reboot > does not allow one to set a reboot to a specific kernel. > =20 > I *could* write a rule to be executed on the existing grub.cfg to rem= ove > the submenu entries, however, given that a google search for "grub2 r= emove > submenus" leads to many many hits, I think a better approach is to ma= ke > GRUB_DISABLE_SUBMENU a generally available option. > =20 > Please note I have only tested this on Linux (specifically Fedora 17 = and > Fedora 18). > =20 > Signed-off-by: Prarit Bhargava >=20 >=20 > diff: > =3D=3D=3D modified file 'util/grub-mkconfig.in' > --- util/grub-mkconfig.in 2012-12-28 07:21:17 +0000 > +++ util/grub-mkconfig.in 2013-01-29 19:14:01 +0000 > @@ -215,7 +215,8 @@ > GRUB_INIT_TUNE \ > GRUB_SAVEDEFAULT \ > GRUB_ENABLE_CRYPTODISK \ > - GRUB_BADRAM > + GRUB_BADRAM \ > + GRUB_DISABLE_SUBMENU > =20 > if test "x${grub_cfg}" !=3D "x"; then > rm -f "${grub_cfg}.new" >=20 > =3D=3D=3D modified file 'util/grub.d/10_hurd.in' > --- util/grub.d/10_hurd.in 2012-09-18 11:04:06 +0000 > +++ util/grub.d/10_hurd.in 2013-01-29 19:14:01 +0000 > @@ -156,14 +156,15 @@ > for kernel in ${kernels} > do > =20 > - if [ "x$is_first_entry" =3D xtrue ]; then > + if [ "x${GRUB_DISABLE_SUBMENU}" =3D x ]; then=20 > + if [ "x$is_first_entry" =3D xtrue ]; then > hurd_entry "$kernel" simple > submenu_indentation=3D"$grub_tab" > =20 > # TRANSLATORS: %s is replaced with an OS name > echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}= " | grub_quote)' \$menuentry_id_option 'gnuhurd-advanced-$(grub_get_devic= e_id "${GRUB_DEVICE_BOOT}")' {" > + fi > fi > - > hurd_entry "$kernel" advanced > hurd_entry "$kernel" recovery > is_first_entry=3Dfalse > @@ -171,8 +172,10 @@ > =20 > # If at least one kernel was found, then we need to > # add a closing '}' for the submenu command. > -if [ x"$is_first_entry" !=3D xtrue ]; then > - echo '}' > +if [ "x${GRUB_DISABLE_SUBMENU}" =3D x ]; then=20 > + if [ x"$is_first_entry" !=3D xtrue ]; then > + echo '}' > + fi > fi > =20 > echo "$title_correction_code" >=20 > =3D=3D=3D modified file 'util/grub.d/10_kfreebsd.in' > --- util/grub.d/10_kfreebsd.in 2013-01-03 22:19:19 +0000 > +++ util/grub.d/10_kfreebsd.in 2013-01-29 19:14:01 +0000 > @@ -211,15 +211,17 @@ > module_dir_rel=3D$(make_system_path_relative_to_its_root $module_d= ir) > fi > =20 > - if [ "x$is_first_entry" =3D xtrue ]; then > - kfreebsd_entry "${OS}" "${version}" simple > - submenu_indentation=3D"$grub_tab" > - =20 > - if [ -z "$boot_device_id" ]; then > + if [ "x${GRUB_DISABLE_SUBMENU}" =3D x ]; then=20 > + if [ "x$is_first_entry" =3D xtrue ]; then > + kfreebsd_entry "${OS}" "${version}" simple > + submenu_indentation=3D"$grub_tab" > + > + if [ -z "$boot_device_id" ]; then > boot_device_id=3D"$(grub_get_device_id "${GRUB_DEVICE}")" > - fi > - # TRANSLATORS: %s is replaced with an OS name > - echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}= " | grub_quote)' \$menuentry_id_option 'kfreebsd-advanced-$boot_device_id= ' {" > + fi > + # TRANSLATORS: %s is replaced with an OS name > + echo "submenu '$(gettext_printf "Advanced options for %s" "${O= S}" | grub_quote)' \$menuentry_id_option 'kfreebsd-advanced-$boot_device_= id' {" > + fi > fi > =20 > kfreebsd_entry "${OS}" "${version}" advanced > @@ -233,8 +235,10 @@ > =20 > # If at least one kernel was found, then we need to > # add a closing '}' for the submenu command. > -if [ x"$is_first_entry" !=3D xtrue ]; then > - echo '}' > +if [ "x${GRUB_DISABLE_SUBMENU}" =3D x ]; then=20 > + if [ x"$is_first_entry" !=3D xtrue ]; then > + echo '}' > + fi > fi > =20 > echo "$title_correction_code" >=20 > =3D=3D=3D modified file 'util/grub.d/10_linux.in' > --- util/grub.d/10_linux.in 2012-09-18 11:04:06 +0000 > +++ util/grub.d/10_linux.in 2013-01-29 19:14:01 +0000 > @@ -226,18 +226,20 @@ > linux_root_device_thisversion=3D${GRUB_DEVICE} > fi > =20 > - if [ "x$is_first_entry" =3D xtrue ]; then > - linux_entry "${OS}" "${version}" simple \ > - "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" > + if [ "x${GRUB_DISABLE_SUBMENU}" =3D x ]; then=20 > + if [ "x$is_first_entry" =3D xtrue ]; then > + linux_entry "${OS}" "${version}" simple \ > + "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" > =20 > - submenu_indentation=3D"$grub_tab" > + submenu_indentation=3D"$grub_tab" > =20 > - if [ -z "$boot_device_id" ]; then > - boot_device_id=3D"$(grub_get_device_id "${GRUB_DEVICE}")" > + if [ -z "$boot_device_id" ]; then > + boot_device_id=3D"$(grub_get_device_id "${GRUB_DEVICE}")" > + fi > + # 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 > - # 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 > =20 > linux_entry "${OS}" "${version}" advanced \ > "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" > @@ -252,8 +254,9 @@ > =20 > # If at least one kernel was found, then we need to > # add a closing '}' for the submenu command. > -if [ x"$is_first_entry" !=3D xtrue ]; then > - echo '}' > +if [ "x${GRUB_DISABLE_SUBMENU}" =3D x ]; then=20 > + if [ x"$is_first_entry" !=3D xtrue ]; then > + echo '}' > + fi > fi > - > echo "$title_correction_code" >=20 > =3D=3D=3D modified file 'util/grub.d/10_netbsd.in' > --- util/grub.d/10_netbsd.in 2012-10-28 10:55:22 +0000 > +++ util/grub.d/10_netbsd.in 2013-01-29 19:14:01 +0000 > @@ -157,15 +157,17 @@ > =20 > gettext_printf "Found NetBSD kernel: %s\n" "$k" >&2 > =20 > - if [ "x$is_first_entry" =3D xtrue ]; then > - netbsd_entry "knetbsd" "$k" simple "${GRUB_CMDLINE_NETBSD_DEFA= ULT}" > - submenu_indentation=3D"$grub_tab" > + if [ "x${GRUB_DISABLE_SUBMENU}" =3D x ]; then=20 > + if [ "x$is_first_entry" =3D xtrue ]; then > + netbsd_entry "knetbsd" "$k" simple "${GRUB_CMDLINE_NETBSD_DE= FAULT}" > + submenu_indentation=3D"$grub_tab" > =20 > - if [ -z "$boot_device_id" ]; then > - boot_device_id=3D"$(grub_get_device_id "${GRUB_DEVICE}")" > + if [ -z "$boot_device_id" ]; then > + boot_device_id=3D"$(grub_get_device_id "${GRUB_DEVICE}")" > + fi > + # TRANSLATORS: %s is replaced with an OS name > + echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}= " | grub_quote)' \$menuentry_id_option 'netbsd-advanced-$boot_device_id' = {" > fi > - # TRANSLATORS: %s is replaced with an OS name > - echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" = | grub_quote)' \$menuentry_id_option 'netbsd-advanced-$boot_device_id' {"= > fi > =20 > netbsd_entry "knetbsd" "$k" advanced "${GRUB_CMDLINE_NETBSD_DEFAUL= T}" > @@ -179,8 +181,10 @@ > =20 > # If at least one kernel was found, then we need to > # add a closing '}' for the submenu command. > -if [ x"$is_first_entry" !=3D xtrue ]; then > - echo '}' > +if [ "x${GRUB_DISABLE_SUBMENU}" =3D x ]; then=20 > + if [ x"$is_first_entry" !=3D xtrue ]; then > + echo '}' > + fi > fi > =20 > echo "$title_correction_code" >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 ------enig2BROWMRJSQRINRPEHHAPU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlJ22OoACgkQmBXlbbo5nOtoZAD/SCMR+P2gmwJwDRhFK8mt8HEE T8sFhKU5numtqT6U8h8BAJWktEOdfzsJERDb1YYuJKeJuZ7C7TYEW5B9Czkx8z8v =D+KS -----END PGP SIGNATURE----- ------enig2BROWMRJSQRINRPEHHAPU--