Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Mar 2026 16:35:31 +0000
From:      Lexi Winter <ivy@freebsd.org>
To:        freebsd-pkgbase@freebsd.org
Subject:   Re: Patched kernel workflow
Message-ID:  <abGZ0xvAPVji8bI0@amaryllis.le-fay.org>
In-Reply-To: <CADzCCsNCo1VcP5NRk00ZZrXVogG1zjBN2KmMJT5FAPfr5qewuA@mail.gmail.com>

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

[-- Attachment #1 --]
Микола Микола wrote in <CADzCCsNCo1VcP5NRk00ZZrXVogG1zjBN2KmMJT5FAPfr5qewuA@mail.gmail.com>:
> I am the user of FreeBSD 15-STABLE with pkgbase. I have found myself
> recently in quick need to modify the sources of kernel in order to
> debug/fix issue I was having trouble with.
> 
> I found myself in unpleasant situation where make installkernel complains
> about overriding pkgbase kernel and modules, noting that pkg will get out
> of sync.
> 
> So I have few questions. First is what exactly happens when pkg gets out of
> sync?

because the files on disk no longer match what pkg(8) installed and
recorded in its database, it will make incorrect decisions about how
to manage those files.  for exactly it might incorrectly upgrade or
downgrade the kernel, it might install new files that conflict with
the currently installed files, or it might leave files on disk when
they should be removed.

> Second, what is streamlined workflow to build custom kernel and
> integrate it into system.
 
if you want to temporary install a different kernel for testing, the
simplest way is to use:

	# make installkernel INSTKERNNAME=testkernel

this will install the new kernel at /boot/testkernel, which will not
conflict with your existing pkgbase-managed kernel.  you can then
boot this new kernel from loader(8) in the usual way.

alternatively if you want to manage the kernel yourself and not use
pkgbase for it, you can remove the FreeBSD-kernel-generic* packages
and run installkernel in the usual way.

finally, you could build your own pkgbase repository (see build(7),
specifically on "update-packages") and then update from there.

> I have heard that you should use Poudriere to build packages, and in my
> case it this would mean having custom src git tree and every time new
> package needs to be build - a merge should happen in that git tree.

some people use poudriere to build pkgbase packages, but it's not the
case that you "should" do this.  more like, you may choose to do that
if it fits into your existing workflow.  i personally don't because i
think it makes things unnecessarily complicated.

> Currently Im viewing options to convert my 15-STABLE from pkgbase to
> source-based, i.e. building world and kernel from sources.

you can do this using:

	# pkg unregister -fg 'FreeBSD-*'

you will need to disable the FreeBSD-base repository afterwards.  make
sure you take a backup or BE snapshot being doing that, just in case.

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQSyjTg96lp3RifySyn1nT63mIK/YAUCabGZzwAKCRD1nT63mIK/
YMqnAP9kaU2V1OfG7ihiqCql9L3A9YkLqkRPtRRajvKOxHlnLAEA1Wb1gY6Y6dGI
1aYQSqnhJlDD7DixK8LhynYKVYY9Lwo=
=c9kB
-----END PGP SIGNATURE-----
home | help

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