Page MenuHomeFreeBSD

universe: emit warning instead of error for bad/missing KERNCONF
ClosedPublic

Authored by siva on Feb 27 2026, 6:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 4, 12:38 PM
Unknown Object (File)
Thu, Jun 4, 12:15 PM
Unknown Object (File)
Wed, Jun 3, 7:00 PM
Unknown Object (File)
Tue, Jun 2, 4:27 PM
Unknown Object (File)
Sat, May 30, 4:35 PM
Unknown Object (File)
Sat, May 30, 2:19 AM
Unknown Object (File)
Tue, May 26, 10:08 AM
Unknown Object (File)
Fri, May 22, 11:30 AM
Subscribers

Details

Summary

When doing a large make universe build with multiple KERNCONFS,
it should not be an error when a particular target has a missing
KERNCONF.

In this example,

$ make universe TARGETS='arm64 riscv' KERNCONFS='QEMU VIRT'

Currently, arm64 does not have a QEMU conf, and riscv
does not have a VIRT conf. However, this command should still
succeed instead of failing with the following message:

make[2]: /usr/src/Makefile:767: Target architecture for riscv/conf/VIRT unknown.  config(8) likely too old.
	in .for loop from /usr/src/Makefile:761 with kernel = VIRT
	in make[2] in directory "/usr/src"

make[2]: stopped making "universe_kernels" in /usr/src

Since the opposite is true, we should build whatever confs are available
from the requested list of KERNCONFS, while making sure to still
emit warnings along the way.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

siva requested review of this revision.Feb 27 2026, 6:01 PM
siva created this revision.

Any comments on this change?

This is likely OK. We can lose the config(8) too old part. That version is now unsupported (11 or 12 had it).

This revision is now accepted and ready to land.Mar 24 2026, 3:14 PM
This revision now requires review to proceed.Apr 7 2026, 8:43 PM

Anything else here? Should be good to go.

The config too old warning likely should go too, but that's not the scope of this.

This revision is now accepted and ready to land.Apr 24 2026, 3:39 PM
lwhsu added a subscriber: lwhsu.

IN general direction looks good to me: for a multi-target universe build with a shared KERNCONFS list, a KERNCONF that does not exist for a particular TARGET should not abort the entire build.

If I can do some nitpicking, we can distinguish the config missing case from other config(8) failures. An empty TARGET_ARCH_${kernel} can also mean that the KERNCONF exists but is invalid, has a bad include, has a malformed/unsupported machine directive, etc. I think only a warning for that would make universe build miss to catch broken in-tree kernel config.

Maybe we keep the warning only for the missing KERNCONF case, e.g. !exists(${KERNSRCDIR}/${TARGET}/conf/${kernel}), and keep emitting an error when the file exists but config -m still cannot determine TARGET_ARCH? i.e., something like this (not tested):

.if empty(TARGET_ARCH_${kernel})
.    if !exists(${KERNSRCDIR}/${TARGET}/conf/${kernel})
.        warning ${TARGET}/conf/${kernel} missing; skipping.
.    else
.        error Target architecture for ${TARGET}/conf/${kernel} may be invalid.
.    endif
.endif
This revision now requires review to proceed.Wed, May 20, 8:24 PM
This revision is now accepted and ready to land.Wed, May 20, 8:56 PM