Re: Revisiting the section 4 manual pages loader.conf boilerplate language?

From: Bjoern A. Zeeb <>
Date: Sat, 04 Jun 2022 07:18:18 UTC
On Fri, 3 Jun 2022, Pau Amma wrote:


> Currently, 3 section 4 manual pages say to use kld_list in rc.conf for 
> loading: acpi_video(4), iwlwifi(4), and rtw88(4). Contrasting this with 367 
> following share/examples/mdoc/example.4's lead and instructing to use 
> loader(8)-time loading, the current approach appears to be: loader(8)-time 
> unless it needs rc(8)-time loading (explicitly discouraged for iwlwifi(4) and 
> rtw88(4), which say to rely on devmatch(8) if at all possible). However, this 
> may not be the best idea, considering:
> rc.conf(5):
>     kld_list    (str) A list of kernel modules to load right after the local
>                 disks are mounted.  Loading modules at this point in the 
> boot
>                 process is much faster than doing it via /boot/loader.conf
>                 for those modules not necessary for mounting local disk.
> devmatch(8) itself, as already mentioned, which aims to make explicit loading 
> (either way) unnecessary in most cases;
> several Freenode^WLibera #freebsd discussions, in at least one of which 
> kevans stated that rc(8) loading was much safer, especially for large modules 
> or drivers.

What was the cause for that assumption?  I assume that both just run kldload.

> So I think the default suggestion should be changed from loader.conf to 
> rc.conf, or maybe to; devmatch preferred, or rc.conf if not an option.
> Thoughts?

The problem is more tricky.  Not all drivers do provide data for
devmatch to work yet.

Also some drivers do want to be loaded from loader and not later as
they might be essential for booting to multi-user.

I am generally tempted to remove the boiler plate from almost all man
pages (once the driver supports devmatch) and have a separate man page
to point at for how (many ways) to load a driver, possibly along (if it
needs special requirements) a suggested hint of which way to use.
In other words: unless the driver has special requirements add an .Xr
at the bottom to See Also which points at a (new) man page and be
done.  Why?

My understanding is that most of this is part of an effort started but
never fully finished to
(a) make GENERIC minial -- everything you may not need to boot to
     multi-user should be loadable by devmatch or kld_list (the latter
     mostly being there for non-devmatch supported drivers these days
     or a driver having special requirements) and
(b) to give the user a seemless experience where drivers for components
     supported would just show up without any configuration (hence preference
     of devmatch vs. kld_list).
(c) Lastly there are cases when modules cannot be loaded anymore after
     loader (or in case of kernels without module support).  This is
     often used for netbooting or with / on a memory disk or in
     security environments.  But also (vendor) strage drivers were
     examples as you want to be able to access the disks holding your
     base system.

Based on this I started to discourage loader loading and after having
devmatch support also kld_list usage in the man pages for iwlwifi and

Just my 0.5ct

Bjoern A. Zeeb                                                     r15:7