From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K223A-0003KY-Qz for mharc-grub-devel@gnu.org; Fri, 30 May 2008 06:41:32 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K2237-0003Iv-U6 for grub-devel@gnu.org; Fri, 30 May 2008 06:41:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K2235-0003Hm-Io for grub-devel@gnu.org; Fri, 30 May 2008 06:41:28 -0400 Received: from [199.232.76.173] (port=40952 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2235-0003HI-6Y for grub-devel@gnu.org; Fri, 30 May 2008 06:41:27 -0400 Received: from aybabtu.com ([69.60.117.155]:37133) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K2234-0003OM-3A for grub-devel@gnu.org; Fri, 30 May 2008 06:41:26 -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 1K222d-000324-CG for grub-devel@gnu.org; Fri, 30 May 2008 12:40:59 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1K222t-0005b2-D8 for grub-devel@gnu.org; Fri, 30 May 2008 12:41:15 +0200 Date: Fri, 30 May 2008 12:41:15 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080530104115.GA21035@thorin> References: <20080529151336.GA6158@thorin> <20080529181709.GA26058@thorin> 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] UUID support 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: Fri, 30 May 2008 10:41:30 -0000 On Fri, May 30, 2008 at 02:49:22AM +0800, Bean wrote: > On Fri, May 30, 2008 at 2:17 AM, Robert Millan wrote: > > On Fri, May 30, 2008 at 12:50:42AM +0800, Bean wrote: > >> > >> BTW, I think we can embed the UUID of the root device in > >> core.img/grub.elf, so that when the traditional root device fails to > >> locate normal.mod, it uses the UUID to scan for root device. > > > > Good idea. But I'd check for UUID first. When you find a UUID match, it's > > much more reliable than a filename one. > > Here are some thought about how to store it. We can reuse the space > occupied by prefix. Instead of one variable, we use zero-end strings > like: > > path=/boot/grub \0 uuid=xxx-xxx-xxxx \0 \0 > > We can also add other variable, for example, debug and default. debug > is useful as it can show message before grub.cfg is loaded, and > default is used to control the default menu entry. Other variable > should be set in grub.cfg, as space is quite limited here. > > path=/boot/grub \0 uuid=xxx-xxx-xxxx \0 debug=all \0 default=1 \0 \0 > > The space need to expand slightly, I guess something about 100 byte is > more than enough. The whole block is prefixed by a magic number and > block length, so that it's easy to locate by utility. > > This also solve the savedefault issue, we can add a command like this: > > save_env /path_to_core.img variable_name .. > > It finds the magic number, and store the value of selected variable in > the embedded environment block. Then I suppose we could have a module that gets $uuid from environment and searches for it to set $prefix? Maybe we could search for everything else in the same module too, this way we only have to iterate once. It could check for things like: - filesystem uuid - partmap uuid (when we support it) - filename (based on user input via variable, rather than hardcoded normal.mod?) - filesystem label -- 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 /.)