… you could add a line to /etc/src.conf to have the ports with kernel modules (and their dependencies) rebuilt during the build. An example:
PORTS_MODULES=x11/nvidia-driver-390 emulators/virtualbox-ose-kmod graphics/drm-kmod sysutils/openzfs-kmod
. This is not without its own issues so watch out for bugs like PR 259702 which until fixed requires either manually answering through all make config
dialogs (portupgrade/portmaster can help), not building with 'any' -j setting (-j1 is a setting and will fail too), or splitting the build step into 2 parts with the second setting PORTS_MODULES and removing the -j setting. First workaround keeps correct build performance but is a step that cannot be skipped, 2nd will slow down the build (amount increases with the number of cores in the machine), 3rd also increases build times but only during the port build process but if the port also (re)builds large things like llvm or gcc then remember those too may now be running without a desired -j. Of course, you can ignore these if you just manually rebuild+reinstall the ports after world+kernel are rebuilt+reinstalled but your steps likely are now back to the first paragraph.
…