From: Marco Gerards <mgerards@xs4all.nl>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Idea: use menu hook to implement the savedefault command
Date: Wed, 13 Aug 2008 12:31:21 +0200 [thread overview]
Message-ID: <87od3x8ava.fsf@xs4all.nl> (raw)
In-Reply-To: <ca0f59980808111403k6de00ae8gea8634d098449b85@mail.gmail.com> (bean123ch@gmail.com's message of "Tue, 12 Aug 2008 05:03:10 +0800")
Bean <bean123ch@gmail.com> 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?
next prev parent reply other threads:[~2008-08-13 10:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-11 21:03 Idea: use menu hook to implement the savedefault command Bean
2008-08-11 21:32 ` Robert Millan
2008-08-12 1:27 ` Bean
2008-08-12 8:52 ` Robert Millan
2008-08-12 9:38 ` Bean
2008-08-12 10:15 ` Robert Millan
2008-08-12 10:38 ` Bean
2008-08-12 10:44 ` Robert Millan
2008-08-12 10:52 ` Bean
2008-08-13 10:31 ` Marco Gerards [this message]
2008-08-13 11:36 ` Javier Martín
2008-08-13 11:48 ` Robert Millan
2008-08-13 12:11 ` Javier Martín
2008-08-13 12:38 ` Robert Millan
-- strict thread matches above, loose matches on Subject: below --
2008-08-11 21:02 Bean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87od3x8ava.fsf@xs4all.nl \
--to=mgerards@xs4all.nl \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.