Re: multiple kernels with the same world

From: Alan Somers <asomers_at_freebsd.org>
Date: Thu, 16 Oct 2025 15:44:44 UTC
On Tue, Oct 14, 2025 at 3:10 AM Lexi Winter <ivy@freebsd.org> wrote:

> Anthony Pankov wrote in <575313120.20251014120303@yahoo.com>:
> > I wander can I build multiple kernel from the same sources while using
> > once builded world?
> >
> > My aim is to have basepkgs containing different kernels. It would be
> > nice to have FreeBSD-kernel-general-*.pkg,
> > FreeBSD-kernel-virtualmachine-*.pkg etc. in the same base package
> > repository.
>
> % 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.  for consistency, i
> prefer to always build GENERIC as the first kernel, but there's no
> actual requirement to do that.
>

I do this all the time, too.  One limitation is that it doesn't currently
with "make release" , but there's an open PR for that.
https://github.com/freebsd/freebsd-src/pull/1566