From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MEqX9-00016P-Jo for mharc-grub-devel@gnu.org; Thu, 11 Jun 2009 16:05:59 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MEqX8-000162-PN for grub-devel@gnu.org; Thu, 11 Jun 2009 16:05:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MEqX3-000133-MA for grub-devel@gnu.org; Thu, 11 Jun 2009 16:05:58 -0400 Received: from [199.232.76.173] (port=40661 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MEqX3-00012t-Ey for grub-devel@gnu.org; Thu, 11 Jun 2009 16:05:53 -0400 Received: from aybabtu.com ([69.60.117.155]:40169) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MEqX2-00033F-Vp for grub-devel@gnu.org; Thu, 11 Jun 2009 16:05:53 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1MEpV3-00083U-FK for grub-devel@gnu.org; Thu, 11 Jun 2009 20:59:45 +0200 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1MEqX0-0007Wu-F4 for grub-devel@gnu.org; Thu, 11 Jun 2009 22:05:50 +0200 Date: Thu, 11 Jun 2009 22:05:50 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090611200550.GA28915@thorin> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) Subject: Re: [PATCH] savedefault X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 20:05:59 -0000 Hi! On Mon, Jun 01, 2009 at 12:48:38PM +0200, Vladimir 'phcoder' Serbinenko wrote: > cat << EOF > +load_env > set default=${GRUB_DEFAULT} Does the "set" line override the settings in load_env? It looks like it would. > --- a/util/grub.d/10_freebsd.in > +++ b/util/grub.d/10_freebsd.in > @@ -57,6 +57,8 @@ if [ "x$kfreebsd" != "x" ] ; then > > cat << EOF > menuentry "${OS}" { > + saved_entry=\${chosen_entry} > + save_env saved_entry > EOF > prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" > cat << EOF > diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in > index 12d61b0..114017b 100644 > --- a/util/grub.d/10_hurd.in > +++ b/util/grub.d/10_hurd.in > @@ -70,6 +70,8 @@ fi > > cat << EOF > menuentry "${OS}" { > + saved_entry=\${chosen_entry} > + save_env saved_entry > EOF > prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/" > cat << EOF > diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in > index c2da413..93d141b 100644 > --- a/util/grub.d/10_linux.in > +++ b/util/grub.d/10_linux.in > @@ -97,6 +97,8 @@ linux_entry () > { > cat << EOF > menuentry "$1" { > + saved_entry=\${chosen_entry} > + save_env saved_entry > EOF > prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" > cat << EOF I think it'd really be a good idea to either factorize this into a function (ala prepare_grub_to_access_device), or make it part of the scripting engine. I'm afraid of the possibility that later we want to change something and can't because 3rd party scripts depend on it (this happened with disk selection before we had prepare_grub_to_access_device). -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."