grub-devel
[Top][All Lists]
Advanced

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

Re: [RFC][PATCH] Allow hotkeys to interrupt hidden menu


From: Colin Watson
Subject: Re: [RFC][PATCH] Allow hotkeys to interrupt hidden menu
Date: Thu, 12 Sep 2013 14:17:25 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Sep 12, 2013 at 06:44:19AM +0400, Andrey Borzenkov wrote:
> В Wed, 11 Sep 2013 14:18:04 +0100
> > +int
> > +grub_menu_get_hotkey (void)
> > +{
> > +  char *val;
> > +  int hotkey;
> > +
> > +  val = grub_env_get ("hotkey");
> > +  if (! val)
> > +    return -1;
> > +
> > +  grub_error_push();
> > +
> > +  hotkey = (int) grub_strtoul (val, 0, 10);
> > +
> > +  /* If the value is invalid, unset the variable.  */
> 
> Why only if invalid? This is one time event which should be reset as
> soon as it is consumed.

Agreed.

> Actually I'm not sure if user visible environment variable is needed at
> all - just make it a global variable in normal.mod. 

This goes back to what I was saying about sleep.mod not being sensibly
able to depend on normal.mod, so in order to do this kind of this we
either need shared code in the kernel (best avoided) or a new module
common to both.

(Or we could do something like exporting grub_dl_resolve_symbol so that
we have dlsym-like functionality.  But this is starting to look rather
baroque just for the sake of avoiding a transient environment variable,
IMO.)

-- 
Colin Watson                                       address@hidden



reply via email to

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