Kernel Version and vermagic¶
vermagic is module metadata used by the kernel to check whether a kernel module was built for a compatible kernel configuration.
It is one of the most common failure points when building out-of-tree kernel modules.
Basic Checks¶
On the target:
On the module:
The module vermagic must be compatible with the running target kernel.
Why It Fails¶
Common causes:
- kernel release mismatch
- different
CONFIG_LOCALVERSION - different compiler or architecture setting
- copied headers do not match the running kernel
- symbol versioning mismatch
- building against generic headers instead of Raspberry Pi headers
Example Failure Pattern¶
or:
Practical Debug Checklist¶
- Check target kernel version:
- Check module metadata:
- Check module architecture:
-
Confirm
KDIRpoints to the target kernel headers. -
Rebuild the module after cleaning old build artifacts.
Raspberry Pi Notes¶
Raspberry Pi kernels may include board-specific suffixes and configuration details. When copying headers to a host build machine, keep the header tree consistent with the exact target kernel release.