From owner-svn-src-head@freebsd.org Wed Feb 21 17:33:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF242F1829A; Wed, 21 Feb 2018 17:33:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8541E87E70; Wed, 21 Feb 2018 17:33:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8046C1B9C4; Wed, 21 Feb 2018 17:33:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1LHX1qS094339; Wed, 21 Feb 2018 17:33:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1LHX1Fo094338; Wed, 21 Feb 2018 17:33:01 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802211733.w1LHX1Fo094338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 21 Feb 2018 17:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329734 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Feb 2018 17:33:02 -0000 Author: kevans Date: Wed Feb 21 17:33:01 2018 New Revision: 329734 URL: https://svnweb.freebsd.org/changeset/base/329734 Log: lualoader: Don't execute menu.autoboot() for every opened menu Attempt to autoboot when we open the default menu, and only when we open the default menu. This alleviates the need for checking menu.already_autoboot, because we're not trying to autoboot every time we open a submenu. I note that escaping to loader prompt and going back to the menu (by running require('menu').run() at the loader prompt) will happily work and not re-initiate the autoboot sequence since "Escape to loader prompt" disables the autoboot_delay. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Wed Feb 21 16:57:03 2018 (r329733) +++ head/stand/lua/menu.lua Wed Feb 21 17:33:01 2018 (r329734) @@ -361,8 +361,10 @@ function menu.run(m) local alias_table = drawer.drawscreen(m) -- Might return nil, that's ok - local autoboot_key = menu.autoboot() - + local autoboot_key; + if m == menu.default then + autoboot_key = menu.autoboot() + end cont = true while cont do local key = autoboot_key or io.getchar() @@ -430,11 +432,6 @@ function menu.skip() end function menu.autoboot() - if menu.already_autoboot then - return nil - end - menu.already_autoboot = true - local ab = loader.getenv("autoboot_delay") if ab ~= nil and ab:lower() == "no" then return nil