Skip to contentSkip to conversation

Support event handling in grub2

RFC Bean 1 participant 1 message Mar 4, 2009

lore
Share & tools
lore

Bean

author
#0 lore raw

Hi,

Currently, there is no mechanism to support running command at a specific event, such as, whenever a menu is selected, this makes it difficult to implement functions like savedefault or password. I sugguest the following model.

First, UI components register events, which is a subclass of named list:

struct grub_event
{
next;
name;
event_list;
};

It then fires the event at apropriate time:

grub_err_t grub_dispatch_event (struct grub_event *);

Also add a command "event" to let user assign action to a event, something like this:

event list [event_name]
event insert event_name command [arguments]
event remove event_name command

With this, safedefault could be implemented as:

event insert menu_select save_env default

Signature · 1 line
Bean