errror executing modules prepare

I don’t see the underscore ‘_’ between “modules” and “prepare”. If this is copy and paste then I’m thinking it is missing in the actual command. Should be “modules_prepare” instead of “modules prepare”.

However, there are other possible errors even if the “modules_prepare” is correct. Typically what I’ve done is to copy the “source_sync.sh” from the host PC to the Jetson at “/usr/src”, run something like this to get full source:

./source_sync.sh -k tegra-l4t-r32.1

Now you will have “/usr/src/sources/kernel/kernel-4.9”. Copy the “/proc/config.gz” there, gunzip it, rename as “.config”, set CONFIG_LOCALVERSION=“-tegra” (or whatever your current “uname -r” suffix is), and then update the symbolic link in “/lib/modules/$(uname -r)/”:

cd /lib/modules/$(uname -r)
rm build
ln -s /usr/src/sources/kernel/kernel-4.9 build
cd /usr/src/sources/kernel/kernel-4.9 build
sudo make modules_prepare

At this point you will have a guaranteed full source with any relative paths going outside of the tree also being there. If you want to switch back to the default headers just point the sym link back to the original headers directory.