Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 07 Mar 2026 21:52:08 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 293654] boot loader kernels_autodetect no longer follows symlinks after 14.4-RELEASE
Message-ID:  <bug-293654-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293654

            Bug ID: 293654
           Summary: boot loader kernels_autodetect no longer follows
                    symlinks after 14.4-RELEASE
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: leres@freebsd.org

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

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-293654-227>