From 809edb3636a5494ad7d3dfff910e0aab89d83442 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 29 Jul 2024 16:57:13 -0600 Subject: [PATCH] Revert "loader/lua: Remove workaround for command_error" This reverts commit 552f3072af54820cf1805f712e2567bc1b7f046d. loader.command_error was added just after 11.2, but appears to not have been back ported to 11.x. 11.0 was the first lua loader release, so keep this compat shim until we sort out what to do. MFC After: 3 days Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D45883 --- stand/lua/config.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stand/lua/config.lua b/stand/lua/config.lua index ba6144364247..86f5ef6174a2 100644 --- a/stand/lua/config.lua +++ b/stand/lua/config.lua @@ -407,7 +407,12 @@ local function loadModule(mod, silent) end if cli_execute_unparsed(str) ~= 0 then - print(loader.command_error()) + -- XXX Temporary shim: don't break the boot if + -- loader hadn't been recompiled with this + -- function exposed. + if loader.command_error then + print(loader.command_error()) + end if not silent then print("failed!") end