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
Unknown Object (File)
Tue, Aug 5, 3:35 PM
Unknown Object (File)
Tue, Aug 5, 4:09 AM
Unknown Object (File)
Sun, Aug 3, 8:29 AM
Unknown Object (File)
Sat, Aug 2, 7:09 AM
Unknown Object (File)
Fri, Aug 1, 8:33 AM
Unknown Object (File)
Jul 21 2025, 8:43 PM
Unknown Object (File)
Jul 13 2025, 4:24 AM
Unknown Object (File)
Jul 5 2025, 7:48 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