Missing KERNCONF?

Hi,

I'm trying to build a custom kernel using the release(7) scripts for ARM64. I have created a custom kernel configuration by copying and modifying the GENERIC kernel to a file in /usr/src/sys/arm64/conf/RPIMIN. I also have a custom RPI release(7) configuration. In the configuration I have the line:

KERNEL="RPIMIN"

I build with:

./release.sh -c arm64/RPIMIN.conf

The code runs for a while and then stops with:

Code:
--------------------------------------------------------------
>>> World build completed on Tue Jan  2 12:50:44 UTC 2024
>>> World built in 177 seconds, ncpu: 8, make -j8
--------------------------------------------------------------
make[1]: "/usr/src/share/mk/bsd.mkopt.mk" line 71: warning: WITHOUT_CAPSICUM option ignored: it is no longer supported
make[1]: "/usr/src/share/mk/bsd.mkopt.mk" line 71: warning: WITHOUT_CASPER option ignored: it is no longer supported
make[1]: "/usr/src/Makefile.inc1" line 1723: Missing KERNCONF /usr/src/sys/arm64/conf/RPIMIN

make[1]: stopped in /usr/src
--- buildkernel ---

make: stopped in /usr/src

Doing an ls -alh /usr/src/sys/arm64/conf/RPIMIN gives:

Code:
# ls -alh /usr/src/sys/arm64/conf/RPIMIN
-rw-r--r--  1 root wheel  1.2K Jan  2 12:28 /usr/src/sys/arm64/conf/RPIMIN

If I build with the GENERIC kernel, it works OK (The only thing I've changed in the release(7) conf is KERNEL="GENERIC"):

Code:
--------------------------------------------------------------
>>> Kernel build for GENERIC started on Tue Jan  2 13:22:50 UTC 2024
--------------------------------------------------------------
===> GENERIC

--------------------------------------------------------------
>>> stage 1: configuring the kernel
--------------------------------------------------------------
Kernel build directory is /usr/obj/usr/src/arm64.aarch64/sys/GENERIC
Don't forget to do ``make cleandepend && make depend''
...


it's only the custom kernel that seems to give it a problem. Is there somewhere else I need to register the new kernel configuration? Or something I'm missing?
 
Yes, the kernel ident matches the filename, and is RPIMIN.

Code:
# cat /usr/src/sys/arm64/conf/RPIMIN | grep ident
ident        RPIMIN
 
Never really used the release.sh, but looking at it, it mentions something about chroot -- do you have that set (or is it used by default?), and is it possible that the source is the one inside that chroot?
 
I haven’t done anything special there… just running it from the “normal” prompt. So if it does a chroot it must do it internally?
 
So if it does a chroot it must do it internally?
Looks like that, yes (just reading release.sh), I wonder if there's a /scratch/usr/src/ source tree in there (/scratch seems to be the default CHROOTDIR value), and if yes, try putting your kernel config in there.
 
Yes, that seems to work. (At least, it got past the previous error so far.)

That's pretty non-obvious -- that custom kernel configs don't actually get copied, so the only way to get a custom kernel config in there is to get it checked into the FreeBSD source? (or hand-copy it over after the chroot has been made?)

Is this a bug? Or at least a feature request? If so I would be happy to file it somewhere, with the same details, but as I'm new to this, I'm not sure where. Any pointers?
 
This works as designed, see also release(7):
Code:
     For some users, it may be desirable to provide an absolutely clean build
     environment, with no local modifications to the source tree or to
     make.conf(5), and with clean checkouts of specific versions of the doc,
     src, and ports trees.  For this purpose, a script
     (src/release/release.sh) is provided to automate these checkouts and then
     execute “make release” in a clean chroot(8).

Sure, you can add your custom kernel configs to git, that's quite easy with a local branch, and I'm doing exactly that here (and update this using git-rebase). But the purpose of the release.sh script is to perform a clean build of unmodified official sources.

To create releases from your locally configured/modified system, the intended way to go is make release and friends in /usr/src/release after doing all building as usual, which is also described in release(7).
 
Ok. I am interested in providing an absolutely clean build environment (no source modifications) but only configuration modifications. But I guess that counts as "dirty"? The configuration modifications are also outside of the chroot environment, and given that you can specify a release(7) configuration file outside of the chroot, I guess I assumed that it provided some modicum of customization of the build process.

It's also confusing that the error message omits the "/scratch..." prefix. I guess I understand why now, but troubleshooting that is not straightforward.
 
Back
Top