Should we sync FreeBSD-ports and FreeBSD-ports-kmods branches?

I pkgbasified my system yesterday and then successfully did an upgrade to 15.1 following the upgrade instructions here: https://www.freebsd.org/releases/15.1R/upgrading/. To save pain for others, do NOT look at the wiki or even the handbook as they are out of date and miss a key step: you have to explicitly upgrade kmods too.

After a few misadventures, I have a running system again, but am somewhat confused to find that FreeBSD-ports-kmods is a separate repo and that can be on a different branch from FreeBSD-ports. So my question is whether this is a problem, or if it's fine to run these on different branches. I guess from the name these are not base system kmods, but they are not exactly ports either? Can someone explain what's going on? 😅

Here's the output of pkg repos:

Code:
FreeBSD-ports: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/latest",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
FreeBSD-ports-kmods: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/kmods_quarterly_1",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
FreeBSD-base: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_1",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkgbase-15"
  }
 
FreeBSD-ports-kmods is a separate repo and that can be on a different branch from FreeBSD-ports
You can, but shouldn't. Both need to be on quarterly or both on latest.

I guess from the name these are not base system kmods, but they are not exactly ports either?
They are kernel modules from the ports tree. The base OS kernel modules get upgraded when you upgrade the base OS, thus they should all line up perfectly (15.1 modules for a 15.1 kernel). Kernel modules installed from packages or ports however won't be upgraded when you upgrade the base OS.

The FreeBSD ports repository packages get built for 15.0 because 15.0 is still supported for the next three months. For 99% of the userland applications this is fine, packages built for 15.0 will work just fine on 15.1 (ABI stability). Kernel modules (like graphics/drm-kmod for example) are very much dependent on the EXACT kernel version. Trying to load a 15.0 module on a 15.1 kernel will very likely cause a crash. That's where the FreeBSD-ports-kmods comes in, it has those kernel modules specifically built for 15.1.

When 15.0 is really EoL the FreeBSD-ports repository will switch to building for 15.1 and this 'problem' disappears.
 
The KMOD repo is out of sync with PORTS repo is now a major obstacle for installing software like GPU drivers and is hindering users from setting up Desktop environments.

A system software that has an accompanying KMOD must be uppdated in sync.
 
The FreeBSD ports repository packages get built for 15.0 because 15.0 is still supported for the next three months.

Gotcha. So you're saying that the kmods repository is a way around this I guess? And that latest always builds on the actual latest (15.1 in this case), whereas quarterly still has 3 month rolling support windows?

Reading the handbook, it sounds like the MINORRELEASE part of the string should ensure we're using the correct ABI: https://docs.freebsd.org/en/books/handbook/ports/#kmod-repository. But maybe I'm misunderstanding.
 
I guess trying to piece things together, my /usr/local/etc/pkg/repos/FreeBSD.conf in full should look like this if I want to use the latest ports?

Code:
# Switch ports to latest
FreeBSD-ports: { url: "pkg+https://pkg.FreeBSD.org/${ABI}/latest" }

# Switch kmods in ports to latest as well (These need to link the EXACT kernel)
FreeBSD-ports-kmods: { url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_latest_${VERSION_MINOR}" }

# Enable pkgbase
FreeBSD-base: { enabled: yes }

It's not entirely obvious from the current handbook that you need to configure both repos.
 
And that latest always builds on the actual latest (15.1 in this case)
'latest' has to do with the ports tree, not the OS version. The ports tree is continuously updated, modified and whatnot. The 'latest' packages are built from the 'latest' (main) branch of the ports tree. The 'quarterly' packages are built from a quarterly branch of the ports tree. That quarterly branch only gets security fixes. Every three months a new quarterly is branched off from the main branch.
 
Back
Top