Possible solution to the drm-kmod kernel mismatch after upgrade from Bapt

With the two upgrade commands, the new scheme also seems to work with a meta port like graphics/drm-kmod:
Rich (BB code):
[1](0) # pkg -vv | sed -n -e '/^Repositories:/,$ p'
Repositories:
  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_2",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }

Edit, additional clarification:
[B][2](0) # pkg install drm-kmod[/B] should have installed 6.1.92.1402000_3 given the shown settings.
I have a questions about /usr/local/etc/pkg/repos/FreeBSD.conf settings.
Now I have and it works:
Code:
FreeBSD: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/latest",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
Cann I have for FreeBSD-kmods
Code:
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods-latest",
Thank you.
 
Cann I have for FreeBSD-kmods
url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods-latest",
No.

Use the following. Note the use of '_' (underscore characters) , and use the appropriate setting for 'latest':
The appropriate (=future proof) way to specify it in a .conf file (e.g. /usr/local/etc/pkg/repos/FreeBSD.conf like shown in message #34) is:
  • url: pkg+https://pkg.freebsd.org/${ABI}/kmods_latest_${VERSION_MINOR}, for the latest package repositories
  • url: pkg+https://pkg.freebsd.org/${ABI}/kmods_quarterly_${VERSION_MINOR}, for the quarterly package repositories

Embed the 'url'-line in a seperate repository section like so:
Code:
FreeBSD-kmods: {
    url: pkg+https://pkg.freebsd.org/${ABI}/kmods_latest_${VERSION_MINOR},
    signature_type: "fingerprints",
    fingerprints: "/usr/share/keys/pkg",
    mirror_type: "srv",
    enabled: yes,
}
 
Cann I have for FreeBSD-kmods
Yes , in different way as you have to use
Code:
url: pkg+https://pkg.freebsd.org/${ABI}/kmods_latest_${VERSION_MINOR},
for this and use pkg update for 143 packages. Then again use the same file for full package repository as you have done every time.
 
Yes , in different way as you have to use
Code:
url: pkg+https://pkg.freebsd.org/${ABI}/kmods_latest_${VERSION_MINOR},
for this and use pkg update for 143 packages. Then again use the same file for full package repository as you have done every time.
I did it from comment #53. Thank you.
 
I was unable to upgrade from FreeBSD 14.1 to 14.2 until now because the driver module for my display had not been recompiled for 14.2. I spent many hours on this problem without success. After reading everything in the forums again I finally got it working, although I need to learn a bit more about custom repositories.

My graphics card is an AMD Radeon 6900 XT, and this is the procedure I followed:

I began with a fresh installation of FreeBSD 14.2, which included gpu-firmware-amd-kmod-sienna-cichlid in the installation procedure.

I created the custom repository /usr/local/etc/pkg/repos/FreeBSD-kmods.conf as follows:

FreeBSD-kmods: {
url: pkg+https://pkg.freebsd.org/${ABI}/kmods_latest_${VERSION_MINOR},
enabled: yes,
priority: 10,
mirror_type: "SRV",
signature_type: "FINGERPRINTS",
fingerprints: "/usr/share/keys/pkg"
}

I installed drm-61-kmod. (Should I try with drm-kmod next time?)

I appended the following to /etc/rc.conf:
dbus_enable="YES"
kld_list="amdgpu"

And the following to /etc/fstab:
proc /proc procfs rw 0 0

I did not do any other configuration.

I installed xorg and then rebooted and tested X with startx. This worked I set up a user and installed Xfce4, and that worked too. The only thing I worry about is whether I should continue with the custom repository or whether I should disable it to ensure stability.

Thanks in particular to Erichans for the forum posts on this subject.
 
I think you have already installed this. Need to follow the output on terminal. Also no need to install the gpu drivers. Your upgrade was good but failed only this custom repository was not there.
I tried to follow the instructions given in the other posts as closely as possible, so I installed drm-61-kmod rather than drm-kmod as I would do without the custom repository. Maybe drm-kmod is just an alias for the latest. I'll stick with it for now since it works, but if I have to do a reinstallation I will try drm-kmod with the custom repository. The sienna-cichlid firmware was offered by the install process so I just clicked on 'OK'.

I didn't have this problem in FreeBSD 14.1, but upgrading to, or installing 14.2 resulted in the infamous 'black screen'. According to the logs the module appeared to have been compiled for 14.1, and was not accepted.

Having no display and no idea what causes it or how to fix it is a big problem for a newcomer! I am very grateful for all the help in the forums. :)
 
I tried to follow the instructions given in the other posts as closely as possible, so I installed drm-61-kmod rather than drm-kmod as I would do without the custom repository. Maybe drm-kmod is just an alias for the latest. I'll stick with it for now since it works, but if I have to do a reinstallation I will try drm-kmod with the custom repository. The sienna-cichlid firmware was offered by the install process so I just clicked on 'OK'.

I didn't have this problem in FreeBSD 14.1, but upgrading to, or installing 14.2 resulted in the infamous 'black screen'. According to the logs the module appeared to have been compiled for 14.1, and was not accepted.

