Personal FreeBSD PKGBASE Update Server

FreeBSD UNIX system can be updated in many ways. You can use freebsd-update(8) command to fetch and install the official binary patches. You can download the FreeBSD sources and compile your new version. You can download and install base.txz and kernel.txz sets in a new ZFS Boot Environment along with copying over your config files there – Other FreeBSD Version in ZFS Boot Environment – as documented here.

While for most users these three options will be more then enough – there is a small group or people that need something else. Companies. People that like to use custom FreeBSD version or enterprise corporate world that needs to fulfill many compliance regulations. For their multiple reasons – including but not limited to – security – they want to have their own trusted FreeBSD update infra under their control.

Recently I was seeking any possible way to build and serve my own FreeBSD versions and making updates of it possible – either with freebsd-update(8) command or with new PKGBASE concept that utilizes the pkg(8) command.

I first started with the official FreeBSD project article titled Build Your Own FreeBSD Update Server – but it was last updated … 10 years ago. I still persisted to try it as there were no other places that documented this and while I tried it – I figured out that instead of *-disc1.iso I should use *-dvd.iso image and that these scripts use SHA512 checksums and not SHA256 (as described in its comments) … but that still did not make it work for 13.2-RELEASE – hence the bug report – Broken for 13.2-RELEASE? … with zero replies … and its still open.

The only thing that changed was an addition of Warning to the article that “The instructions in this article refer to an older version of FreeBSD and may not work properly on recent versions of the OS. With the availability of pkgbase, the freebsd-update utility is scheduled to be removed from FreeBSD in the future. When that happens, this article is either updated to reflect the new procedures or removed entirely”. Seems this is NOT the way.

In the mean time – as FreeBSD 14.0-RELEASE was prepared with its ALPHA/BETA/RC releases – some FreeBSD developers started to share new info about long awaited PKGBASE solution. Seeing that personal freebsd-update(8) based solution seems to be a dead end – I reached out for some PKGBASE info with Personal FreeBSD PKGBASE Server message on the freebsd-pkgbase FreeBSD Mailing Lists. Encouraged by the responses I tried various solutions – and this article will summarize what I was able to achieve – with what I know. I assume that I am far from being PKGBASE expert – so its possible that there are more optimized ways to do what I try to achieve here – hence the article will probably be updated.

While investigating the topic and writing it I also followed the FreeBSD Wiki PKGBASE Page – that helped.

This is the Table of Contents for this article.

  • Personal FreeBSD PKGBASE Update Server
  • Personal freebsd-update(8) Server
  • GhostBSD Way
  • Enter PKGBASE
    • Setup Build Server
    • CCACHE Improvement
    • PKGBASE First Build
    • Update PKGBASE Packages
    • Update PKGBASE Packages on Client System
    • Poudriere Automation
  • Summary

Personal freebsd-update(8) Server

The title of this section – Personal freebsd-update(8) Server – was meant to be the title of that article – I really wanted to utilize the known and tested freebsd-update(8) tool – but as You see even the official way is doomed to failure. While I still believed it is possible – I also reached to other then official sources for that topic. For the record – this is not a sponsored article nor advertisement or a marketing attempt – but I would like to share that I am really grateful to Ganbold Tsagaankhuu and A-Team Systems that they shared their solution to mirror official freebsd-update(8) servers content. The A-Team Systems has been working with FreeBSD for over 20 years and has the experience to provide enterprise level support for it … and they have been a proud sponsor of the FreeBSD Foundation for years. Not to mention that Adam Strohl was FreeBSD project contributor since 1996.

The FreeBSD Update Mirroring solution is ready to use and available – if You just want to mirror the official FreeBSD updates for freebsd-update(8) tool. You can also use another third party tool called freebsd-update-probe.sh that will speed up the check if the freebsd-update(8) updates are available at all.

GhostBSD Way

While I was seeking for some silver bullet for FreeBSD personal upgrade server I also asked Eric Turgeon – the GhostBSD creator – how the GhostBSD does and maintains its update and upgrades.

xfce-ghostbsd

To be honest GhostBSD solution here is really nice and interesting. The GhostBSD project maintains its own Ports tree – https://github.com/ghostbsd/ghostbsd-ports – available here. For the GhostBSD system updates there is just a separate os category – https://github.com/ghostbsd/ghostbsd-ports/tree/main/os – shown here.

Its quite convenient – as they are ‘just’ Ports – they are Poudriere friendly.

Here are the instructions (shared by Eric Turgeon) I used to test the GhostBSD build process.

# // CREATE GhostBSD PORTS MIRROR //
builder # poudriere ports -c -p ghostbsd -m git -U "https://github.com/ghostbsd/ghostbsd-ports" -B main

# // UPDATE GhostBSD PORTS MIRROR //
builder # poudriere ports -u -p ghostbsd -m git -U "https://github.com/ghostbsd/ghostbsd-ports" -B main

# // BUILD GhostBSD os BASE PORTS //
builder # poudriere bulk -j 13-2-R-amd64-src -p ghostbsd \
    os/buildkernel \
    os/buildkernel-debug \
    os/buildworld \
    os/kernel \
    os/kernel-debug \
    os/kernel-debug-symbols \
    os/kernel-symbols \
    os/userland \
    os/userland-base \
    os/userland-base-bootstrap \
    os/userland-bin \
    os/userland-boot \
    os/userland-conf \
    os/userland-debug \
    os/userland-devtools \
    os/userland-docs \
    os/userland-lib \
    os/userland-lib32 \
    os/userland-lib32-development \
    os/userland-rescue \
    os/userland-sbin \
    os/userland-tests \
    os/ports \
    os/src

The good part of that approach is that You just build the Base System parts as any other packages – and then update them in a new ZFS Boot Environment without interfering with running system. After the update process is complete You can reboot to a fresh and updated ZFS BE.

To create a new GhostBSD ISO you will have to use GhostBSD build.sh script … or at least some personal modification of it – but at least its all there and available.

Enter PKGBASE

