From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K2O37-0006Vx-6b for mharc-grub-devel@gnu.org; Sat, 31 May 2008 06:10:57 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K2O35-0006V0-CL for grub-devel@gnu.org; Sat, 31 May 2008 06:10:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K2O34-0006Ue-N4 for grub-devel@gnu.org; Sat, 31 May 2008 06:10:54 -0400 Received: from [199.232.76.173] (port=39232 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2O34-0006UZ-Jv for grub-devel@gnu.org; Sat, 31 May 2008 06:10:54 -0400 Received: from aybabtu.com ([69.60.117.155]:50001) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K2O34-0007Nv-Fn for grub-devel@gnu.org; Sat, 31 May 2008 06:10:54 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1K2O2X-0004uU-UM for grub-devel@gnu.org; Sat, 31 May 2008 12:10:22 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1K2O2s-00024G-SN for grub-devel@gnu.org; Sat, 31 May 2008 12:10:42 +0200 Date: Sat, 31 May 2008 12:10:42 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080531101042.GF6619@thorin> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] Environment block support for grub2 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, 31 May 2008 10:10:55 -0000 On Sat, May 31, 2008 at 04:27:31AM +0800, Bean wrote: > Hi, > > This patch add environment block support, which can be used to locate > root device using uuid or label. Nice :-) > The previous prefix is stored in variable rdir. Do we need this? > Different platform use grub_machine_get_envblk to return a pointer to > the name=value area of environment block. In main.c, it uses > grub_parse_envblk to walk through the list and assign values to > variables. > > I also replace grub_machine_set_prefix with grub_machine_set_root. As > it seems strange to compute the prefix in grub_machine_set_prefix, and > then split it in grub_set_root_dev to get the root device. Now, > grub_machine_set_root set the root directly, and in grub_set_root_dev, > it uses root and rdir to generate the prefix. Note that root and prefix don't necessarily have to point at the same device. prefix always points at the directory containing GRUB modules etc, and is needed at initial stage. root is used later on by grub.cfg to access our payload (I think our current use of root to initialise prefix is gratuitous and could better be avoided). Since for initialising root we don't have any problem, as we can use all the fancy stuff grub.cfg allows, unless I missed something I think it's better if at this stage we just focus on prefix. > grub-mkimage will initialize the environment block with one item: > rdir=/boot/grub > > Second, use grub-editenv to set the uuid or label of the root device. > For example: Would it be simpler if grub-mkimage embedded an initialised environment block directly? -- Robert Millan I know my rights; I want my phone call! What good is a phone call… if you are unable to speak? (as seen on /.)