Having no display and no idea what causes it or how to fix it is a big problem for a newcomer! I am very grateful for all the help in the forums. :)
The CPU is intel ? Have you tried the drm-510-kmod driver? Remember Metaport by default installs the drm-kmod and drm-61-kmod drivers, those drivers for FreeBSD 14.2 RELEASE are buggy. Uninstall those drivers and follow the instructions that the terminal will display.
 
The CPU is intel ? Have you tried the drm-510-kmod driver? Remember Metaport by default installs the drm-kmod and drm-61-kmod drivers, those drivers for FreeBSD 14.2 RELEASE are buggy. Uninstall those drivers and follow the instructions that the terminal will display.
Buggy?? Seriously? They are compiled for 14.1, this is how FreeBSD works.

Once 14.1 is EOLed those drivers will be compiled for 14.2, please don't spread FUD, thank you.
 
Buggy?? Seriously? They are compiled for 14.1, this is how FreeBSD works.

Once 14.1 is EOLed those drivers will be compiled for 14.2, please don't spread FUD, thank you.
What to read, if I'm not wrong the drm-61-kmod driver this corrected for FreeBSD 15.0-CURRENT
 
I think the kmods repository only contains drm-kmod packages, [...]
Let's see what we can find.

For 14.2-RELEASE, using amd64 architecture and the latest repository, with 'kmods' enabled:
(Where I have -r FreeBSD-kmods, it reflects the 'kmods' repository)
Rich (BB code):
[1-0] # pkg rquery -x -r FreeBSD-kmods '%n-%v' '.*' | wc -l
      44        # count of all packages
[2-0] # pkg rquery -x -r FreeBSD-kmods '%n-%v' '.*' | grep 'drm' | wc -l
       2        # count of drm-kmod packages
[3-0] # pkg rquery -x -r FreeBSD-kmods '%n-%v' '.*' | grep 'drm'
drm-515-kmod-5.15.160.1402000_3        # drm-kmod packages by name
drm-61-kmod-6.1.128.1402000_2
[4-0] # pkg rquery -x -r FreeBSD-kmods '%n-%v' '.*' | egrep '(drm|kmod)' | wc -l
      38        # count of packages having 'drm' or 'kmod' in their name
[5-0] # pkg rquery -x -r FreeBSD-kmods '%n-%v' '.*' | egrep -v '(drm|kmod)' | wc -l
       6        # count of packages having neither 'drm' nor 'kmod' in their name
[6-0] # pkg rquery -x -r FreeBSD-kmods '%n-%v' '.*' | egrep -v '(drm|kmod)'
biosfont-1.3.1.1402000    # list of packages having neither 'drm' nor 'kmod' in their name
ndproxy-3.2.1402000_1
ng_mikrotik_eoip-1.0.1402000
parallels-tools-0.1.2.1402000_1
pwcbsd-1.4.1.1402000_15
uarduno-1.02.1402000_1
[7-0] # pkg rquery -x -r FreeBSD '%n-%v' '.*' | wc -l
   35977        # for comparison: all packages build against 14.1-RELEASE using the standard repository
[8-0] #

The 'kmods' repository is set up for packages containing kernel modules (some, not all, as noted in the CFT mailing list mail message mentioned in the OP). That, I imagine, is the resason to name this repository 'kmods', as in:
  • url: pkg+https://pkg.freebsd.org/${ABI}/kmods_latest_${VERSION_MINOR}, for the latest package repositories
  • url: pkg+https://pkg.freebsd.org/${ABI}/kmods_quarterly_${VERSION_MINOR}, for the quarterly package repositories
___
* I take "drm-kmod" as standing for drm drivers being a 'kmod', such as the package drm-kmod and drm-510-kmod; but even if you don't take it exactly that way, it's not what you might think.
 
I saw that yesterday, but it's not well explained for RELEASE versions. The right config for RELEASE versions are:

For quarterly repos:
Code:
FreeBSD-kmods {
    url: "pkg+https://pkg.freebsd.org/${ABI}/kmods_quarterly_${VERSION_MINOR}",
    signature_type: "fingerprints",
    fingerprints: "/usr/share/keys/pkg",
    mirror_type: "srv",
    enabled: yes
}

For latest repos:
Code:
FreeBSD-kmods {
    url: "pkg+https://pkg.freebsd.org/${ABI}/kmods_latest_${VERSION_MINOR}",
    signature_type: "fingerprints",
    fingerprints: "/usr/share/keys/pkg",
    mirror_type: "srv",
    enabled: yes
}

I saw also that this time the virtualbox-ose-kmod-* are in the kmod repos. I hope all kmods are as well.
 
