Why the built modules based on Nvidia official kernel source?

The size of modules in rootfs of l4t 32.2.1 after running apply_binaries.sh is just 47M, it’s an copy in package ‘kernel_supplements.tbz2’. But the size of lib/modules is 882M after I build the kernel, almost eighteen times bigger than that of the official providing modules.

So there must be many unnecessary modules in our building modules, but how to reduce its size and make sure it is sufficient for running target board?

FYR,

garret:~/tx2/Appro_tx2/Appro_tx2_src/kernel_out/lib/modules$ du -h --max-depth=1
882M	./4.9.140
882M	

garret:~/tx2/Linux_for_Tegra_32.2.1/kernel/kernel_supplements/lib/modules$ du -h --max-depth=1
47M	./4.9.140-tegra
47M	

garret:~/tx2/Linux_for_Tegra_32.2.1/rootfs/lib/modules$ du -h --max-depth=1
47M	./4.9.140-tegra
47M

The official driver has smaller size because we strip them after compilation.

$ <tool_chain_path>/aarch64-linux-gnu-strip --strip-unneeded <path-of-kernel-module.ko>

1 Like

@WayneWWW

Thank you so much.