While d04415c520b03 fixed PR 292232, the code in core.kernelList() was testing for directories in a way that prevented symlinks from being followed. This prevents a kernel symlink from being considered "bootable" which results in a random kernel not named "kernel" being booted. (Random because the list of potentially bootable kernels is in unsorted/filesystem order.) This means when I attempt to boot kernel/kernel.LBL in the above example, I get kernel.GENERIC instead. core.kernelList() has two checks to see if a candidate file is a "directory", first is the ftype returned by lfs.dir() (which doesn't follow symlinks) and the other is via lfs.attributes() (which does follow symlinks): for file, ftype in lfs.dir("/boot") do local fname = "/boot/" .. file if file == "." or file == ".." then goto continue end if ftype then if ftype ~= lfs.DT_DIR then goto continue end elseif lfs.attributes(fname, "mode") ~= "directory" then goto continue end The fix is to remove the first check. Here's a differential that solves this by my testing: https://reviews.freebsd.org/D55713
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e6d579be42550f366cc85188b15c6eb0cad27367 commit e6d579be42550f366cc85188b15c6eb0cad27367 Author: Craig Leres <leres@FreeBSD.org> AuthorDate: 2026-03-09 21:47:10 +0000 Commit: Craig Leres <leres@FreeBSD.org> CommitDate: 2026-03-09 21:47:47 +0000 core.lua: follow symlinks when looking for bootable kernels PR: 293654 Reviewed by: kevans Approved by: kevans Differential Revision: https://reviews.freebsd.org/D55713 stand/lua/core.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
This is a good candidate for MFC to both stable/15 and stable/14 -- would you like to do it, or would you like me to just take it with bc531a96c9b28b1cabcd5d that modified lfs?
Thanks, and if this report is reopened (for MFC) please consider changing line 72 at <https://github.com/freebsd/freebsd-doc/blob/63dfaea2e2fb383d06b63868dff0316308ed1f82/website/content/en/releases/14.4R/errata.adoc?plain=1#L63-L72>. <https://www.freebsd.org/releases/14.4R/errata/#open-issues>
The fact that this hit 14.4 didn't really settle in until after I made that last comment- symlinked /boot/kernel probably isn't /that/ common of a setup, but I don't like the idea of leaving it broken. Taking for the moment as I'll write up the errata notice, then pass it over to secteam@ for consideration.
(In reply to Kyle Evans from comment #2) Sure, it makes sense to bundle the two fixes. Plus it's an opportunity to remove the magic number from core.lua.
(In reply to Craig Leres from comment #5) > Sure, it makes sense to bundle the two fixes. It will be done. > Plus it's an opportunity to remove the magic number from core.lua. Unfortunately, the magic number likely has a 2-3 year lifespan. We don't auto-update loader on the ESP, so we've had some problems with the disconnect caused by folks not doing it themselves (the documentation around this is admittedly not great, last I checked).
(In reply to Kyle Evans from comment #6) Is the loaders-update port a good way to keep boot loaders up to date?
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=1841091eaa0b2e1f71600c892d3ce041a57bae3c commit 1841091eaa0b2e1f71600c892d3ce041a57bae3c Author: Craig Leres <leres@FreeBSD.org> AuthorDate: 2026-03-09 21:47:10 +0000 Commit: Craig Leres <leres@FreeBSD.org> CommitDate: 2026-06-16 23:48:16 +0000 core.lua: follow symlinks when looking for bootable kernels PR: 293654 Reviewed by: kevans Approved by: kevans Differential Revision: https://reviews.freebsd.org/D55713 (cherry picked from commit e6d579be42550f366cc85188b15c6eb0cad27367) stand/lua/core.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=8c78774107a7f0434791efd3f99397cb5562a70d commit 8c78774107a7f0434791efd3f99397cb5562a70d Author: Craig Leres <leres@FreeBSD.org> AuthorDate: 2026-03-09 21:47:10 +0000 Commit: Craig Leres <leres@FreeBSD.org> CommitDate: 2026-06-16 23:49:30 +0000 core.lua: follow symlinks when looking for bootable kernels PR: 293654 Reviewed by: kevans Approved by: kevans Differential Revision: https://reviews.freebsd.org/D55713 (cherry picked from commit e6d579be42550f366cc85188b15c6eb0cad27367) stand/lua/core.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)