Hello,
we are facing an issue when building kernel modules (e.g. with dkms) on our Jetson Xavier NX system with JetPack 5.1.1. Below there is a detailed description on how to reproduce the issue, it does not really matter which module is installed. If we are replacing the kernel sources with a fresh download of the sources files, then the module installation works.
The question is why the module build with the original JetPack image is broken and if there is a more straightforward way to fix it than downloading the sources again. We would like to avoid doing this for all our systems.
Thank you.
Steps to reproduce:
Target Hardware: Jetson Xavier NX [DevKit]
SDK Version JetPack 5.1.1
Test modules installation
sudo apt install zfs-dkms
or
sudo apt install xtables-addons-dkms
Error message in case of zfs-dkms
Setting up dkms (2.8.1-5ubuntu2) ...
Setting up zfs-dkms (0.8.3-1ubuntu12.15) ...
Loading new zfs-0.8.3 DKMS files...
It is likely that 5.10.104-tegra belongs to a chroot's host
Building for 5.10.104, 5.10.104-tegra and 5.4.0-164-generic
Module build for kernel 5.10.104 was skipped since the
kernel headers for this kernel does not seem to be installed.
Building initial module for 5.10.104-tegra
Error! The /var/lib/dkms/zfs/0.8.3/5.10.104-tegra/aarch64/dkms.conf for module zfs includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch. This indicates that it should not be built.
Skipped.
Work around :
1) Download public_sources.tbz2 on https://developer.nvidia.com/embedded/jetson-linux-archive
2) Unzip kernel sources
3) Inside /lib/modules/"$(uname -r)" folder set the symbolic link to new kernel source folder
4) Inside kernel source folder
zcat /proc/config.gz | sudo tee YOUR_PATH_TO_KERNEL_SOURCES/.config >/dev/null
sudo make -C /lib/modules/"$(uname -r)"/build modules_prepare
Still reproducing on JetPack 5.1.2