The idea is not special in any way – to be honest its just a ‘way’ of what most Linux distributions do in their idea of operating system distribution management. The only thing that is different – is that on most Linux systems all packages (even kernel) are treated the same while on FreeBSD the PKGBASE is still in the faith of Base System concept – thus there would be BASE packages and all other packages of third party software … and this is very healthy and good separation. Using FreeBSD for almost two decades I definitely believe that “This is the way!” – to have separate packages for the system and separate for the additional optional packages that anyone can install or not.

Setup Build Server

We will use just released FreeBSD 14.0-RELEASE for the build system – along with some packages installed. Here are the instructions that will get us into that. Without an idea for a better name I will just call it builder … yes I am not the best at naming systems – not to mention that my laptop hostname is named after its model – w520 πŸ™‚

We will install the following pkg(8) packages.

builder # pkg install -y   \
            devel/ccache4  \
            devel/git      \
            net/gitup      \
            sysutils/beadm \
            sysutils/htop  \
            www/nginx

builder # cp /usr/local/etc/gitup.conf.sample \
             /usr/local/etc/gitup.conf

As You probably guessed from the added packages above – we will use CCACHE 4.x to speed up the build process. How much CCACHE helps here? A lot!

The CCACHE config on the host /etc/make.conf file looks as follows.

builder # cat /etc/make.conf
CCACHE_DIR=/var/cache/ccache
WITH_CCACHE_BUILD=yes

You can also make additional time gains by using ramdisk for WRKDIRPREFIX option in the /etc/make.conf file.

builder # cat /etc/make.conf
CCACHE_DIR=/var/cache/ccache
WITH_CCACHE_BUILD=yes
WRKDIRPREFIX=/RAM

You will need that config in the /etc/fstab file.

builder # grep -e RAM -e MNT /etc/fstab
#DEV  #MNT  #FS    #OPTS                  #DUMP/PASS
none  /RAM  tmpfs  rw,size=10g,mode=1777  0 0

The www/nginx and sysutils/htop are optional – first is to eventually share the built pkg(8) repo over the network and htop(1) to check how much the machine is utilized during the build process.

If you want to check how to share this repo with www/nginx then check FreeBSD on FreeIPA/IDM with Poudriere Repo article for the details.

CCACHE Improvement

Below is a simple benchmark showing how much CCACHE helps in build times. It measures time to buildworld and buildkernel of FreeBSD using 8 CPUs in a Bhyve VM – as showed below.

builder # cd /usr/src

builder # rm -rf /usr/obj

builder # time make -j 8 buildworld buildkernel

Below are the timed results of 3 builds.

34018.13s user 1769.90s system 781% cpu 1:16:16.91 total # // 1st // simplified result: ~75 minutes
 1159.49s user  545.14s system 595% cpu    4:46.35 total # // 2nd // simplified result:  ~5 minutes (15 times faster)
 1133.67s user  531.76s system 595% cpu    4:39.73 total # // 3rd // simplified result:  ~5 minutes (15 times faster)

Before doing the benchmark I expected CCACHE to cut the build times in half or something like that – I never expected such a good improvement of 15 times faster build times. From hours to minutes – literally – and this is on older (now budget option) AMD Ryzen 7 1700 8C/16T CPU that cost me $45 a year ago and it is not even fully utilized as I make the build in a 8 CPU Bhyve VM. For storage on that system I have some cheap 512 GB NVMe SSD in M.2 slot on the motherboard and that Bhyve VM have a file based disk with type of virtual NVMe … and also 12 GB RAM … and my RAM is not one of the most expensive gaming one shelf. Does not seem like a huge and expensive build machine to me.

games

If You are curious how is the games system built – AMD Based FreeBSD Desktop – its described here … and Yes I upgraded CPU since the article release πŸ™‚ My CCACHE config is the same as the one used in the FreeBSD on FreeIPA/IDM with Poudriere Repo article.

I started to use ‘external’ machine instead of my ThinkPad W520 for such more heavy loads as I do not like my laptop trying to become a drone with its fan to cool the things I ask it to do while doing other regular work πŸ™‚

PKGBASE First Build

First we need to fetch the FreeBSD source code (if we do not have them already) with gitup(1) command.

builder # gitup release

builder # grep -e '^REVISION' -e '^BRANCH' /usr/src/sys/conf/newvers.sh
REVISION="14.0"
BRANCH="RELEASE"

We will create new pkgbase empty ZFS Boot Environment for our tests.

builder # zfs create -o mountpoint=/ -o canmount=off zroot/ROOT/pkgbase

builder # beadm mount pkgbase /var/tmp/pkgbase

Our new empty ZFS BE is mounted at /var/tmp/pkgbase dir.

Now we will build the world and kernel and then create the packages with make(1) command.


builder # cd /usr/src

builder # rm -rf /usr/obj /var/tmp/pkgbase/repo

builder # mkdir -p /var/tmp/pkgbase/repo

builder # time make REPRODUCIBLE_BUILD=1 REPODIR=/var/tmp/pkgbase/repo -j 10 buildworld buildkernel

builder # time make REPRODUCIBLE_BUILD=1 REPODIR=/var/tmp/pkgbase/repo -j 10 packages

Now we should have our new PKGBASE packages ready.

builder # ls /var/tmp/pkgbase/repo
FreeBSD:14:amd64

builder # ls -l /var/tmp/pkgbase/repo/FreeBSD:14:amd64             
total 17
drwxr-xr-x  2 root wheel 424 2023.12.08 06:37 14/
lrwxr-xr-x  1 root wheel   2 2023.12.08 06:37 latest -> 14

The latest points to our (currently one and only) 14 branch.

Now we will install world and kernel into the new ZFS BE. We also need to make(1) the distribution target to have /etc populated with default configs.

builder # cd /usr/src

builder # make DESTDIR=/var/tmp/pkgbase installworld

builder # make DESTDIR=/var/tmp/pkgbase installkernel

builder # make DESTDIR=/var/tmp/pkgbase distribution

Next we will chroot(8) into new pkgbase ZFS BE and bootstrap the default pkg(8).


