Page MenuHomeFreeBSD

FreeBSD Handbook: OS upgrades: kernel modules
ClosedPublic

Authored by grahamperrin on Apr 9 2023, 6:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 29, 3:18 PM
Unknown Object (File)
Nov 29 2024, 9:25 PM
Unknown Object (File)
Nov 25 2024, 8:56 PM
Unknown Object (File)
Nov 24 2024, 8:22 PM
Unknown Object (File)
Nov 24 2024, 4:39 AM
Unknown Object (File)
Nov 24 2024, 2:53 AM
Unknown Object (File)
Nov 23 2024, 8:40 AM
Unknown Object (File)
Nov 22 2024, 7:43 AM

Details

Summary

Affects:

https://github.com/freebsd/freebsd-doc/pull/164 condensed:

  • forewarn users that FreeBSD-provided packages of kernel modules might be unusable with a new version of the OS until some time after the version is announced.

An example of a module that will not load following a simple forced upgrade of its package:

text
root@fuji:~ # kldload vboxdrv
kldload: an error occurred while loading module vboxdrv. Please check dmesg(8) for more details.
root@fuji:~ # pkg upgrade --force --quiet --yes virtualbox-ose-kmod && kldload vboxdrv && uname -aKU
kldload: an error occurred while loading module vboxdrv. Please check dmesg(8) for more details.
root@fuji:~ # uname -aKU
FreeBSD fuji 13.2-RELEASE FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC amd64 1302001 1302001
root@fuji:~ # dmesg | tail -n 2
KLD vboxdrv.ko: depends on kernel - not available or version mismatch
linker_load_file: /boot/modules/vboxdrv.ko - unsupported file type
root@fuji:~ #

Origin of this diff:

Test Plan

Diff Detail

Repository
R9 FreeBSD doc repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

grahamperrin created this revision.
jrm added inline comments.
documentation/content/en/books/handbook/cutting-edge/_index.adoc
270

..might *not* be suitable for 13.2.

grahamperrin edited the summary of this revision. (Show Details)

Accepting Glen's suggestion.

ceri added inline comments.
documentation/content/en/books/handbook/cutting-edge/_index.adoc
262

not use the newest

grahamperrin added inline comments.
documentation/content/en/books/handbook/cutting-edge/_index.adoc
262

An example of a module that will not load following a simple forced upgrade of its package:

Confirming that the same version of the module does load following build from source (in a jail that is upgraded to 13.2-RELEASE):

root@fuji:~ # poudriere bulk -j thirteen -J 4 -Ctv emulators/virtualbox-ose-kmod
…
root@fuji:~ # pkg upgrade --force -r poudriere virtualbox-ose-kmod
Updating poudriere repository catalogue...
poudriere repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        virtualbox-ose-kmod-6.1.36 [poudriere]

Number of packages to be reinstalled: 1

Proceed with this action? [y/N]: y
[1/1] Reinstalling virtualbox-ose-kmod-6.1.36...
[1/1] Extracting virtualbox-ose-kmod-6.1.36: 100%
root@fuji:~ # kldload vboxdrv
root@fuji:~ # kldstat | grep vb
20    1 0xffffffff82dbf000    590f0 vboxdrv.ko
root@fuji:~ #
documentation/content/en/books/handbook/cutting-edge/_index.adoc
262

newer

… is probably better than newest

Related to this, I think the best advice would be to use PORTS_MODULES in /etc/make.conf. At least when the problem happens in CURRENT.
Unfortunately this piece of information has gone away in the last revamp of the X11 chapter of the handbook.
I think we should get it back.

Related to this, I think the best advice would be to use PORTS_MODULES in /etc/make.conf.
Unfortunately this piece of information has gone away in the last revamp of the X11 chapter of the handbook.
I think we should get it back.

What part? No problem to get it back, let me know the part and I'll add it again

For now, can we get the warning in quickly? Then refine things.

Someone from FreeBSD Forums contacted me in IRC/Matrix drawing attention to a case today that involves the virtualbox-ose-kmod example above:

Thanks

Related to this, I think the best advice would be to use PORTS_MODULES in /etc/make.conf.
Unfortunately this piece of information has gone away in the last revamp of the X11 chapter of the handbook.
I think we should get it back.

What part? No problem to get it back, let me know the part and I'll add it again

It would be this.
However, although it talks about a graphic driver, it is more general and it is related to updating from sources. So maybe that piece should go near here.
I don't know if pkg(8) has a similar system that would trigger the rebuild of a module if the system is binary updated (as with freebsd-update).

Related to this, I think the best advice would be to use PORTS_MODULES in /etc/make.conf.
Unfortunately this piece of information has gone away in the last revamp of the X11 chapter of the handbook.
I think we should get it back.

What part? No problem to get it back, let me know the part and I'll add it again

It would be this.
However, although it talks about a graphic driver, it is more general and it is related to updating from sources. So maybe that piece should go near here.
I don't know if pkg(8) has a similar system that would trigger the rebuild of a module if the system is binary updated (as with freebsd-update).

Sure, can you please add a NOTE or something like that? As Graham pointed, we need to fix this ASAP

Thanks for the warnong Fernando and Graham

LGTM.

Let's think about where to reintroduce the PORTS_MODULES information and point there from this warning in a future change.

This revision is now accepted and ready to land.Apr 12 2023, 4:54 PM

LGTM.

Let's think about where to reintroduce the PORTS_MODULES information and point there from this warning in a future change.

Nod

Thanks, overlap with https://github.com/freebsd/freebsd-doc/commit/b8788e696d, I'll manually edit my branch in GitHub to match Allan's changes, then … deal with likely trailing whitespace errors (my habitual mistake) and push.

Sorry, I'll be unable to resolve the conflict at the command line (and please, no offers of help), can someone else do the honours with resolution and commit? Many thanks

This revision now requires review to proceed.Apr 13 2023, 5:14 PM
documentation/content/en/books/handbook/cutting-edge/_index.adoc
323

Without a suitable test system, I couldn't tell for certain whether this should be 13.1 or 13.2.

Looking at the "ns2-bachi-net" kernel example at https://blog.bachi.net/?p=4380, and other real-world examples, I'm fairly certain that it should be 13.1 (for an upgrade from 13.1 to 13.2).

Fixed in GitHub, I'll update the diff in Phabricator.

Is there anything preventing from being committed?

This revision was not accepted when it landed; it landed in state Needs Review.Apr 14 2023, 12:43 PM
This revision was automatically updated to reflect the committed changes.