Re: Kernel modules not loading on 15-prerelease

From: Mark Millard <marklmi_at_yahoo.com>
Date: Sat, 06 Sep 2025 17:16:03 UTC
On Sep 6, 2025, at 08:18, bob prohaska <fbsd@www.zefox.net> wrote:

> On Fri, Sep 05, 2025 at 09:17:06AM -0700, Mark Millard wrote:
>> 
>>> Run # make cleanworld once.
>> 
>> In your odd context, "make clean" may well be better
>> for before starting the builds.
> 
> Interestingly, "make clean" wasn't successful, but make 
> cleandir resulted in a new build of kernel and modules.

There is cleankernel and cleanworld as well.

Good to know that clean does not do what I was thinking.
Thanks.

>>> If objects don't have .meta files then META_MODE won't do the right thing on an incremental build. 1
>>> FreeBSD buildworld will now create meta files to improve the performance of future builds.
>> 
>> So: how to get a valid kernel/module-set without
>> first building all of the world:
>> 
>> FIRST: deal with having /etc/src-env.conf include a
>> line with:
>> 
>> WITH_META_MODE=
>> 
>> (Your choice if you want the YES or some text.)
>> 
>> NOTE: I make the assumption that you want to use
>>      /etc/src-env.conf instead of command line
>>      content.
> 
> As a matter of curiosity, is /usr/local/etc/src-env.conf
> in the search path? This seems like a local parameter.

# man 5 src.conf reports:

FILES
     /etc/src.conf
     /etc/src-env.conf
     /usr/share/mk/bsd.own.mk

and has no reference to: /usr/local/

Building and installing is meant to be possible
without /usr/local/ being populated with anything:
it is all system stuff, not ports or port packages.

/etc/fstab also has "local parameters", for example.
But /usr/local/etc/fstab is not a thing as far as I
know.

>> # cd /usr/src/ # (or where ever you have your source)
>> # make clean # not something that you would normally do

Maybe that should have been:

# make cleankernel # not something that you would normally do

>> # make kerneltoolchain
> 
> I'd forgotten about the kernel-toolchain target. That
> sped things up considerably.

If you want to update the kernel before building the
world, the partial system update by kerneltoolchain
allows getting to use of the new kernel sooner, for
sure.

The later buildworld still takes the time do do the
rest of the work for that. So, probably there is no
overall time savings.

>> NOTE: I do not know your detailed choices about handling
>>      kernel updates so you may have more related to the
>>      installkernel than I show. For example, you might
>>      deliberately keep a copy of the old kernel under
>>      some alternate name before updating the default
>>      named one. (There are other possibilities.)
> 
> Ordinarily, I do not. If trouble is expected I often 
> cp -R boot/kernel.old /boot/kernel.spare for an extra
> level of redundancy.

If the likes of just cleankernel was used earlier,
possibly here for your specific problem:

# make cleanworld # not something that you would normally do

before anything that leads to starting the buildworld .

>> kldload -n filemon
>> cd /usr/src/ # or my equivalent for a specific source tree
>> 
>> That is in order to establish context for later commands
>> in the script and for META_MODE use.
>> 
>> I happen to choose to not start filemon unless I'm
>> starting a system software build, avoiding any overhead
>> if I've not done any system builds yet.
> 
> That seems a good idea which never crossed my mind... 
> Is there any estimate how much overhead filemon imposes?

Unsure. My guess is that META_MODE (or other related if
used) are the only things registering a use of filemon .

But just being loaded uses memory in your small arm board,
1 GiByte of RAM, type of context, for example. When you
are not doing system builds, I've no clue if the memory
use is enough for you to care.

> Many thanks for your help. My misunderstanding of meta-mode
> use was rather profound.


===
Mark Millard
marklmi at yahoo.com