Jetson TX2 Jetpack 4.2 with kernel driver modifications

Hi @gancev,

I couldn’t reproduce this behavior, I’m using 18.04.2 LTS to build the image.

The error you encounter is when using bspatch - brought in by layers/meta-balena-jetson/recipes-devtools/bsdiff - to patch the binary image boot0.img, which will be finally written on the board in /dev/mmcblk0boot0. Since there’s no documentation on how this binary file gets generated during board flashing with the l4t ubuntu tx2 image and host flashing tools, we need to re-construct it using ‘dd’ as you see in the tegra186-flash-dry.bb.

We then use ‘bspatch’ to apply a very small binary diff which will get the image to look exactly like the one existing in a tegra l4t ubuntu image for tx2. To create boot0.bindiff we used bsdiff in devshell of tegra186-flash-dry, and done the diff between what exists in a l4t image in /dev/mmcblk0boot0 and the newboot.img we generate with dd inside the recipe. There’s also a comment inside the recipe that explains why this is done.

Errors like this could also appear if the version of the bsdiff tools you are using is different from the one used to generate the patch. Please ensure the native bspatch from sysroot is being used:
$ MACHINE=jetson-tx2 bitbake tegra186-flash-dry -c devshell
$ which bspatch
.../tmp/work/aarch64-poky-linux/tegra186-flash-dry/32.1.0-r0/recipe-sysroot-native/usr/bin/bspatch
and it is the one brought by the bsdiff recipe from recipes-devtools.

Alternatively you can create your own binary patch using the method I explained above.