Bean <[EMAIL PROTECTED]> writes:

> Hi,
>
> Now it's possible to implement savedefault with load_env and save_env,
> but the problem is we need to add it to every menuitem, it's tedious
> process, and new item don't get it automatically.
>
> I'm thinking about using menu hook to solve this. I can think of two
> implementation:
>
> 1. Function interface
>
> We can install hooks, which get called just before the menu is invoked.
>
> 2. Script interface
>
> We can use certain variable to specific the command to use, for example:
>
> set MENU_PRELOAD=save_env default

Wouldn't this be a BOOT_PRELOAD?

I thought about this before (see archives about scripting), making it
possible for the user to add hooks.

In C:

... menu code ...
/* The `menu' hook has one argument.  */
grub_hook_invoke ("menu", 1, arglist);


In scripting:

function menu_hook_handler()
  save_env;

hook --register --hook=menu --script menu_hook_handler

Or do you think I am crazy now? ;-)

This will involve some scripting hacking, but might pay off.  Do you
think this is too complex for users?




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

Reply via email to