Correctly installing Linux Tegra Kernel modules


I have successfully rebuilt the Linux kernel (kernel-5.10) for a Jetson AGX Xavier as explained here: Kernel Customization — Jetson Linux<br/>Developer Guide 34.1 documentation

I did some modifications (adding printk messages) to some kernel modules, for example these files:
kernel/kernel-5.10/sound/soc/tegra/tegra210_i2s.c, kernel/kernel-5.10/sound/soc/tegra/tegra210_adsp.c, and a couple of other files.

After re-flashing the device with the new kernel Image + modules, I have enough reason to believe my changes in those files have not been applied. In other words, the unchanged modules from before still seem to be those used by the kernel. I view my changes by looking at the output in the dmesg buffer.

After rebuilding the kernel, I (successfully) installed the modules with (modified to fit my paths):

$ sudo make ARCH=arm64 O=$TEGRA_KERNEL_OUT modules_install \

I also compressed the modules with:

tar --owner root --group root -cjf kernel_supplements.tbz2 \

and replaced the kernel_supplements.tbz2 file in Linux_for_Tegra/rootfs/ with the new file.

I then ran the regular flashing commands for the Jetson AGX Xavier:

sudo ./
sudo ./tools/
sudo ./ jetson-agx-xavier-devkit internal

I believe these are all the steps required (I may be mistaken) to correctly rebuild the kernel + modules and apply them.

Does anyone have a hint on what could be the issue? That is, why the changes I made don’t seem to be taken into account?


During your kernel Image file build, did you update “CONFIG_LOCALVERSION”? If so, then what was the version? This is what the suffix is from the command “uname -r”. The kernel itself provides that output, whereby the prefix is the kernel version, and the suffix is the CONFIG_LOCALVERSION.

Modules themselves are searched for at:
/lib/modules/$(uname -r)/kernel

If you have the same CONFIG_LOCALVERSION, then you probably won’t be able to tell it apart without looking at the actual configuration; if that is different, then you just have to use “uname -r” to know.

In the case of using configuration, if the configuration is different, then you’ll be able to compare the “.config” of the build to “zcat /proc/config.gz” (that might be a long process if you are just using diff as order might not be the same).

If security fuses are burned, then only the signed partition version of the kernel is used, but otherwise the LINUX file specified in extlinux.conf should be correct. If you boot and get a full serial console boot log, then that should also verify which kernel is used (the extlinux.conf kernel versus the partition kernel).

If your changes use a different driver than the one you expect, then perhaps all of the changes are actually there.

Thank you very much for your reply. I will do these verifications.

For the meantime, I succeeded in using my updated drivers by copying them directly to /usr/lib/modules/$(uname -r)/kernel on the destination system.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.