There are a lot of threads on this subject. It's a thorny problem that often comes up after upgrades from a minor version that has not reached EOL yet. bapt@ has posted a solution to freebsd-ports:
This is no longer labelled as "CFT" (Call For Testing). At this moment this is only posted to the ports mailing list, I fail to see why such a message is not posted to the freebsd-pkg - 2025-May mailinglist too.
Edit: or even communicated to a wider audience.
Edit2: I missed some. Apparently, of the mailing lists, mailed to: CURRENT-16 May - STABLE-16 May - PORTS-16 May. However, the freebsd-pkg - 2025-May is left out. No idea if that is intentional or an oversight.

The post, as is, does not mention the use of ${VERSION_MINOR} at all. For the intended -RELEASE versions, it only mentions, what amounts to hardcoding, the designation of the necessary remote 'kmods' repositories by using dedicated numbers to indicate the respective targeted minor versions. That begs the question if by any chance ${VERSION_MINOR} will no longer be supported at some point in the future. This might have something to do with the addition of remote repositories for -STABLE and -CURRENT that need a more non-version specific designation.

More specifically, it is not mentioned if the appropriate use of ${VERSION_MINOR} is:
  • still possible but neither recommended nor not-recommended
  • still possible but not recommended as it will be phased out, or for some other reason
  • somethings else entirely
 
Last edited:
Some confusion about the 'kmods' repository set up seems to come up in various places in these forums (like here).
Let me answer my own question:
That begs the question if by any chance ${VERSION_MINOR} will no longer be supported at some point in the future.
Given the existence of the following examples:
it is pretty clear to me that, as shown in these files, the use of ${VERSION_MINOR} is still the best future proof method of specifying the 'kmods' repository for FreeBSD -RELEASE versions.

The 'kmods' repository, in full: FreeBSD-kmods repository is also specifically mentioned in the as of yet prelimenary:
FreeBSD 14.3-RELEASE Release Notes - Ports Collection and Package Infrastructure.
The official announcement of 14.3-RELEASE is expected to be on June 10, 2025.


Edit: ${VERSION_MINOR} is documented in pkg.conf(5):
Rich (BB code):
VARIABLES
       The  following  variables  will	be  expanded  during  the  parsing  of
       pkg.conf.
[...]
       VERSION_MINOR
	       Expands to the minor version of the target operating system.
 
Last edited:
Given the existence of the following examples:
It seems more important now than ever to have a correct set up of the FreeBSD-kmods if you rely on packages (and do not build the relevant graphics and wireless drivers [and some more] from source from the ports tree).

FreeBSD-kmods - set up check for 14.2-RELEASE and 14.3-RELEASE​

To see how to set up the FreeBSD-kmods repository, aka kmods, see the previous messages, starting at message #66.

Using pkg-repositories(8), this is how it should look like for the supported 14.x-RELEASE versions:
  • On 14.2-RELEASE, using Latest:
    Rich (BB code):
    [1-0] % pkg repositories
    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_2",
        enabled         : yes,
        priority        : 0,
        mirror_type     : "SRV",
        signature_type  : "FINGERPRINTS",
        fingerprints    : "/usr/share/keys/pkg"
      }
  • On 14.2-RELEASE, using Quarterly:
    Rich (BB code):
    [2-0] % pkg repositories
    FreeBSD: {
        url             : "pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly",
        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_quarterly_2",
        enabled         : yes,
        priority        : 0,
        mirror_type     : "SRV",
        signature_type  : "FINGERPRINTS",
        fingerprints    : "/usr/share/keys/pkg"
      }

As of FreeBSD 14.3-RELEASE, FreeBSD comes with the FreeBSD-kmods repository enabled by default on Quarterly, at least for amd64*.
See also: FreeBSD 14.3-RELEASE Release Notes - Ports Collection and Package Infrastructure
  • On 14.3-RELEASE, using Latest:
    Rich (BB code):
    [1-0] % pkg repositories
    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"
      }
  • On 14.3-RELEASE, using Quarterly:
    Rich (BB code):
    [2-0] % pkg repositories
    FreeBSD: {
        url             : "pkg+https://pkg.freebsd.org/FreeBSD:14:amd64/quarterly",
        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_quarterly_3",
        enabled         : yes,
        priority        : 0,
        mirror_type     : "SRV",
        signature_type  : "FINGERPRINTS",
        fingerprints    : "/usr/share/keys/pkg"
      }

___
* on other architectures the default pkg .conf set up could be different: Latest set as the default branch instead.
 
Last edited:
The latest package repo. was incorporated in /etc/pkg/FreeBSD.conf for 14.3-STABLE also. If you want quarterly then you need a /usr/local/etc/pkg/repos/FreeBSD.conf.
 
For what it's worth, on 15-CURRENT, kmods are enabled for latest in /etc/pkg/FreeBSD.conf. Which makes sense for CURRENT, I guess.
Just for clarity, one small remark.
For 15-CURRENT, there are at the moment 199 "kmods" packages in latest.
There are none when instead the .conf entry for FreeBSD-kmods is set to:
url: pkg+https://pkg.freebsd.org/${ABI}/kmods_quarterly
simply because there isn't any quarterly remote repository set up: https://pkg.freebsd.org/FreeBSD:15:amd64
 
Back
Top