grub-devel
[Top][All Lists]
Advanced

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

Re: Proposal for savedefault implementation


From: Pavel Roskin
Subject: Re: Proposal for savedefault implementation
Date: Sat, 22 Mar 2008 02:36:58 -0400

On Fri, 2008-03-21 at 19:31 +0800, Bean wrote:
> Hi,
> 
> I'm think about the following implementation, please see if it's all right.
> 
> Config information is saved in a file named `defaults' in the grub
> directory, it's format is something like this:

It would be great not to hardcode the name, or at least make it possible
to override the name.

> GRUBENV \0
> key1=value1 \0
> key2=value2 \0
> ...
> keyN=valueN \0 \0
> 
> This file should be at least 8192 bytes, this should be ok for most file 
> system.

Why this number?  Is it to avoid some filesystem issues, like tail
packing?  Or is it just to ensure that there is enough space for the
variables?

> In grub2, we use load_exports to load global variables, and
> save_exports to save them. For example:
> 
> load_exports
> 
> menuentry "aa" {
>   default=0
>   export default
>   save_exports
> }

It feels too verbose to me.  I think "export default=0" could do all
three operations at once.  Also, "default" or some other variable should
be set to the menu entry number automatically, so that the entries don't
need to be renumbered every time.

> we can also add a new tool such as grub-editenv to edit the config
> file.

Maybe I'm too obsessed with safety, but that tool should also check that
the "default" file is located in a place that is safe for GRUB to use.

-- 
Regards,
Pavel Roskin




reply via email to

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