mirror of
https://git.freebsd.org/src.git
synced 2026-01-11 19:57:22 +00:00
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: d04415c520 ("loader: lua: remove the default kernel [...]")
This commit is contained in:
parent
47015e4546
commit
e30086ab4c
1 changed files with 6 additions and 0 deletions
|
|
@ -289,6 +289,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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue