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 [cjwat...@ubuntu.com] _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel