Page MenuHomeFreeBSD

Change default value of kernel.bootfile
ClosedPublic

Authored by gonzo on Jan 20 2019, 6:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 3:05 AM
Unknown Object (File)
Jan 24 2024, 9:37 PM
Unknown Object (File)
Jan 14 2024, 6:53 PM
Unknown Object (File)
Dec 22 2023, 10:29 PM
Unknown Object (File)
Dec 11 2023, 2:38 AM
Unknown Object (File)
Dec 4 2023, 7:26 AM
Unknown Object (File)
Nov 18 2023, 1:10 PM
Unknown Object (File)
Nov 18 2023, 10:47 AM
Subscribers
None

Details

Summary

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: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221550

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

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

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 :)

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.