Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VK6m8-00064y-23 for mharc-grub-devel@gnu.org; Thu, 12 Sep 2013 09:17:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VK6m4-00063p-AD for grub-devel@gnu.org; Thu, 12 Sep 2013 09:17:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VK6m1-0000Wr-8k for grub-devel@gnu.org; Thu, 12 Sep 2013 09:17:32 -0400 Received: from v6.chiark.greenend.org.uk ([2001:ba8:1e3::]:36998 helo=chiark.greenend.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VK6m1-0000UE-1v for grub-devel@gnu.org; Thu, 12 Sep 2013 09:17:29 -0400 Received: from [172.20.153.9] (helo=riva.pelham.vpn.ucam.org) by chiark.greenend.org.uk (Debian Exim 4.72 #1) with esmtps (return-path cjwatson@ubuntu.com) id 1VK6lz-00041t-RX; Thu, 12 Sep 2013 14:17:27 +0100 Received: from ns1.pelham.vpn.ucam.org ([172.20.153.2] helo=riva.ucam.org) by riva.pelham.vpn.ucam.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1VK6ly-0001Vp-Ub; Thu, 12 Sep 2013 14:17:27 +0100 Date: Thu, 12 Sep 2013 14:17:25 +0100 From: Colin Watson To: Andrey Borzenkov Subject: Re: [RFC][PATCH] Allow hotkeys to interrupt hidden menu Message-ID: <20130912131725.GQ32337@riva.ucam.org> References: <20130911131804.GA10979@riva.ucam.org> <20130912064419.125c0bfa@opensuse.site> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20130912064419.125c0bfa@opensuse.site> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:ba8:1e3:: Cc: The development of GNU GRUB , Franz Hsieh X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2013 13:17:33 -0000 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 [cjwatson@ubuntu.com]