I’m trying to build an external kernel module on a Jetson system running:
JetPack 6.1
L4T R36.4.0
Kernel: 5.15.148‑tegra
Custom carrier board (not an NVIDIA devkit)
Here is what I do:
I download the official JetPack 6.1 kernel sources from NVIDIA
I apply the patch provided by the carrier board vendor
I do NOT patch the kernel sources , The board vendor provides patches that must be applied inside the rootfs/ folder
(i.e., patches for the flashed image, not for the kernel source tree)
I build my module
When loading it on the target, I get symbol version mismatch errors like:
<module>.ko: disagrees about version of symbol tegracam_v4l2subdev_register
<module>.ko: Unknown symbol tegracam_v4l2subdev_register (err -22)
My questions:
What is the recommended way to build out‑of‑tree modules on JetPack 6.1 / L4T r36.4.0 to avoid tegracam_* symbol mismatch?cat nv_tegra/nv_tegra_release
*** Please note that this reply is generated by LLM automatically ***
To build an external kernel module on a Jetson system running a non-NVIDIA devkit, you need to ensure that the kernel source tree and the kernel headers match the running kernel on the target system. Here’s a step-by-step guide to help you build out-of-tree modules and avoid symbol version mismatch errors:
Option 1: Prepare the Jetson Linux kernel headers on a non-Jetson system
Download the kernel source tree from NVIDIA.
Apply the patches provided by the board vendor for the flashed image.
Build the kernel source tree to generate the kernel headers.
Install the kernel headers on your non-Jetson system.
Use the installed kernel headers to build your external kernel module.
Option 2: Use a manually built kernel source tree
Download the kernel source tree from NVIDIA.
Apply the patches provided by the board vendor for the flashed image.
Build the kernel source tree to generate the kernel headers.
Use the built kernel source tree to build your external kernel module.
Option 3: Prepare a kernel source tree that is not built
Download the kernel source tree from NVIDIA.
Apply the patches provided by the board vendor for the flashed image.
Use the kernel source tree to build your external kernel module.
In all cases, make sure that the kernel source tree and the kernel headers match the running kernel on the target system.
Comparison of options
Option 1 is recommended if you want to build the kernel headers on a non-Jetson system. This option allows you to use the installed kernel headers to build your external kernel module.
Option 2 is recommended if you want to use a manually built kernel source tree. This option allows you to use the built kernel source tree to build your external kernel module.
Option 3 is not recommended as it may lead to symbol version mismatch errors.
Additional tips
Make sure that the kernel source tree and the kernel headers match the running kernel on the target system.
Use the make modules_prepare command to prepare the kernel source tree for building external kernel modules.
Use the make M=<module_dir> command to build your external kernel module.
Use the modinfo command to check the symbol version of your external kernel module.
By following these steps and tips, you should be able to build out-of-tree modules and avoid symbol version mismatch errors.
*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***