FBSD 15 pkgbase

Very short history:
* Installed:
FreeBSD xxxx 15.0-STABLE FreeBSD 15.0-STABLE stable/15-n282114-770479c4cea0 GENERIC amd64
using the pkg installation option.
* Boostrap etcupdate using installed source via:
etcupdate extract
* Git download of OS source then:
make -j4 buildworld, make -j4 buildkernel KERNCONF=tst01d, make packages KERNCONF=tst01d
* Create a new ZFS boot environment and boot into it.
* Backup various partition blocks & boot loaders etc.
* Disable OS base repositories and enable the OS repository created at:
url: "file:////usr/obj/usr/src/repo/FreeBSD:15:amd64/latest"
* Install custom kernel and reboot:
pkg install -r main_base FreeBSD-kernel-tst01d-15.snap20260223023521
* Upgrade base:
pkg upgrade -r main_base
* Compared conf files via:
etcupdate diff
* Reboot.
* OS is now:
FreeBSD xxxx 15.0-STABLE FreeBSD 15.0-STABLE stable/15-n282439-10f22bdf7fcf TST01D amd64.
* So far its all working well.


Questions:
* Is the above process reasonable?

* Can there be multiple kernels?
That is how to deal with:
----
pkg install -r main_base FreeBSD-kernel-tst01d-15.snap20260223023521
Updating main_base repository catalogue...
main_base repository is up to date.
main_base is up to date.
Checking integrity... done (1 conflicting)
- FreeBSD-kernel-tst01d-15.snap20260223023521 [main_base] conflicts with FreeBSD-kernel-generic-15.snap20260205031446 [installed] on /boot/kernel/aac.ko
Checking integrity... done (0 conflicting)
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
FreeBSD-kernel-tst01d: 15.snap20260223023521 [main_base]

Installed packages to be REMOVED:
FreeBSD-kernel-generic: 15.snap20260205031446

Number of packages to be removed: 1
Number of packages to be installed: 1
----

* Installing base gave lot of missing file messages. Is this a problem?
----
Extracting FreeBSD-src-15.snap20260223023521: 100%
FreeBSD-src-15.snap20260205031446: missing file /usr/src/contrib/capsicum-test/.gitignore
FreeBSD-src-15.snap20260205031446: missing file /usr/src/contrib/capsicum-test/CONTRIBUTING.md
-- snip --
FreeBSD-src-15.snap20260205031446: missing file /usr/src/usr.bin/m4/tests/regress.sh
FreeBSD-src-15.snap20260205031446: missing file /usr/src/usr.bin/vi/extern.h
[261/310] Upgrading FreeBSD-src-sys from 15.snap20260205031446 to 15.snap20260223023521...
----

* Is a etcupdate replacement required when using the pkg method?

* How to convert from using the pkg method to the standard make install methods?

Thanks in advance for any comments.
 
make -j4 buildworld, make -j4 buildkernel KERNCONF=tst01d, make packages KERNCONF=tst01d
* Install custom kernel and reboot:
* So far its all working well.
Questions:
* Is the above process reasonable?
If it's working well, then it should be reasonable.

* Can there be multiple kernels?
It's possible to install multiple kernels side by side.

From pkgbase:

pkg-unregister(8) "FreeBSD-kernel-generic", rename /boot/kernel -> /boot/GENERIC, install "FreeBSD-kernel-tst01d", pkg-unregister(8) FreeBSD-kernel-tst01d, rename /boot/kernel -> /boot/tst01d

Unless you want to distribute the kernel package to other machines, why bother creating a pkgbase kernel package at all (which currently involves completed "buildworld" and "packages" targets besides "buildkernel")?

If the target machine is the only one to receive the kernel, I would exclude the kernel from pkgbase and maintain the kernel exclusively built from source.

Code:
pkg  unregister  FreeBSD-kernel-generic
mv  /boot/kernel  /boot/GENERIC

cd /usr/src
make kernel-toolchain kernel KERNCONF=tst01d   INSTKERNNAME=tst01d  DESTDIR=/
Eventually set kernel="tst01d" to default in /boot/loader.conf.

* Installing base gave lot of missing file messages. Is this a problem?
Yes, it is a problem. Missing files may fail building from source. If you are planning to build from source on the pkgbase installed host machine, I would exclude "FreeBSD-src-sys" being installed (or, if installed, delete it) and get the source code by other means.

If you want to distribute the source tree to other machines by pkgbase package, try fetching a clean source tree, if present, remove custom build environment variables in /etc/make.conf, /etc/src.conf, /etc/src-env.conf (to make sure it's not some variable causing the problem), build, packages stable/15, and test installing or updating pkgbase installed packages (eventually in a virtual machine or jail). If the issue continues to apear, perhaps report on freebsd-pkgbase@freebsd.org mailing list or https://bugs.freebsd.org.

* Is a etcupdate replacement required when using the pkg method?
No, it's not required.

* How to convert from using the pkg method to the standard make install methods?

Re: CURRENT: bothering DESTDIR=/ issue after pkg base install
Code:
...
> I'd like to go back to the status quo ante, without defining DESTDIR=/
> in /etc/src.conf, but it seems I'm to blunt to find the correct
> "switch".

You have converted your system to pkgbase and want to switch back to
updating from source.

If you have pkg 2.5.0 or newer:

    pkg unregister -fg FreeBSD-\*
...
Remember to run `make delete-old` after `make installworld` to remove
files that were installed by pkgbase but are excluded from your build.
 
Thanks for your comments and information.
* I was unaware of pkg-unregister; it helps a lot.
* Yes I do want to distribute the kernel to other machines.
* "FreeBSD-src-sys" is now excluded.
* Converting from pkg to make install method seems straight forward but seems unnecessary now.
 
Back
Top