Re: multiple kernels with the same world

From: Michael Grimm <trashcan_at_ellael.org>
Date: Thu, 16 Oct 2025 19:15:14 UTC
Warner Losh <imp@bsdimp.com> wrote:
> 
> On Thu, Oct 16, 2025 at 9:39 AM Michael Grimm <trashcan@ellael.org> wrote:
> Lexi Winter <ivy@FreeBSD.org> wrote:

> > % make KERNCONF='GENERIC FOO BAR BAZ' buildworld buildkernel update-packages
> > 
> > the first kernel listed in KERNCONF will be installed in /boot/kernel,
> > the rest will be installed in /boot/kernel.NAME. 

> Please excuse my ignorance but is there a way to get /boot/kernel.NAME installed without going via packages?
> 
> I am used to build and install by source. Thus I tried:
> 
> MWN> make KERNCONF='GENERIC CUSTOM' DESTDIR=/tmp/NEW installkernel | & tee LOG
> 
> MWN> grep '^>>>' LOG
> >>> Install check kernel started on Thu Oct 16 17:27:31 CEST 2025
> >>> Installing kernel GENERIC on Thu Oct 16 17:27:31 CEST 2025
> >>> Installing kernel GENERIC completed on Thu Oct 16 17:27:44 CEST 2025
> >>> Install kernel(s) GENERIC completed in 13 seconds, ncpu: 16
> 
> MWN> ls -al /tmp/NEW/boot | grep kernel
> drwxr-xr-x  2 root wheel 717 Oct 16 17:29 kernel
> 
> Only the first kernel found in KERNCONF will be installed, though.
> 
> Is there a way to end up in something like the following? 
> 
> tmp/NEW/boot/kernel
> tmp/NEW/boot/kernel.GENERIC

> The only way I know is to do them one at a time.

That is what I have at hand some time. But I hoped that I might have overlooked some functionality to install different krenles in one 'make ...'

> The code in Makefile.inc1 treats the first one specially. You'd have to hack it so it doesn't.

I do not know 'make' functionality good enough for that ;-)

Thanks and regards,
Michael