git: 59bfc69490ea - stable/14 - stand: Add "Loader needs updating" to the first menu item"

From: Warner Losh <imp_at_FreeBSD.org>
Date: Thu, 01 Aug 2024 14:50:32 UTC
The branch stable/14 has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=59bfc69490ea033d3c5eeb10c8ddd4aed4fbc4a9

commit 59bfc69490ea033d3c5eeb10c8ddd4aed4fbc4a9
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-07-29 22:57:37 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-08-01 14:49:54 +0000

    stand: Add "Loader needs updating" to the first menu item"
    
    When the boot loader version is too old, add a warning to the boot menu
    to maybe catch people's attention.
    
    Use the correct loader code that adds an inactive highlighted menu item
    indicating that an update is needed.
    
    Sponsored by:           Netflix
    Reviewed by:            jhb
    Differential Revision:  https://reviews.freebsd.org/D45890
    
    (cherry picked from commit 0eac99f76ec31270f902cc2a0ff5ae4b5b606a65)
    (cherry picked from commit 7cb65be96d47cbe0b740266bc633d272fc4c5e6b)
---
 stand/lua/menu.lua | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua
index 4a948acf8241..0587e5ae6586 100644
--- a/stand/lua/menu.lua
+++ b/stand/lua/menu.lua
@@ -263,6 +263,10 @@ menu.welcome = {
 			menu_entries.boot_envs,
 			menu_entries.chainload,
 			menu_entries.vendor,
+			{
+				entry_type = core.MENU_SEPARATOR,
+			},
+			menu_entries.loader_needs_upgrade,
 		}
 	end,
 	all_entries = {
@@ -411,6 +415,15 @@ menu.welcome = {
 			end,
 			alias = {"l", "L"},
 		},
+		loader_needs_upgrade = {
+			entry_type = core.MENU_SEPARATOR,
+			name = function()
+				return color.highlight("Loader needs to be updated")
+			end,
+			visible = function()
+				return core.loaderTooOld()
+			end
+		},
 		vendor = {
 			entry_type = core.MENU_ENTRY,
 			visible = function()