builder # env PS1='BE # ' chroot /var/tmp/pkgbase /bin/sh

BE # echo nameserver 1.1.1.1 > /etc/resolv.conf

BE # mount -t devfs devfs /dev

BE # pkg 
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y

Next – still being in the chroot(8) world – we will create our local PKGBASE repo config and update its metadata.

BE # mkdir -p /usr/local/etc/pkg/repos

BE # cat < /usr/local/etc/pkg/repos/FreeBSD-base.conf
FreeBSD-base: {
  url: "file:///repo/\${ABI}/latest",
  mirror_type: "none",
  enabled: yes
}
EOF

BE # pkg update -r FreeBSD-base
Updating FreeBSD-base repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01    
Fetching packagesite.pkg: 100%   31 KiB  31.6kB/s    00:01    
Processing entries: 100%
FreeBSD-base repository update completed. 417 packages processed.
All repositories are up to date.

We have our PKGBASE pkg(8) repo metadata – we may now install all the PKGBASE packages over our pkgbase system.

BE # pkg install -g 'FreeBSD-*'

More details below.

BE # pkg install -g 'FreeBSD-*'
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01    
Fetching packagesite.pkg: 100%    7 MiB   1.0MB/s    00:07    
Processing entries: 100%
FreeBSD repository update completed. 33994 packages processed.
Updating FreeBSD-base repository catalogue...
FreeBSD-base repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
The following 417 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        FreeBSD-acct: 14 [FreeBSD-base]
        FreeBSD-acct-dbg: 14 [FreeBSD-base]
        FreeBSD-acpi: 14 [FreeBSD-base]
        FreeBSD-acpi-dbg: 14 [FreeBSD-base]
        FreeBSD-apm: 14 [FreeBSD-base]
        FreeBSD-apm-dbg: 14 [FreeBSD-base]
        FreeBSD-at: 14 [FreeBSD-base]
        FreeBSD-at-dbg: 14 [FreeBSD-base]
        FreeBSD-autofs: 14 [FreeBSD-base]
        FreeBSD-autofs-dbg: 14 [FreeBSD-base]
        FreeBSD-bhyve: 14 [FreeBSD-base]
        FreeBSD-bhyve-dbg: 14 [FreeBSD-base]
        FreeBSD-bluetooth: 14 [FreeBSD-base]
        FreeBSD-bluetooth-dbg: 14 [FreeBSD-base]
        FreeBSD-bluetooth-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-bluetooth-dev: 14 [FreeBSD-base]
        FreeBSD-bluetooth-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-bluetooth-lib32: 14 [FreeBSD-base]
        FreeBSD-bootloader: 14 [FreeBSD-base]
        FreeBSD-bsdinstall: 14 [FreeBSD-base]
        FreeBSD-bsdinstall-dbg: 14 [FreeBSD-base]
        FreeBSD-bsnmp: 14 [FreeBSD-base]
        FreeBSD-bsnmp-dbg: 14 [FreeBSD-base]
        FreeBSD-bsnmp-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-bsnmp-dev: 14 [FreeBSD-base]
        FreeBSD-bsnmp-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-bsnmp-lib32: 14 [FreeBSD-base]
        FreeBSD-caroot: 14 [FreeBSD-base]
        FreeBSD-ccdconfig: 14 [FreeBSD-base]
        FreeBSD-ccdconfig-dbg: 14 [FreeBSD-base]
        FreeBSD-certctl: 14 [FreeBSD-base]
        FreeBSD-clang: 14 [FreeBSD-base]
        FreeBSD-clang-dbg: 14 [FreeBSD-base]
        FreeBSD-clibs: 14 [FreeBSD-base]
        FreeBSD-clibs-dbg: 14 [FreeBSD-base]
        FreeBSD-clibs-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-clibs-dev: 14 [FreeBSD-base]
        FreeBSD-clibs-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-clibs-lib32: 14 [FreeBSD-base]
        FreeBSD-console-tools: 14 [FreeBSD-base]
        FreeBSD-console-tools-dbg: 14 [FreeBSD-base]
        FreeBSD-csh: 14 [FreeBSD-base]
        FreeBSD-csh-dbg: 14 [FreeBSD-base]
        FreeBSD-ctf-tools: 14 [FreeBSD-base]
        FreeBSD-ctf-tools-dbg: 14 [FreeBSD-base]
        FreeBSD-cxgbe-tools: 14 [FreeBSD-base]
        FreeBSD-cxgbe-tools-dbg: 14 [FreeBSD-base]
        FreeBSD-devd: 14 [FreeBSD-base]
        FreeBSD-devd-dbg: 14 [FreeBSD-base]
        FreeBSD-devmatch: 14 [FreeBSD-base]
        FreeBSD-devmatch-dbg: 14 [FreeBSD-base]
        FreeBSD-devmatch-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-devmatch-dev: 14 [FreeBSD-base]
        FreeBSD-devmatch-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-devmatch-lib32: 14 [FreeBSD-base]
        FreeBSD-dhclient: 14 [FreeBSD-base]
        FreeBSD-dhclient-dbg: 14 [FreeBSD-base]
        FreeBSD-dma: 14 [FreeBSD-base]
        FreeBSD-dma-dbg: 14 [FreeBSD-base]
        FreeBSD-dpv: 14 [FreeBSD-base]
        FreeBSD-dpv-dbg: 14 [FreeBSD-base]
        FreeBSD-dpv-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-dpv-dev: 14 [FreeBSD-base]
        FreeBSD-dpv-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-dpv-lib32: 14 [FreeBSD-base]
        FreeBSD-dtrace: 14 [FreeBSD-base]
        FreeBSD-dtrace-dbg: 14 [FreeBSD-base]
        FreeBSD-dtrace-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-dtrace-dev: 14 [FreeBSD-base]
        FreeBSD-dtrace-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-dtrace-lib32: 14 [FreeBSD-base]
        FreeBSD-dwatch: 14 [FreeBSD-base]
        FreeBSD-ee: 14 [FreeBSD-base]
        FreeBSD-ee-dbg: 14 [FreeBSD-base]
        FreeBSD-efi-tools: 14 [FreeBSD-base]
        FreeBSD-efi-tools-dbg: 14 [FreeBSD-base]
        FreeBSD-efi-tools-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-efi-tools-dev: 14 [FreeBSD-base]
        FreeBSD-efi-tools-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-efi-tools-lib32: 14 [FreeBSD-base]
        FreeBSD-elftoolchain: 14 [FreeBSD-base]
        FreeBSD-elftoolchain-dbg: 14 [FreeBSD-base]
        FreeBSD-fetch: 14 [FreeBSD-base]
        FreeBSD-fetch-dbg: 14 [FreeBSD-base]
        FreeBSD-fetch-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-fetch-dev: 14 [FreeBSD-base]
        FreeBSD-fetch-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-fetch-lib32: 14 [FreeBSD-base]
        FreeBSD-ftp: 14 [FreeBSD-base]
        FreeBSD-ftp-dbg: 14 [FreeBSD-base]
        FreeBSD-ftpd: 14 [FreeBSD-base]
        FreeBSD-ftpd-dbg: 14 [FreeBSD-base]
        FreeBSD-fwget: 14 [FreeBSD-base]
        FreeBSD-games: 14 [FreeBSD-base]
        FreeBSD-games-dbg: 14 [FreeBSD-base]
        FreeBSD-geom: 14 [FreeBSD-base]
        FreeBSD-geom-dbg: 14 [FreeBSD-base]
        FreeBSD-geom-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-geom-lib32: 14 [FreeBSD-base]
        FreeBSD-ggate: 14 [FreeBSD-base]
        FreeBSD-ggate-dbg: 14 [FreeBSD-base]
        FreeBSD-hast: 14 [FreeBSD-base]
        FreeBSD-hast-dbg: 14 [FreeBSD-base]
        FreeBSD-hostapd: 14 [FreeBSD-base]
        FreeBSD-hostapd-dbg: 14 [FreeBSD-base]
        FreeBSD-hyperv-tools: 14 [FreeBSD-base]
        FreeBSD-inetd: 14 [FreeBSD-base]
        FreeBSD-inetd-dbg: 14 [FreeBSD-base]
        FreeBSD-ipf: 14 [FreeBSD-base]
        FreeBSD-ipf-dbg: 14 [FreeBSD-base]
        FreeBSD-ipfilter: 14 [FreeBSD-base]
        FreeBSD-ipfw: 14 [FreeBSD-base]
        FreeBSD-ipfw-dbg: 14 [FreeBSD-base]
        FreeBSD-iscsi: 14 [FreeBSD-base]
        FreeBSD-iscsi-dbg: 14 [FreeBSD-base]
        FreeBSD-jail: 14 [FreeBSD-base]
        FreeBSD-jail-dbg: 14 [FreeBSD-base]
        FreeBSD-kerberos: 14 [FreeBSD-base]
        FreeBSD-kerberos-dbg: 14 [FreeBSD-base]
        FreeBSD-kerberos-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-kerberos-lib: 14 [FreeBSD-base]
        FreeBSD-kerberos-lib-dbg: 14 [FreeBSD-base]
        FreeBSD-kerberos-lib-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-kerberos-lib-dev: 14 [FreeBSD-base]
        FreeBSD-kerberos-lib-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-kerberos-lib-lib32: 14 [FreeBSD-base]
        FreeBSD-kerberos-lib32: 14 [FreeBSD-base]
        FreeBSD-kernel-generic: 14 [FreeBSD-base]
        FreeBSD-kernel-generic-dbg: 14 [FreeBSD-base]
        FreeBSD-lib9p: 14 [FreeBSD-base]
        FreeBSD-lib9p-dbg: 14 [FreeBSD-base]
        FreeBSD-lib9p-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-lib9p-dev: 14 [FreeBSD-base]
        FreeBSD-lib9p-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-lib9p-lib32: 14 [FreeBSD-base]
        FreeBSD-libarchive: 14 [FreeBSD-base]
        FreeBSD-libarchive-dbg: 14 [FreeBSD-base]
        FreeBSD-libarchive-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libarchive-dev: 14 [FreeBSD-base]
        FreeBSD-libarchive-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libarchive-lib32: 14 [FreeBSD-base]
        FreeBSD-libbegemot: 14 [FreeBSD-base]
        FreeBSD-libbegemot-dbg: 14 [FreeBSD-base]
        FreeBSD-libbegemot-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libbegemot-dev: 14 [FreeBSD-base]
        FreeBSD-libbegemot-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libbegemot-lib32: 14 [FreeBSD-base]
        FreeBSD-libblocksruntime: 14 [FreeBSD-base]
        FreeBSD-libblocksruntime-dbg: 14 [FreeBSD-base]
        FreeBSD-libblocksruntime-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libblocksruntime-dev: 14 [FreeBSD-base]
        FreeBSD-libblocksruntime-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libblocksruntime-lib32: 14 [FreeBSD-base]
        FreeBSD-libbsdstat: 14 [FreeBSD-base]
        FreeBSD-libbsdstat-dbg: 14 [FreeBSD-base]
        FreeBSD-libbsdstat-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libbsdstat-dev: 14 [FreeBSD-base]
        FreeBSD-libbsdstat-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libbsdstat-lib32: 14 [FreeBSD-base]
        FreeBSD-libbsm: 14 [FreeBSD-base]
        FreeBSD-libbsm-dbg: 14 [FreeBSD-base]
        FreeBSD-libbsm-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libbsm-dev: 14 [FreeBSD-base]
        FreeBSD-libbsm-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libbsm-lib32: 14 [FreeBSD-base]
        FreeBSD-libbz2: 14 [FreeBSD-base]
        FreeBSD-libbz2-dbg: 14 [FreeBSD-base]
        FreeBSD-libbz2-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libbz2-dev: 14 [FreeBSD-base]
        FreeBSD-libbz2-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libbz2-lib32: 14 [FreeBSD-base]
        FreeBSD-libcasper: 14 [FreeBSD-base]
        FreeBSD-libcasper-dbg: 14 [FreeBSD-base]
        FreeBSD-libcasper-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libcasper-dev: 14 [FreeBSD-base]
        FreeBSD-libcasper-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libcasper-lib32: 14 [FreeBSD-base]
        FreeBSD-libcompat: 14 [FreeBSD-base]
        FreeBSD-libcompat-dev: 14 [FreeBSD-base]
        FreeBSD-libcompat-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libcompiler_rt: 14 [FreeBSD-base]
        FreeBSD-libcompiler_rt-dev: 14 [FreeBSD-base]
        FreeBSD-libcompiler_rt-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libcompiler_rt-lib32: 14 [FreeBSD-base]
        FreeBSD-libcuse: 14 [FreeBSD-base]
        FreeBSD-libcuse-dbg: 14 [FreeBSD-base]
        FreeBSD-libcuse-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libcuse-dev: 14 [FreeBSD-base]
        FreeBSD-libcuse-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libcuse-lib32: 14 [FreeBSD-base]
        FreeBSD-libdwarf: 14 [FreeBSD-base]
        FreeBSD-libdwarf-dbg: 14 [FreeBSD-base]
        FreeBSD-libdwarf-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libdwarf-dev: 14 [FreeBSD-base]
        FreeBSD-libdwarf-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libdwarf-lib32: 14 [FreeBSD-base]
        FreeBSD-libevent1: 14 [FreeBSD-base]
        FreeBSD-libevent1-dbg: 14 [FreeBSD-base]
        FreeBSD-libevent1-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libevent1-dev: 14 [FreeBSD-base]
        FreeBSD-libevent1-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libevent1-lib32: 14 [FreeBSD-base]
        FreeBSD-libexecinfo: 14 [FreeBSD-base]
        FreeBSD-libexecinfo-dbg: 14 [FreeBSD-base]
        FreeBSD-libexecinfo-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libexecinfo-dev: 14 [FreeBSD-base]
        FreeBSD-libexecinfo-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libexecinfo-lib32: 14 [FreeBSD-base]
        FreeBSD-libipt: 14 [FreeBSD-base]
        FreeBSD-libipt-dbg: 14 [FreeBSD-base]
        FreeBSD-libipt-dev: 14 [FreeBSD-base]
        FreeBSD-libldns: 14 [FreeBSD-base]
        FreeBSD-libldns-dbg: 14 [FreeBSD-base]
        FreeBSD-libldns-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libldns-dev: 14 [FreeBSD-base]
        FreeBSD-libldns-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libldns-lib32: 14 [FreeBSD-base]
        FreeBSD-liblzma: 14 [FreeBSD-base]
        FreeBSD-liblzma-dbg: 14 [FreeBSD-base]
        FreeBSD-liblzma-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-liblzma-dev: 14 [FreeBSD-base]
        FreeBSD-liblzma-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-liblzma-lib32: 14 [FreeBSD-base]
        FreeBSD-libmagic: 14 [FreeBSD-base]
        FreeBSD-libmagic-dbg: 14 [FreeBSD-base]
        FreeBSD-libmagic-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libmagic-dev: 14 [FreeBSD-base]
        FreeBSD-libmagic-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libmagic-lib32: 14 [FreeBSD-base]
        FreeBSD-libpathconv: 14 [FreeBSD-base]
        FreeBSD-libpathconv-dbg: 14 [FreeBSD-base]
        FreeBSD-libpathconv-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libpathconv-dev: 14 [FreeBSD-base]
        FreeBSD-libpathconv-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libpathconv-lib32: 14 [FreeBSD-base]
        FreeBSD-librpcsec_gss: 14 [FreeBSD-base]
        FreeBSD-librpcsec_gss-dbg: 14 [FreeBSD-base]
        FreeBSD-librpcsec_gss-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-librpcsec_gss-dev: 14 [FreeBSD-base]
        FreeBSD-librpcsec_gss-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-librpcsec_gss-lib32: 14 [FreeBSD-base]
        FreeBSD-librss: 14 [FreeBSD-base]
        FreeBSD-librss-dbg: 14 [FreeBSD-base]
        FreeBSD-librss-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-librss-dev: 14 [FreeBSD-base]
        FreeBSD-librss-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-librss-lib32: 14 [FreeBSD-base]
        FreeBSD-libsdp: 14 [FreeBSD-base]
        FreeBSD-libsdp-dbg: 14 [FreeBSD-base]
        FreeBSD-libsdp-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libsdp-dev: 14 [FreeBSD-base]
        FreeBSD-libsdp-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libsdp-lib32: 14 [FreeBSD-base]
        FreeBSD-libsqlite3: 14 [FreeBSD-base]
        FreeBSD-libsqlite3-dbg: 14 [FreeBSD-base]
        FreeBSD-libsqlite3-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libsqlite3-dev: 14 [FreeBSD-base]
        FreeBSD-libsqlite3-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libsqlite3-lib32: 14 [FreeBSD-base]
        FreeBSD-libstdbuf: 14 [FreeBSD-base]
        FreeBSD-libstdbuf-dbg: 14 [FreeBSD-base]
        FreeBSD-libstdbuf-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libstdbuf-dev: 14 [FreeBSD-base]
        FreeBSD-libstdbuf-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libstdbuf-lib32: 14 [FreeBSD-base]
        FreeBSD-libstdthreads: 14 [FreeBSD-base]
        FreeBSD-libstdthreads-dbg: 14 [FreeBSD-base]
        FreeBSD-libstdthreads-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libstdthreads-dev: 14 [FreeBSD-base]
        FreeBSD-libstdthreads-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libstdthreads-lib32: 14 [FreeBSD-base]
        FreeBSD-libthread_db: 14 [FreeBSD-base]
        FreeBSD-libthread_db-dbg: 14 [FreeBSD-base]
        FreeBSD-libthread_db-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libthread_db-dev: 14 [FreeBSD-base]
        FreeBSD-libthread_db-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libthread_db-lib32: 14 [FreeBSD-base]
        FreeBSD-libucl: 14 [FreeBSD-base]
        FreeBSD-libucl-dbg: 14 [FreeBSD-base]
        FreeBSD-libucl-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libucl-dev: 14 [FreeBSD-base]
        FreeBSD-libucl-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libucl-lib32: 14 [FreeBSD-base]
        FreeBSD-libvgl: 14 [FreeBSD-base]
        FreeBSD-libvgl-dbg: 14 [FreeBSD-base]
        FreeBSD-libvgl-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-libvgl-dev: 14 [FreeBSD-base]
        FreeBSD-libvgl-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-libvgl-lib32: 14 [FreeBSD-base]
        FreeBSD-libvmmapi: 14 [FreeBSD-base]
        FreeBSD-libvmmapi-dbg: 14 [FreeBSD-base]
        FreeBSD-libvmmapi-dev: 14 [FreeBSD-base]
        FreeBSD-liby-dev: 14 [FreeBSD-base]
        FreeBSD-liby-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-lld: 14 [FreeBSD-base]
        FreeBSD-lld-dbg: 14 [FreeBSD-base]
        FreeBSD-lldb: 14 [FreeBSD-base]
        FreeBSD-lldb-dbg: 14 [FreeBSD-base]
        FreeBSD-locales: 14 [FreeBSD-base]
        FreeBSD-mlx-tools: 14 [FreeBSD-base]
        FreeBSD-mlx-tools-dbg: 14 [FreeBSD-base]
        FreeBSD-mtree: 14 [FreeBSD-base]
        FreeBSD-mtree-dbg: 14 [FreeBSD-base]
        FreeBSD-natd: 14 [FreeBSD-base]
        FreeBSD-natd-dbg: 14 [FreeBSD-base]
        FreeBSD-natd-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-natd-dev: 14 [FreeBSD-base]
        FreeBSD-natd-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-natd-lib32: 14 [FreeBSD-base]
        FreeBSD-netmap: 14 [FreeBSD-base]
        FreeBSD-netmap-dbg: 14 [FreeBSD-base]
        FreeBSD-netmap-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-netmap-dev: 14 [FreeBSD-base]
        FreeBSD-netmap-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-netmap-lib32: 14 [FreeBSD-base]
        FreeBSD-newsyslog: 14 [FreeBSD-base]
        FreeBSD-newsyslog-dbg: 14 [FreeBSD-base]
        FreeBSD-nfs: 14 [FreeBSD-base]
        FreeBSD-nfs-dbg: 14 [FreeBSD-base]
        FreeBSD-nvme-tools: 14 [FreeBSD-base]
        FreeBSD-nvme-tools-dbg: 14 [FreeBSD-base]
        FreeBSD-openssl: 14 [FreeBSD-base]
        FreeBSD-openssl-dbg: 14 [FreeBSD-base]
        FreeBSD-openssl-lib: 14 [FreeBSD-base]
        FreeBSD-openssl-lib-dbg: 14 [FreeBSD-base]
        FreeBSD-openssl-lib-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-openssl-lib-dev: 14 [FreeBSD-base]
        FreeBSD-openssl-lib-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-openssl-lib-lib32: 14 [FreeBSD-base]
        FreeBSD-periodic: 14 [FreeBSD-base]
        FreeBSD-pf: 14 [FreeBSD-base]
        FreeBSD-pf-dbg: 14 [FreeBSD-base]
        FreeBSD-pf-dev: 14 [FreeBSD-base]
        FreeBSD-pkg-bootstrap: 14 [FreeBSD-base]
        FreeBSD-pkg-bootstrap-dbg: 14 [FreeBSD-base]
        FreeBSD-ppp: 14 [FreeBSD-base]
        FreeBSD-ppp-dbg: 14 [FreeBSD-base]
        FreeBSD-quotacheck: 14 [FreeBSD-base]
        FreeBSD-quotacheck-dbg: 14 [FreeBSD-base]
        FreeBSD-rc: 14 [FreeBSD-base]
        FreeBSD-rc-dbg: 14 [FreeBSD-base]
        FreeBSD-rcmds: 14 [FreeBSD-base]
        FreeBSD-rcmds-dbg: 14 [FreeBSD-base]
        FreeBSD-rdma: 14 [FreeBSD-base]
        FreeBSD-rdma-dbg: 14 [FreeBSD-base]
        FreeBSD-rescue: 14 [FreeBSD-base]
        FreeBSD-resolvconf: 14 [FreeBSD-base]
        FreeBSD-runtime: 14 [FreeBSD-base]
        FreeBSD-runtime-dbg: 14 [FreeBSD-base]
        FreeBSD-runtime-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-runtime-dev: 14 [FreeBSD-base]
        FreeBSD-runtime-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-runtime-lib32: 14 [FreeBSD-base]
        FreeBSD-sendmail: 14 [FreeBSD-base]
        FreeBSD-sendmail-dbg: 14 [FreeBSD-base]
        FreeBSD-sendmail-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-sendmail-dev: 14 [FreeBSD-base]
        FreeBSD-sendmail-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-sendmail-lib32: 14 [FreeBSD-base]
        FreeBSD-smbutils: 14 [FreeBSD-base]
        FreeBSD-smbutils-dbg: 14 [FreeBSD-base]
        FreeBSD-smbutils-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-smbutils-dev: 14 [FreeBSD-base]
        FreeBSD-smbutils-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-smbutils-lib32: 14 [FreeBSD-base]
        FreeBSD-ssh: 14 [FreeBSD-base]
        FreeBSD-ssh-dbg: 14 [FreeBSD-base]
        FreeBSD-ssh-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-ssh-dev: 14 [FreeBSD-base]
        FreeBSD-ssh-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-ssh-lib32: 14 [FreeBSD-base]
        FreeBSD-syscons: 14 [FreeBSD-base]
        FreeBSD-syslogd: 14 [FreeBSD-base]
        FreeBSD-syslogd-dbg: 14 [FreeBSD-base]
        FreeBSD-tcpd: 14 [FreeBSD-base]
        FreeBSD-tcpd-dbg: 14 [FreeBSD-base]
        FreeBSD-tcpd-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-tcpd-dev: 14 [FreeBSD-base]
        FreeBSD-tcpd-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-tcpd-lib32: 14 [FreeBSD-base]
        FreeBSD-telnet: 14 [FreeBSD-base]
        FreeBSD-telnet-dbg: 14 [FreeBSD-base]
        FreeBSD-tests: 14 [FreeBSD-base]
        FreeBSD-tests-dbg: 14 [FreeBSD-base]
        FreeBSD-tests-dev: 14 [FreeBSD-base]
        FreeBSD-ufs: 14 [FreeBSD-base]
        FreeBSD-ufs-dbg: 14 [FreeBSD-base]
        FreeBSD-ufs-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-ufs-dev: 14 [FreeBSD-base]
        FreeBSD-ufs-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-ufs-lib32: 14 [FreeBSD-base]
        FreeBSD-unbound: 14 [FreeBSD-base]
        FreeBSD-unbound-dbg: 14 [FreeBSD-base]
        FreeBSD-unbound-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-unbound-dev: 14 [FreeBSD-base]
        FreeBSD-unbound-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-unbound-lib32: 14 [FreeBSD-base]
        FreeBSD-utilities: 14 [FreeBSD-base]
        FreeBSD-utilities-dbg: 14 [FreeBSD-base]
        FreeBSD-utilities-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-utilities-dev: 14 [FreeBSD-base]
        FreeBSD-utilities-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-utilities-lib32: 14 [FreeBSD-base]
        FreeBSD-vi: 14 [FreeBSD-base]
        FreeBSD-vi-dbg: 14 [FreeBSD-base]
        FreeBSD-vt-data: 14 [FreeBSD-base]
        FreeBSD-wpa: 14 [FreeBSD-base]
        FreeBSD-wpa-dbg: 14 [FreeBSD-base]
        FreeBSD-yp: 14 [FreeBSD-base]
        FreeBSD-yp-dbg: 14 [FreeBSD-base]
        FreeBSD-zfs: 14 [FreeBSD-base]
        FreeBSD-zfs-dbg: 14 [FreeBSD-base]
        FreeBSD-zfs-dbg-lib32: 14 [FreeBSD-base]
        FreeBSD-zfs-dev: 14 [FreeBSD-base]
        FreeBSD-zfs-dev-lib32: 14 [FreeBSD-base]
        FreeBSD-zfs-lib32: 14 [FreeBSD-base]
        FreeBSD-zoneinfo: 14 [FreeBSD-base]

