I cloned the kernel sources and applied all diffs as per jetsonhacks/buildJetsonTX2Kernel1. However, instead of actually building the kernel with makeKernel.sh I executed make bindeb-pkg so my kernel is packaged in a nice, redistributable .deb package.
However this doesn’t work on a Jetson TX2, the following message can be seen from the output:
make2: *** No rule to make target ‘dtbs_install’. Stop.
scripts/package/Makefile:97: recipe for target ‘bindeb-pkg’ failed
make1: *** [bindeb-pkg] Error 2
Makefile:1261: recipe for target ‘bindeb-pkg’ failed
make: *** [bindeb-pkg] Error 2
The full output is available in Pastebin2 (I guess only the last lines are relevant). I didn’t introduce any custom code in the kernel, only enabled some modules that I need (openvswitch, some netfilter features, etc.) Any idea of what could be going on here?
You would simply find the “.dtb” file which you are interested in in the kernel build area. The kernel source has no idea how to install dtb files on something with special requirements like this. Once you have the file you can flash just the file. Specific instructions depend on which L4T version you use (R28.2? “head -n 1 /etc/nv_tegra_release”).
From your kernel build output location something like this:
find . -name '*.dtb'
Earlier releases simply copied the file to “/boot”, newer releases require flashing to a partition (this doesn’t hurt the rootfs).
I now know why the .deb packages can’t be built out of the box. In scripts/package/builddeb, where the following line can be found:
if grep -q dtbs_install "${srctree}/arch/$SRCARCH/Makefile"; then
Which matches the --help message in arch/arm64/Makefile. The option dtbs_install is listed despite that target is not defined in the Makefile. Removing that line makes everything work. I verified the package and it works! \o/
The file in “/boot” could be removed for this particular release…it is an artifact of being left in the script. Actual dtb in this release is from a partition as binary data rather than as a file. You will need to skip the dtbs_install and manually add device tree.