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:

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.

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
}

menuentry "bb" {
  default=1
  export default
  save_exports
}

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

-- 
Bean


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to