Solved drm-kmod on FreeBSD 14.1 - kernel mismatch

I just built graphics/drm-kmod on my Dell Optiplex 7050 (no dedicated graphics card, using only the integrated intel HD Graphics 630).
Both "make" and "make install" succeeded. But when I try to load the i915kms.ko module I get an error message:
"KLD i915kms.ko: depends on kernel - not available or version mismatch"

Fresh install of FreeBSD 14.1R/amd64 + pkg installed git, then fetched "src" and "ports" as described in the handbook. Then also run a "freebsd-update fetch install", so freebsd-version -uk now shows 14.1-RELEASE and 14.1-RELEASE-p2. Then pkg installed xorg, cinnamon, and then built /usr/ports/graphics/drm-kmod.

Anybody with better results on 14.1R?
Suggestions?
 
Sometimes, the source you have is not the correct version. What does egrep "^BRANCH|^REVISION" /usr/src/sys/conf/newvers.sh show on your machine?
(from your description, freebsd-update should have updated the sources to the correct version)
 
What is the output of pkg info | grep drm- ?

P.S.
so freebsd-version -uk now shows 14.1-RELEASE and 14.1-RELEASE-p2
By what you have written you have the right 14.1-R running. This probably won't matter, but the version of the running kernel is what counts: freebsd-version -k (the u is the installed kernel version)
freebsd-version -r (the k is the installed kernel version)
Sorry for the mixup.
 
This looks ok. Edit: note T-Deamon's message.

Did you install 14.1-RELEASE as a binary install, that is from an image ?
Can you give the output of uname -a ?
 
freebsd-version -k (the u is the installed kernel version)
You are slightly off:

freebsd-version(1)
Code:
     -k          Print the version and patch level of the installed kernel.
                 Unlike uname(1), if a new kernel has been installed but the
                 system has not yet rebooted, freebsd-version will print the
                 version and patch level of the new kernel.

     -r          Print the version and patch level of the running kernel.
                 Unlike uname(1), this is unaffected by environment variables.

     -u          Print the version and patch level of the installed userland.
                 These are hardcoded into freebsd-version during the build.
 
show us pkg info -A drm-61-kmod, in particular "FreeBSD_version" is of interest, and freebsd-version -kru
# pkg info -A drm-61-kmod
drm-61-kmod-6.1.92:
FreeBSD_version: 1401000

# freebsd-version -kru
14.1-RELEASE
14.1-RELEASE
14.1-RELEASE-p2
 
Did you install 14.1-RELEASE as a binary install, that is from an image ?
Can you give the output of uname -a ?
Yes, I installed from the official 14.1R image written to a flash drive.

# uname -a
FreeBSD testbsd141 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
 
I found what went wrong. T-Daemon led me to it (appreciated!).

I wiped and reinstalled FreeBSD 14.1R, selecting src and ports too to be installed. Then built graphics/drm-kmod, and it worked just fine. Then I run "freebsd-update fetch install", rebooted, and the drm-kmod built before the update still worked fine.

I wiped and reinstalled again. This time NOT installing src and ports from the tgz. Then used git to fetch src and ports. However, this time, after my
git clone -o freebsd https://git.FreeBSD.org/src.git /usr/src
... I also run ...
cd /usr/src
git checkout releng/14.1
git pull --rebase; git pull
The last one was not actually necessary.

So, this made the difference. Without the
git checkout releng/14.1
I was fetching src for 15.0 CURRENT. I was not aware of that earlier. Obviously did not read the handbook carefully. This "git" way of things in 14 is too new for me.
Apparently, I fetched src for 15.0 CURRENT, and then my freebsd-update fetch install fetched src for 14.1R-p? overwriting some (but not all) src files. So my system kept saying it is 14.1-RELEASE-p2, but building drm-kmod obviously compiled in remaining portions from 15.0 CURRENT. Hence the resulting drm-kmod not being OK with my kernel.

All is good now.
Thanks for the pointers everyone! Lesson learnt.
 
What does egrep "^BRANCH|^REVISION" /usr/src/sys/conf/newvers.sh show on your machine?
This is a clever thing to check during all kinds of src/sys issues. Useful one-liner to keep in my FreeBSD notes.
Thanks Torfin!
 
Back
Top