git: 866c8b8d5ddb - main - kldload(8): Add note about using kld_list in rc.conf(5)

Kyle Evans kevans at freebsd.org
Mon Feb 8 15:22:39 UTC 2021


On Mon, Feb 8, 2021 at 9:07 AM Eugene Grosbein <eugen at grosbein.net> wrote:
>
> 08.02.2021 21:58, Kyle Evans wrote:
>
> >>>> kld_list cannot do that.
> >>>
> >>> Huh? kld_list accepts a full pathname, which is the same kind of
> >>> specification you'd need to do with one from port in loader with
> >>> *_name.
> >>
> >> Good, but seems to be undocumented.
> >>
> >
> > In what sense? Is there some other place that kld_list is even
> > documented than kldload(8)?
>
> Naturally: rc.conf(5), also in /etc/defaults/rc.conf
>

Wow, that documentation is just flat wrong for multiple reasons.

     kld_list    (str) A whitespace-separated list of kernel modules to load
                 right after the local disks are mounted, without any .ko
                 extension or path.  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 disks.

The second part of the first sentence is a self-imposed limitation,
and an incredibly unimportant one at that. Specifying a .ko will only
break the existing "Is it loaded" behavior and cause it to always try,
which is mostly a nuisance at best because it will get rejected if the
kldstat inquiry is wrong -- the kld rc script will append .ko whether
the path has one or not, so this should be fixed. Despite that, a path
will work just fine for the most part; kldstat -v shows the fully
qualified path. If it wanted to be improved, it just needs to basename
what it was given to be able to detect if it was loaded from any other
path and pass that in as the -e argument to load_kld if it really was
a file.

It's not wrong about loading modules being faster here, and at some
point in the past it was even necessary due to loader(8) being too
early or problematic in some terrible cases (e.g. nvidia modsetting
bits), but the second half of that sentence should probably just be
omitted or reworked to more vaguely refer to "... those modules not
necessary for booting the system, including those required for
mounting the root filesystem." The key changes being that there are
other reasons you might need to load something early enough in boot,
and that root isn't always a local disk. It's OK to call out the more
common case for folks, but this feels a lot more absolute than it
needs to be.


More information about the dev-commits-src-main mailing list