]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
loader: lua: remove the default kernel if it doesn't exist
authorKyle Evans <kevans@FreeBSD.org>
Wed, 13 Dec 2023 16:52:14 +0000 (10:52 -0600)
committerKyle Evans <kevans@FreeBSD.org>
Wed, 3 Jan 2024 04:47:27 +0000 (22:47 -0600)
commit1b959537ed3a8d8dd300c8867fc0e34f062fafa9
tree7f794df39d4d87e0c4999994a2ea7accbcac457e
parentee0e6ac14776ca4c131d2178e790a3c4d85c682f
loader: lua: remove the default kernel if it doesn't exist

The `kernel` env var provides the default kernel, usually "kernel".  It
may be the case that the user doesn't have a "kernel" kernel, just
"kernel.*" kernels, but have left `kernel` to the default because we
autodetect entries by default anyways.

If we're doing autodetection, take note of whether the default kernel
exists or not and remove it from the list if it doesn't and we had found
any other kernels.  We avoid it in the #kernels == 1 case because
something fishy has likely happened and we should just trust the
configuration.

Reviewed by: imp, manu
Differential Revision: https://reviews.freebsd.org/D42967

(cherry picked from commit d04415c520b031fb8eb93cb252e4acee66149c87)
stand/lua/core.lua