grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Scan root device dynamically at startup


From: Bean
Subject: Re: [PATCH] Scan root device dynamically at startup
Date: Wed, 28 May 2008 22:53:07 +0800

On Wed, May 28, 2008 at 9:54 PM, Robert Millan <address@hidden> wrote:
> On Tue, May 20, 2008 at 06:22:25PM +0800, Bean wrote:
>> Hi,
>>
>> For normal boot, the root device is passed to core.img in preloader.
>> However, if we load grub2 using linux header, there is no way to know
>> the root device. This patch add a new module findroot that can be used
>> to scan the root directory at startup.
>>
>> One important usage is to create a grub2 boot file for vista boot loader:
>>
>> mkimage -o g2ntfs.img pc ntfs biosdisk findroot
>> cat lnxboot.img g2ntfs.img > g2ntfs.mbr
>>
>> The result g2ntfs.mbr is within 32K, which can be loaded by vista in
>> one pass, no need to use the g2ldr.mbr anymore. The findroot modules
>> ensure that prefix is set properly before switching to normal mode.
>>
>> If findroot is not used to create core.img, the original booting method 
>> remains.
>
> The module is called findroot, but it initialises $prefix rather than $root.
> Shouldn't it be findprefix or so?
>

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.

-- 
Bean




reply via email to

[Prev in Thread] Current Thread [Next in Thread]