Bug 245532 - /boot/kernel vs. loader.8
Summary: /boot/kernel vs. loader.8
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.1-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: Warner Losh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-11 10:48 UTC by Helge Oldach
Modified: 2021-07-14 03:10 UTC (History)
2 users (show)

See Also:


Attachments
boot menu without /boot/kernel prepended to module_path (7.04 KB, image/png)
2021-07-14 02:59 UTC, Helge Oldach
no flags Details
Even after loading kernel, /boot/kernel is not prepended to module_path (7.04 KB, image/png)
2021-07-14 03:10 UTC, Helge Oldach
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Helge Oldach 2020-04-11 10:48:26 UTC
loader.8 states module_path is set to "/boot/kernel;/boot/modules" by default. However, stand/defaults/loader.conf sets this to "/boot/modules;/boot/dtb;/boot/dtb/overlays".
Worse, stand/common/help.common explains the default module_path is "/boot/modules" with the kernel directory prepended.

This is not consistent.

Also, neither is really correct. In fact the kernel directory is NOT prepended on my STABLE-12 machine, and loading standard modules from the default kernel directory /boot/kernel does not work.
Comment 1 Warner Losh freebsd_committer freebsd_triage 2021-07-13 21:55:43 UTC
/boot/kernel is added to the front of the list for the kernel,
though that's not in the default settings because it depends
on where you are loading your kernel from.

And the boot loader does preferentially load from there first,
even though it's not in the list of directories.

Having said that, the docs are still woefully out of date
and do need to be updated.
Comment 2 Helge Oldach 2021-07-14 02:59:17 UTC
Created attachment 226439 [details]
boot menu without /boot/kernel prepended to module_path

I'm afraid I cannot observe having /boot/kernel prepended to module_path... This is a stock /boot setup with MINIMAL-like kernel, with just a tiny /boot/loader.conf loading a few additional modules.

(Sorry for the screenshot; I don't have a serial console handy at present.)
Comment 3 Helge Oldach 2021-07-14 03:10:15 UTC
Created attachment 226440 [details]
Even after loading kernel, /boot/kernel is not prepended to module_path

...which makes loading additional modules manually a bit awkward as one has to type the full path of the module. I vaguely remember that has been different years ago: Once the kernel was loaded, additional modules could just be loaded from the kernel's location by mentioning the module name (e.g. ahci.ko).