Page MenuHomeFreeBSD

loader: lua: remove the default kernel if it doesn't exist
ClosedPublic

Authored by kevans on Dec 8 2023, 5:16 AM.
Tags
None
Referenced Files
F132109424: D42967.id.diff
Mon, Oct 13, 7:18 PM
F132109420: D42967.id131335.diff
Mon, Oct 13, 7:18 PM
F132109419: D42967.id131161.diff
Mon, Oct 13, 7:18 PM
Unknown Object (File)
Mon, Oct 13, 5:56 AM
Unknown Object (File)
Sun, Oct 12, 3:13 AM
Unknown Object (File)
Mon, Sep 29, 10:24 AM
Unknown Object (File)
Fri, Sep 26, 10:51 PM
Unknown Object (File)
Aug 30 2025, 8:58 AM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable