Building external module for Xavier - JetPack 4.2

I was trying to build external module, but “sudo make modules_prapare” failed with

$sudo make modules_prepare
scripts/kconfig/conf  --silentoldconfig Kconfig
drivers/net/ethernet/nvidia/Kconfig:30: can't open file "drivers/net/ethernet/nvidia/eqos/Kconfig"
scripts/kconfig/Makefile:37: recipe for target 'silentoldconfig' failed
make[2]: *** [silentoldconfig] Error 1
Makefile:565: recipe for target 'silentoldconfig' failed
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target 'modules_prepare'.  Stop.

Building external modules without running “sudo make modules_prapare” produced “loading out-of-tree module taints kernel.” and module would not load.

Were you building natively on the Xavier? Was this the full kernel source, and if so, from where? Or is this an external module?

I was building a PCIe driver module for an FPGA card natively on the Xavier. For earlier versions of L4Ts (e.g., L4T 28.1), I don’t need full kernel source to build driver modules, I only need run “sudo make modules_prepare” under /usr/src/linux-headers-4.x.x-tegra" before I build the external driver modules.

Others seem have the some issues:

https://devtalk.nvidia.com/default/topic/1042347/jetson-agx-xavier/-quot-sudo-make-modules_prepare-quot-fails/

1 Like

You will want to see this:
https://devtalk.nvidia.com/default/topic/1050013/jetson-tx2/r32-1-tx2-how-can-i-build-extra-module-in-the-tegra-device/post/5332292/#5332292

Basically it adds or fixes module header content. Perhaps it isn’t the most eloquent approach to install the full source as headers, but it is guaranteed to be valid after that.

The approach of install kernel source on Xavier and use config.gz from Xavier worked.
Thanks!