Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KSrUY-0001Kx-2a for mharc-grub-devel@gnu.org; Tue, 12 Aug 2008 06:52:43 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSrUU-0001KG-83 for grub-devel@gnu.org; Tue, 12 Aug 2008 06:52:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSrUP-0001Jt-Nb for grub-devel@gnu.org; Tue, 12 Aug 2008 06:52:35 -0400 Received: from [199.232.76.173] (port=48164 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSrUP-0001Jg-4a for grub-devel@gnu.org; Tue, 12 Aug 2008 06:52:33 -0400 Received: from ti-out-0910.google.com ([209.85.142.186]:30943) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KSrUO-0001TI-C0 for grub-devel@gnu.org; Tue, 12 Aug 2008 06:52:32 -0400 Received: by ti-out-0910.google.com with SMTP id u5so1216150tia.10 for ; Tue, 12 Aug 2008 03:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Al1SVlE+P8XcNaq2BBa5nZgT5fFVAe33ic8tva9zG1A=; b=IKMMYi/sbTj43fwvnDW4kyn9gGLoMlIF2Wls8ahsvsZ33tnXPJ+cOiTtySmlDgvc7g vn13GwkCbfc/UsTKqqWWUvc2BXZu7w14PYIHuQkSZarDztQk4y7BAQQ2mLAk0EWKegT6 5HnaKI/6snudukqFRBA0d6LzsUuJ6O6n0Lzsg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=MdAfYI4GVrW1UfTSyMr17xHpRgjdEJhlvANO1A0CJS9Q4oycOitslJjoJgtUiZngKA hN/1DXsVmufpP0oeA6pKLVfnhz8guhqZEaeSQTOqH0AMU+8afI4zgMm2euCXNezoyRlX MarCwl5bTkmy990x5aFYjUbj911Y78IEDf2L0= Received: by 10.110.31.5 with SMTP id e5mr1584601tie.1.1218538350484; Tue, 12 Aug 2008 03:52:30 -0700 (PDT) Received: by 10.110.16.5 with HTTP; Tue, 12 Aug 2008 03:52:30 -0700 (PDT) Message-ID: Date: Tue, 12 Aug 2008 18:52:30 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <20080812104445.GA3930@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080811213240.GF6883@thorin> <20080812085213.GA381@thorin> <20080812101521.GA3022@thorin> <20080812104445.GA3930@thorin> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: Idea: use menu hook to implement the savedefault command X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2008 10:52:38 -0000 On Tue, Aug 12, 2008 at 6:44 PM, Robert Millan wrote: > On Tue, Aug 12, 2008 at 06:38:08PM +0800, Bean wrote: >> > >> > My idea was to implement unlock in scripting. So you could do something like: >> > >> > menuentry unlock { >> > echo Password: >> > read user_pass >> > if [ $user_pass = foo ] ; then >> > unset menu_lock >> > fi >> > } >> > >> > but Okuji had some objections to this (see the thread I pasted) >> >> Hi, >> >> I know that, but isn't "unlock" another menu item which would normally >> be locked by menu_lock ? You can hard coded it to ignore the "unlock" >> menu, but what if user want to use another name. > > My patch only implements "locking" in the sense that you can't get access to > command-line, or edit menuentries, but you can run all existing entries. > > If you want to "lock" in the sense of locking a single entry, my intention > was that this could be done with scripting as well: > > menuentry locked { > if [ $menu_lock = 1 ] ; then > echo fail > else > blah > fi > } > > Is that what you mean? Hi, Oh, I see. I thought you lock the menu as well. -- Bean