git: b38a82c77ab9 - main - Revert "loader/lua: Remove pager shim"

From: Warner Losh <imp_at_FreeBSD.org>
Date: Mon, 29 Jul 2024 22:57:27 UTC
The branch main has been updated by imp:

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

commit b38a82c77ab90eace53c56151b191efd1f4a8439
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-07-29 22:56:55 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-07-29 22:56:55 +0000

    Revert "loader/lua: Remove pager shim"
    
    This reverts commit 8b9178cd0d35ff2beafebdd51c8c44ba2b5aeb0f.
    
    Really old loader.efi files persist in the field. Revert this to support
    it. We need to support this through at least 14.2 now, alas.
    
    MFC After:              3 days
    Sponsored by:           Netflix
    Reviewed by:            kevans
    Differential Revision:  https://reviews.freebsd.org/D45881
---
 stand/lua/cli.lua | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/stand/lua/cli.lua b/stand/lua/cli.lua
index 596e55a8d1d8..6832da0a31a5 100644
--- a/stand/lua/cli.lua
+++ b/stand/lua/cli.lua
@@ -30,6 +30,18 @@ local core = require("core")
 
 local cli = {}
 
+if not pager then
+	-- shim for the pager module that just doesn't do it.
+	-- XXX Remove after 12.2 goes EoL.
+	pager = {
+		open = function() end,
+		close = function() end,
+		output = function(str)
+			printc(str)
+		end,
+	}
+end
+
 -- Internal function
 -- Parses arguments to boot and returns two values: kernel_name, argstr
 -- Defaults to nil and "" respectively.