Number of packages to be installed: 417

The process will require 3 GiB more space.

Proceed with this action? [y/N]: y


Voila! We have fresh FreeBSD 14.0-RELEASE system installed with new PKGBASE way.

Some pkg(8) stats below.

BE # pkg stats
Local package database:
        Installed packages: 418
        Disk space occupied: 3 GiB

Remote package database(s):
        Number of repositories: 2
        Packages available: 34411
        Unique packages: 34411
        Total size of packages: 121 GiB

BE # pkg -vv | grep -A 99 '^Repositories:'
Repositories:
  FreeBSD: { 
    url             : "pkg+http://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
  FreeBSD-base: { 
    url             : "file:///repo/FreeBSD:14:amd64/latest",
    enabled         : yes,
    priority        : 0
  }


Update PKGBASE Packages

Now – when the new version arrives – or just we want to add some changes and reflect them in the packages – we would like to update our PKGBASE packages and update the pkgbase system.

With my limited knowledge of C I will modify our /usr/src source tree and then build updated packages.

First – we need to change BRANCH into something different – so that it will be obvious for the PKGBASE build method that packages needs to be updated.

builder # vi /usr/src/sys/conf/newvers.sh

builder # grep -e '^REVISION' -e '^BRANCH' /usr/src/sys/conf/newvers.sh
REVISION="14.0"
BRANCH="RELEASE-p1"

I have changed BRANCH="RELEASE" into BRANCH="RELEASE-p1" for the record.

Now lets modify some FreeBSD tool to check if it will be updated in the process – lets try ls(1).

I will add an EMPTY and useless function to it.


builder # vi /usr/src/bin/ls/ls.c

builder # grep -n -A 4 EMPTY /usr/src/bin/ls/ls.c
100:int          EMPTY(int);
101-static void  traverse(int, char **, int);
102-
103-#define     COLOR_OPT       (CHAR_MAX + 1)
104-
--
1033:int EMPTY(int nope)
1034-{
1035-   return nope;
1036-}

Lets update the PKGBASE packages.

builder # rm -rf /usr/obj

builder # cd /usr/src

builder # time make REPRODUCIBLE_BUILD=1 REPODIR=/var/tmp/pkgbase/repo -j 10 buildworld buildkernel

builder # time make REPRODUCIBLE_BUILD=1 REPODIR=/var/tmp/pkgbase/repo -j 10 update-packages

Lets see how our /repo looks like now.

builder # find /var/tmp/pkgbase/repo -maxdepth 2 -ls | sed -e 's.      ..g'
     2  1 drwxr-xr-x    3 root     wheel     3 Dec  8 06:31 /var/tmp/pkgbase/repo
   128  1 drwxr-xr-x    4 root     wheel     5 Dec  8 21:48 /var/tmp/pkgbase/repo/FreeBSD:14:amd64
 32768 33 drwxr-xr-x    2 root     wheel   424 Dec  8 21:48 /var/tmp/pkgbase/repo/FreeBSD:14:amd64/14p1
   129 33 drwxr-xr-x    2 root     wheel   424 Dec  8 06:37 /var/tmp/pkgbase/repo/FreeBSD:14:amd64/14
 33907  1 lrwxr-xr-x    1 root     wheel     4 Dec  8 21:48 /var/tmp/pkgbase/repo/FreeBSD:14:amd64/latest -> 14p1

So the latest now points to the 14p1 branch. Looks promising.

Update PKGBASE Packages on Client System

Now – as our /repo is updated – we will do the usual update process with pkg(8) tool.

I assume that pkgbase is still mounted at the /var/tmp/pkgbase place and that devfs is still mounted /dev inside pkgbase ZFS BE.

builder # env PS1='BE # ' chroot /var/tmp/pkgbase /bin/sh

BE # mount | grep -q /var/tmp/pkgbase/dev || mount -t devfs devfs /dev

BE # pkg update -f -r FreeBSD-repo
Updating FreeBSD-base repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01    
Fetching packagesite.pkg: 100%   31 KiB  31.7kB/s    00:01    
Processing entries: 100%
FreeBSD-base repository update completed. 417 packages processed.
All repositories are up to date.

BE # pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating FreeBSD-base repository catalogue...
FreeBSD-base repository is up to date.
All repositories are up to date.
Checking for upgrades (8 candidates): 100%
Processing candidates (8 candidates): 100%
Checking integrity... done (0 conflicting)
The following 7 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
        FreeBSD-ftpd: 14 -> 14p1 [FreeBSD-base]
        FreeBSD-ftpd-dbg: 14 -> 14p1 [FreeBSD-base]
        FreeBSD-kernel-generic: 14 -> 14p1 [FreeBSD-base]
        FreeBSD-kernel-generic-dbg: 14 -> 14p1 [FreeBSD-base]
        FreeBSD-rescue: 14 -> 14p1 [FreeBSD-base]
        FreeBSD-runtime: 14 -> 14p1 [FreeBSD-base]
        FreeBSD-runtime-dbg: 14 -> 14p1 [FreeBSD-base]

Number of packages to be upgraded: 7

Proceed with this action? [y/N]: y
[1/7] Upgrading FreeBSD-runtime from 14 to 14p1...
[1/7] Extracting FreeBSD-runtime-14p1: 100%
[2/7] Upgrading FreeBSD-ftpd from 14 to 14p1...
[2/7] Extracting FreeBSD-ftpd-14p1: 100%
[3/7] Upgrading FreeBSD-kernel-generic-dbg from 14 to 14p1...
[3/7] Extracting FreeBSD-kernel-generic-dbg-14p1: 100%
[4/7] Upgrading FreeBSD-ftpd-dbg from 14 to 14p1...
[4/7] Extracting FreeBSD-ftpd-dbg-14p1: 100%
[5/7] Upgrading FreeBSD-rescue from 14 to 14p1...
[5/7] Extracting FreeBSD-rescue-14p1: 100%
[6/7] Upgrading FreeBSD-runtime-dbg from 14 to 14p1...
[6/7] Extracting FreeBSD-runtime-dbg-14p1: 100%
[7/7] Upgrading FreeBSD-kernel-generic from 14 to 14p1...
[7/7] Extracting FreeBSD-kernel-generic-14p1: 100%

So we just did our first binary pkg(8) update using PKGBASE packages created on our personal build system.

Lets check where /bin/ls has been packaged.

BE # pkg which -o /bin/ls
/bin/ls was installed by package base

Not much of a help. Lets check if its one of the updated FreeBSD-runtime PKGBASE packages.

BE # pkg info -l FreeBSD-runtime | grep /bin/ls
        /bin/ls

Yep. That is the one.

We can also check what freebsd-version(1) thinks about it.

BE # freebsd-version -k
14.0-RELEASE-p1

BE # freebsd-version -u
14.0-RELEASE-p1

BE # freebsd-version 
14.0-RELEASE-p1

Seems legit.

Poudriere Automation

I did not (yet) persuaded the Poudriere way of doing it – but Mina Galic was kind enough to share his HOWTO on the topic – PKGBASE HOWTO – but besides reading it – I did not yet persuaded its instructions live.

Summary

These are early stages of PKGBASE (especially for me) so way of things may change in the future – but for now – this one should just work.

Being here – I would like to help all people that helped me with this topic – You know who You are πŸ™‚

Feel free to share your experiences about it.

EOF

8 thoughts on “Personal FreeBSD PKGBASE Update Server

  1. Pingback: Servidor de atualização pessoal do FreeBSD PKGBASE – linux-BR.org

  2. Pingback: Personal FreeBSD PKGBASE updateΒ server – OSnews

  3. Pingback: Valuable News – 2023/12/11 | πšŸπšŽπš›πš–πšŠπšπšŽπš—

  4. inf0stud

    Please mention that to use CCACHE to buildworld and buildkernel you need to:

    # cp /usr/share/examples/etc/make.conf /etc

    if it doesn’t already exist and add to /etc/make.conf this:

    WITH_CCACHE_BUILD=yes
    CCACHE_DIR=/tmp/ccache
    

    Uses RAM or /var/cache/ccache for disk if you don’t have much RAM.

    Like

    Reply
    1. vermaden Post author

      The CCACHE was already used thanks to these env(1) variables:

      % env | grep CCACHE  
      WITH_CCACHE_BUILD=yes
      CCACHE_MAXSIZE=0
      CCACHE_MAXFILES=0
      CCACHE_DIR=/var/ccache
      CCACHE_PATH=/usr/bin:/usr/local/bin
      

      But I also added small section about /etc/make.conf settings and also a /RAM ramdisk for even faster compilation times.

      Thank You for suggestions.

      Like

      Reply
      1. Jan Bramkamp

        You can also use the bmake meta-mode. It uses /dev/filemon to have the kernel tell make which paths it’s descendants accessed or tried to access which allows make to calculate (near) perfect dependency information to super-seed the Makefile dependencies for less aggressive rebuilding. For your usual errata/security updates it results in a lot lower built times than normal mode + ccache. I’ve never tried to combine both. To quickly clean up after larger changes (e.g. switching major releases, hacking on the build system) it’s also a good idea to create a dedicated file system for /var/obj or /var/obj/usr/src that can rollback to an empty state.

        I would do the same for the ccache cache directory because one the cache fills up it’s probing for old cache entries to evict that will butcher your build times. You can either flush the whole cache and have occasional slow builds or you can move the cache eviction out of your build jobs.

        Like

Leave a comment