FreeBSD project started to officially add kernel modules pkg(8) repositories to default installation – starting with FreeBSD 14.3-RELEASE version.
To understand why they were brought to light of day its first needed to understand the problem they are here to solve.
Problem
This problem does not exists with x.0 FreeBSD releases – they have all their packages built against proper FreeBSD x.0 version. The problem arises when x.1 release is made, or x.2 … or any OTHER then x.0 to be precise … but why?
The main problem is that pkg(8) packages are built against the currently supported oldest FreeBSD version in the tree. For example when 14.3-RELEASE is announced – the packages for 14.x tree are still built on 14.2-RELEASE for next 3 months since 14.3-RELEASE availability.
This usually does not break any ‘userspace’ applications but kernel modules related packages often are broken and cause kernel panics even on module load – and there are about 70 of them. While FreeBSD team fights really hard to keep ABI and kernel interfaces stable across ‘point’ releases – its sometimes not possible due to the nature of Linux DRM graphics drivers being imported and improved to support more modern GPUs on FreeBSD.
The problem mostly arises in the desktop/laptop area of FreeBSD UNIX usage – as with broken ABI the drm-kmod related kernel modules just panic and reboot each such system instantly … and this problem persists for whole 3 months within which the older release is still in support. After these 3 painful months – and after older ‘point’ release is out of support – the pkg(8) packages are finally started to built against PROPER latest FreeBSD version – and problem disappears … up to nest ‘point’ release and painful 3 months.
The damage of this policy can be limited with ZFS Boot Environments using tools like beadm(8) or bectl(8) but its just workaround solution.
Additional Repositories
I have spoken about that problem for years – trying to make FreeBSD project do something about it – for example as there are TWO independent pkg(8) branches of packages – the default quarterly and optional latest one – I suggested to switch latest to the LATEST FreeBSD version since day 1 of release and keep quarterly as the ‘legacy’ version packages branch … but that proposal did not saw any appreciation.
After many years something different was introduced – additional separate kernel modules related pkg(8) repositories – both for quarterly and latest branches.
Initially they were unofficial and official at the same time. Official for those who follow the FreeBSD project and daily use the Mailing Lists – CFT: Repository for Kernel Modules – and unofficial for all the others – no mention in the Release Notes – no mention in the Errata for a FreeBSD release.
Official Solution
In the middle of the FreeBSD 14.3-RELEASE process the situation become more clear as the additional pkg(8) repositories became official in the FreeBSD 14.3-RC1 Now Available announcement – described as:
o The default pkg.conf file now includes the FreeBSD-kmods repository.
Finally.
One may ask – why FreeBSD project will not just use the most easy way and build separate set of packages for each release – the answer is simple and brutal – lack of resources – while FreeBSD remains one of the few really free and freedom powered systems – it comes at a price – you do not often get all the toys for free for playing the ‘freedom’ game.
Upgrade Path
Initially I was skeptical about the repositories – but I started to upgrade one of my systems within ZFS Boot Environment … and I was surprised that freebsd-update(8) asks to modify /etc/pkg/FreeBSD.conf file with additional FreeBSD-kmods repository … finally some good fucking news 🙂
I upgraded and rebooted the FreeBSD system up to the latest and greatest 14.3-RELEASE official version – and everything worked as it should. As I prefer to have more recent version of packages with latest branch of pkg(8) packages – I also switched to kmods_latest_${VERSION_MINOR} for the kernel related packages. For convenience (if needed) I have left the quarterly branch commented out.
My /etc/pkg/FreeBSD.conf file looks like that right now.
FreeBSD % cat /etc/pkg/FreeBSD.conf FreeBSD: { # url: "pkg+https://pkg.FreeBSD.org/${ABI}/quarterly", url: "pkg+https://pkg.FreeBSD.org/${ABI}/latest", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", enabled: yes } FreeBSD-kmods: { # url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly_${VERSION_MINOR}", url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_latest_${VERSION_MINOR}", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", enabled: yes } FreeBSD % pkg repos FreeBSD: { url : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/latest", enabled : yes, priority : 0, mirror_type : "SRV", signature_type : "FINGERPRINTS", fingerprints : "/usr/share/keys/pkg" } FreeBSD-kmods: { url : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/kmods_latest_3", enabled : yes, priority : 0, mirror_type : "SRV", signature_type : "FINGERPRINTS", fingerprints : "/usr/share/keys/pkg" }
There are now two ‘same’ … or should I say ‘similar’ packages that come from additional kernel repository. Take a look for example for the drm-61-kmod package.
FreeBSD % pkg search drm-61-kmod drm-61-kmod-6.1.128.1402000_5 DRM drivers modules nvidia-drm-61-kmod-570.153.02.1402000_2 NVIDIA DRM Kernel Module drm-61-kmod-6.1.128. 1403000 _4 DRM drivers modules
I remember that when these additional repositories were introduced – for example – the VirtualBox kernel modules were not available – not a case now – everything is covered.
FreeBSD % pkg search virtualbox-ose-kmod virtualbox-ose-kmod-6.1.50.1402000_1 VirtualBox kernel module for FreeBSD virtualbox-ose-kmod-70-7.0.26.1402000 VirtualBox kernel module for FreeBSD virtualbox-ose-kmod-71-7.1.10.1402000 VirtualBox kernel module for FreeBSD virtualbox-ose-kmod-legacy-5.2.44.1402000_7 VirtualBox kernel module for FreeBSD virtualbox-ose-kmod-6.1.50. 1403000 _1 VirtualBox kernel module for FreeBSD virtualbox-ose-kmod-70-7.0.26. 1403000 VirtualBox kernel module for FreeBSD virtualbox-ose-kmod-71-7.1.8. 1403000 VirtualBox kernel module for FreeBSD virtualbox-ose-kmod-legacy-5.2.44. 1403000 _7 VirtualBox kernel module for FreeBSD
Take a look at the package suffix – its 1402000 for the 14.2-RELEASE from the ‘default’ repository and 1403000 for the 14.3-RELEASE from the kernel repo – and that is treated as pkg(8) as higher version the the ‘default’ one.
Results
I have tested these repos in both Intel and AMD based GPU systems – and they work properly on all of them.
Feel free to share your thoughts on the topic.
EOF