Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Oct 2025 09:45:02 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Michael Grimm <trashcan@ellael.org>
Cc:        Lexi Winter <ivy@freebsd.org>, freebsd-hackers@freebsd.org
Subject:   Re: multiple kernels with the same world
Message-ID:  <CANCZdfrt2hK5o80Jd1bTAOVPu_5xmJ3kNpMkHvTHFAPHwXgLHA@mail.gmail.com>
In-Reply-To: <04D75F4D-5C17-4D8F-93C1-0BDF5251CBD2@ellael.org>
References:  <575313120.20251014120303.ref@yahoo.com> <575313120.20251014120303@yahoo.com> <aO4TYzABsCeWqbEW@amaryllis.le-fay.org> <04D75F4D-5C17-4D8F-93C1-0BDF5251CBD2@ellael.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Thu, Oct 16, 2025 at 9:39 AM Michael Grimm <trashcan@ellael.org> wrote:

> 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.
>
> Cool.
>
> 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
>
> P.S. I tried make KERNCONF='GENERIC CUSTOM' KERNEL='GENERIC CUSTOM'
> DESTDIR=/tmp/NEW installkernel
>      same results as mentioned above
>

The only way I know is to do them one at a time. The code in Makefile.inc1
treats the first one specially. You'd have to hack it so it doesn't.

Warner

[-- Attachment #2 --]
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Oct 16, 2025 at 9:39 AM Michael Grimm &lt;<a href="mailto:trashcan@ellael.org">trashcan@ellael.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Lexi Winter &lt;ivy@FreeBSD.org&gt; wrote:<br>
&gt; Anthony Pankov wrote in &lt;<a href="mailto:575313120.20251014120303@yahoo.com" target="_blank">575313120.20251014120303@yahoo.com</a>&gt;:<br>
<br>
&gt;&gt; I wander can I build multiple kernel from the same sources while using<br>
&gt;&gt; once builded world?<br>
&gt;&gt; <br>
&gt;&gt; My aim is to have basepkgs containing different kernels. It would be<br>
&gt;&gt; nice to have FreeBSD-kernel-general-*.pkg,<br>
&gt;&gt; FreeBSD-kernel-virtualmachine-*.pkg etc. in the same base package<br>
&gt;&gt; repository.<br>
&gt; <br>
&gt; % make KERNCONF=&#39;GENERIC FOO BAR BAZ&#39; buildworld buildkernel update-packages<br>
&gt; <br>
&gt; the first kernel listed in KERNCONF will be installed in /boot/kernel,<br>
&gt; the rest will be installed in /boot/kernel.NAME.  for consistency, i<br>
&gt; prefer to always build GENERIC as the first kernel, but there&#39;s no<br>
&gt; actual requirement to do that.<br>
<br>
Cool. <br>
<br>
Please excuse my ignorance but is there a way to get /boot/kernel.NAME installed without going via packages?<br>
<br>
I am used to build and install by source. Thus I tried:<br>
<br>
MWN&gt; make KERNCONF=&#39;GENERIC CUSTOM&#39; DESTDIR=/tmp/NEW installkernel | &amp; tee LOG<br>
<br>
MWN&gt; grep &#39;^&gt;&gt;&gt;&#39; LOG<br>
&gt;&gt;&gt; Install check kernel started on Thu Oct 16 17:27:31 CEST 2025<br>
&gt;&gt;&gt; Installing kernel GENERIC on Thu Oct 16 17:27:31 CEST 2025<br>
&gt;&gt;&gt; Installing kernel GENERIC completed on Thu Oct 16 17:27:44 CEST 2025<br>
&gt;&gt;&gt; Install kernel(s) GENERIC completed in 13 seconds, ncpu: 16<br>
<br>
MWN&gt; ls -al /tmp/NEW/boot | grep kernel<br>
drwxr-xr-x  2 root wheel 717 Oct 16 17:29 kernel<br>
<br>
Only the first kernel found in KERNCONF will be installed, though.<br>
<br>
Is there a way to end up in something like the following? <br>
<br>
tmp/NEW/boot/kernel<br>
tmp/NEW/boot/kernel.GENERIC<br>
<br>
P.S. I tried make KERNCONF=&#39;GENERIC CUSTOM&#39; KERNEL=&#39;GENERIC CUSTOM&#39; DESTDIR=/tmp/NEW installkernel<br>
     same results as mentioned above<br></blockquote><div><br></div><div>The only way I know is to do them one at a time. The code in Makefile.inc1 treats the first one specially. You&#39;d have to hack it so it doesn&#39;t.</div><div><br></div><div>Warner </div></div></div>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrt2hK5o80Jd1bTAOVPu_5xmJ3kNpMkHvTHFAPHwXgLHA>