grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] UUID support


From: Bean
Subject: Re: [PATCH] UUID support
Date: Fri, 30 May 2008 21:26:05 +0800

On Fri, May 30, 2008 at 9:14 PM, Robert Millan <address@hidden> wrote:
> On Fri, May 30, 2008 at 12:41:15PM +0200, Robert Millan wrote:
>> >
>> > 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?
>
> However, a problem with this is that it only works for i386-pc, untill we
> define a way to store this for each variant.
>
> Perhaps we could instead use memdisk to store it?  Rather than put a grub.cfg
> in memdisk, which would require builtin normal.mod, we could put a simpler
> file (let's call it 'env') with initial environment, in the binary format
> you describe.  Does that work?
>
> Then to support it in other platforms, we just need to implement memdisk in
> them.

We can use some function like grub_machine_get_env to return a pointer
to the environment block, and parse it in main.c. The env block is
string base, it can be used in any platform.

BTW, since you have changed the filesystem structure, you need to add
the uuid member to other fs modules as well, otherwise it will cause
compile error.

-- 
Bean




reply via email to

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