aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2026-01-07 18:20:05 +0000
committerKyle Evans <kevans@FreeBSD.org>2026-01-20 04:08:11 +0000
commit4f0342cf84dbe4fadbfea02e3279aafab36ea848 (patch)
tree9a26064c14c0aa23d4c8620481f5418497b3b7b7
parent919c1e19058d2e214fa3c33498123adb6ca3366c (diff)
lualoader: fix pruning of non-existent default kernel
Removing the kernel from the list of available kernels is sufficient to avoid rendering it in the list, but we need more for booting to actually work. Notably, the 'kernel' loader.conf var was left intact to its default value, so if one didn't use the kernel selector in the menu then we'd try to boot the nonexistent 'kernel' instead of the new default (first autodetected). There's room to improve the error messages here, but for now let's just make it actually work correctly. PR: 292232 Fixes: d04415c520b03 ("loader: lua: remove the default kernel [...]") (cherry picked from commit e30086ab4c8778ea70a3b19e83546ce1b4a16492)
-rw-r--r--stand/lua/core.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/stand/lua/core.lua b/stand/lua/core.lua
index d66d9719fdcb..ccd8213a718d 100644
--- a/stand/lua/core.lua
+++ b/stand/lua/core.lua
@@ -287,6 +287,12 @@ function core.kernelList()
kernels[n] = kernels[n + 1]
end
end
+
+ -- The config/boot bits use the env var as a fallback if the
+ -- menu's kernel selector remains untouched, so we want to
+ -- update our notion of the default kernel to one that is
+ -- actually present.
+ loader.setenv("kernel", kernels[1])
end
core.cached_kernels = kernels