Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Feb 2021 09:22:25 -0600
From:      Kyle Evans <kevans@freebsd.org>
To:        Eugene Grosbein <eugen@grosbein.net>
Cc:        src-committers <src-committers@freebsd.org>,  "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, dev-commits-src-main@freebsd.org
Subject:   Re: git: 866c8b8d5ddb - main - kldload(8): Add note about using kld_list in rc.conf(5)
Message-ID:  <CACNAnaGte5LpzWJt1%2BfxYV%2BSKz9kMp13U4FyM0si%2BFcRQUytPA@mail.gmail.com>
In-Reply-To: <33d6f518-2005-e859-0230-34490c3c5914@grosbein.net>
References:  <202102080704.11874w7E017472@gitrepo.freebsd.org> <CANCZdfrJjBxDwM5gpccDbAJEhw_HBT7eq%2B2Tfd-kTxEo9_DitA@mail.gmail.com> <d9acb4ee-5ea4-b006-6fa0-86da8d369eda@grosbein.net> <CACNAnaF0xpfOodU=B4c91sA4za=-wfRgTY_MiJtr9TZuMNpoHw@mail.gmail.com> <f832f431-f151-bc47-948c-fded131e0766@grosbein.net> <CACNAnaFkywYo7bU8GyPYdTzCH4Xy-s4F38beBwJee5k4Odkdsg@mail.gmail.com> <33d6f518-2005-e859-0230-34490c3c5914@grosbein.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 8, 2021 at 9:07 AM Eugene Grosbein <eugen@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaGte5LpzWJt1%2BfxYV%2BSKz9kMp13U4FyM0si%2BFcRQUytPA>