git: 8e727fb47afa - main - loader: Add loader_autoboot_show

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Thu, 17 Apr 2025 08:19:39 UTC
The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=8e727fb47afaaa61a39a24d24d58ff0061fe87d9

commit 8e727fb47afaaa61a39a24d24d58ff0061fe87d9
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2025-04-14 06:37:22 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2025-04-17 08:18:20 +0000

    loader: Add loader_autoboot_show
    
    It's used to control if the autoboot part of loader is displayed or not.
    
    Differential Revision:  https://reviews.freebsd.org/D49819
    Reviewed by:    imp
    Sponsored by:   Beckhoff Automation GmbH & Co. KG
---
 stand/defaults/loader.conf.5 |  4 ++++
 stand/lua/menu.lua           | 11 +++++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/stand/defaults/loader.conf.5 b/stand/defaults/loader.conf.5
index 5ef54ee2c5d0..a364030b8814 100644
--- a/stand/defaults/loader.conf.5
+++ b/stand/defaults/loader.conf.5
@@ -410,6 +410,10 @@ be displayed.
 If set to
 .Dq YES ,
 the beastie boot menu will be skipped.
+.It Va loader_autoboot_show Pq Dq Li YES
+If set to
+.Dq NO ,
+the autoboot menu will not be displayed
 .It Va loader_logo Pq Dq Li orbbw
 Selects a desired logo in the beastie boot menu.
 Possible values are:
diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua
index 7c36b6c8d3c8..fb0645eb46ba 100644
--- a/stand/lua/menu.lua
+++ b/stand/lua/menu.lua
@@ -541,6 +541,7 @@ end
 function menu.autoboot(delay)
 	local x = loader.getenv("loader_menu_timeout_x") or 4
 	local y = loader.getenv("loader_menu_timeout_y") or 24
+	local autoboot_show = loader.getenv("loader_autoboot_show") or "yes"
 	local endtime = loader.time() + delay
 	local time
 	local last
@@ -548,10 +549,12 @@ function menu.autoboot(delay)
 		time = endtime - loader.time()
 		if last == nil or last ~= time then
 			last = time
-			screen.setcursor(x, y)
-			printc("Autoboot in " .. time ..
-			    " seconds. [Space] to pause ")
-			screen.defcursor()
+			if autoboot_show == "yes" then
+			   screen.setcursor(x, y)
+			   printc("Autoboot in " .. time ..
+				  " seconds. [Space] to pause ")
+			   screen.defcursor()
+			end
 		end
 		if io.ischar() then
 			local ch = io.getchar()