From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K1eu8-0003nt-Ox for mharc-grub-devel@gnu.org; Thu, 29 May 2008 05:58:40 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K1eu6-0003nU-Es for grub-devel@gnu.org; Thu, 29 May 2008 05:58:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K1eu5-0003n9-CR for grub-devel@gnu.org; Thu, 29 May 2008 05:58:37 -0400 Received: from [199.232.76.173] (port=47256 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1eu4-0003n5-RL for grub-devel@gnu.org; Thu, 29 May 2008 05:58:36 -0400 Received: from aybabtu.com ([69.60.117.155]:49908) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K1eu4-0004tF-9Y for grub-devel@gnu.org; Thu, 29 May 2008 05:58:36 -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 1K1eti-0000lv-AY for grub-devel@gnu.org; Thu, 29 May 2008 11:58:16 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1K1etg-0007Of-GX for grub-devel@gnu.org; Thu, 29 May 2008 11:58:12 +0200 Date: Thu, 29 May 2008 11:58:12 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080529095812.GA28156@thorin> References: <20080528135402.GE26495@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] Scan root device dynamically at startup 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, 29 May 2008 09:58:39 -0000 On Wed, May 28, 2008 at 10:53:07PM +0800, Bean wrote: > > In function grub_set_root_dev (main.c), it uses prefix to calculated > root, so setting prefix is sufficient. > > About the name, well, findprefix works for me too. > > > Also, what this module is doing looks very similar to "search --set". Did > > you check if search command can be used for what you want? (or otherwise > > adapted) > > The findroot module is used to locate normal.mod. But search is a > command, it can only be used after normal.mod has been loaded. I've been thinking a bit more about this, and my impression is that it the approach is quite ad-hoc. For example, some similar problems that this solution wouldn't solve, but that a very similar solution would: a- normal.mod was built into grub.elf (perhaps because the firmware can load big files). Then the problem is finding grub.cfg instead of normal.mod. b- User has a disk liing around which happens to have a normal.mod from an earlier version of grub (let's assume different ABI). Turns out this disk is used for something else and can't be supressed. A solution could be to use UUIDs for the search, but that can't always work since we need a "smart" install process that can probe for them (unlike in the situation you described -- I can't imagine doing fancy stuff in bare-bones Vista). c- Search for normal.mod was ok, but then this particular port of grub can't accept the prefix variable from your module, because it already got this variable from the firmware (OFW does this). And the variable from firmware happens to be completely unusable. I think a solution that would fit well here is to use memdisk to embed a grub.cfg. Then in each situation we could have a different grub.cfg script that finds appropiate prefix using the search command. -- 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 /.)