Page MenuHomeFreeBSD

Change default value of kernel.bootfile

Authored by gonzo on Jan 20 2019, 6:24 AM.



In most cases kernel.bootfile is populated from the information
provided by loader(8). There are certain scenarios when loader
is not available, for instance when kernel is loaded by u-boot
or some other BootROM directly. In this case the default value
"/kernel" points to invalid location and breaks certain functinality,
like using installkernel on self-hosted system or dtrace's CTF
lookup. This can be fixed by setting the value manually but I think
changing the default to "/boot/kernel/kernel" is better approach.

Current default was set before 1996, when "/kernel" was the
actual path I guess.

See also:

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

gonzo created this revision.Jan 20 2019, 6:24 AM
ian accepted this revision.Mar 24 2019, 7:34 PM

I can't think of any situation where /kernel is right, or where providing a wrong answer is better than providing the modern default (which could also be wrong, but no more wrong than /kernel has been for 20+ years now).

This revision is now accepted and ready to land.Mar 24 2019, 7:34 PM
imp accepted this revision.Mar 24 2019, 9:15 PM

Defaults should match defaults. If we don't know, guess the default FFS.

imp added a comment.Mar 24 2019, 9:20 PM

Current default was set before 1996, when "/kernel" was the
actual path I guess.

4.4BSD defaulted to /vmunix as the kernel, as did 386BSD, I believe.

/kernel was the default starting around FreeBSD 1.0 (I think it wad decided just before the actual release, my suggestion of vmduck (if it walks like a duck and quacks like a duck) being rejected. It stayed that way until around 3.0 when the new tertiary loader came into the tree (what we know today as /boot/loader). At that point, mostly because we supported loadable modules, and because loadable modules were mated to the kernel, we transitioned to /boot/$KERNEL/kernel with all the modules living there. For a while modules lived in /boot/modules and there was a weak notion that /boot might be the UEFI ESP soon, though that never really became a thing for a variety of reasons.

Which is another way of saying: this wasn't changed to be the new default at the time, though it likely should have been. I don't recall that change being simply rejected, or if it was an oversight papered over by a functioning /boot/loader on this detail :)

imp added a comment.Mar 25 2019, 6:47 AM

My mistake... 386bsd booted from a file named /386bsd. FreeBSD changed that early on to be /kernel.

This revision was automatically updated to reflect the committed changes.