From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JcxLm-00055V-2R for mharc-grub-devel@gnu.org; Sat, 22 Mar 2008 02:37:06 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JcxLk-00055A-Jj for grub-devel@gnu.org; Sat, 22 Mar 2008 02:37:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JcxLi-00054e-7Z for grub-devel@gnu.org; Sat, 22 Mar 2008 02:37:03 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JcxLi-00054b-2V for grub-devel@gnu.org; Sat, 22 Mar 2008 02:37:02 -0400 Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JcxLh-0004Ow-T4 for grub-devel@gnu.org; Sat, 22 Mar 2008 02:37:02 -0400 Received: from c60.cesmail.net ([216.154.195.49]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JcxLg-0001jA-TJ for grub-devel@gnu.org; Sat, 22 Mar 2008 02:37:01 -0400 Received: from unknown (HELO relay.cesmail.net) ([192.168.1.81]) by c60.cesmail.net with ESMTP; 22 Mar 2008 02:36:59 -0400 Received: from [192.168.1.21] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by relay.cesmail.net (Postfix) with ESMTP id 9383C619058 for ; Sat, 22 Mar 2008 02:36:59 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: References: <20080320040905.9tndjqzqf4so880g@webmail.spamcop.net> <1206030362.31267.48.camel@dv> Content-Type: text/plain Date: Sat, 22 Mar 2008 02:36:58 -0400 Message-Id: <1206167819.22775.46.camel@dv> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-3.fc8) Content-Transfer-Encoding: 7bit X-detected-kernel: by mx20.gnu.org: Genre and OS details not recognized. X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Subject: Re: Proposal for savedefault implementation 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: Sat, 22 Mar 2008 06:37:04 -0000 On Fri, 2008-03-21 at 19:31 +0800, Bean wrote: > Hi, > > I'm think about the following implementation, please see if it's all right. > > Config information is saved in a file named `defaults' in the grub > directory, it's format is something like this: It would be great not to hardcode the name, or at least make it possible to override the name. > GRUBENV \0 > key1=value1 \0 > key2=value2 \0 > ... > keyN=valueN \0 \0 > > This file should be at least 8192 bytes, this should be ok for most file system. Why this number? Is it to avoid some filesystem issues, like tail packing? Or is it just to ensure that there is enough space for the variables? > In grub2, we use load_exports to load global variables, and > save_exports to save them. For example: > > load_exports > > menuentry "aa" { > default=0 > export default > save_exports > } It feels too verbose to me. I think "export default=0" could do all three operations at once. Also, "default" or some other variable should be set to the menu entry number automatically, so that the entries don't need to be renumbered every time. > we can also add a new tool such as grub-editenv to edit the config > file. Maybe I'm too obsessed with safety, but that tool should also check that the "default" file is located in a place that is safe for GRUB to use. -- Regards, Pavel Roskin