How to flash only the kernel and device tree when using the initrd flash method

I’m looking for a way to flash the kernel and device tree to the TX2 NX. We’re using the initrd flash method for its ROOTFS_AB support and up until now we’re flashing the entire device in one hit using:

ROOTFS_AB=1 ./tools/kernel_flash/ --flash-only --external-device sda1 -S 40GiB -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_ab.xml jetson-xavier-nx-devkit-tx2-nx external

The problem we’ve having now is that we need to be able to do a kernel and device tree update without updating the entire root filesystem. I’ve read through the README_initrd_flash.txt but I wasn’t able to find a way to do this.

Can anyone suggest how to go about this?

hello zsaleeba,

you should be able to enable “-k” option, initrd flash can flash one partition based on the partition label specified in the index file.
may I also confirm the JetPack release version you’re currently working with, thanks

We’re using JetPack 4.6.2.

Since we have an A-B boot setup we have quite a few partitions:

Number  Start   End     Size    File system  Name               Flags
 1      20.5kB  42.9GB  42.9GB  ext4         APP                msftdata
 2      42.9GB  85.9GB  42.9GB  ext4         APP_b              msftdata
 3      85.9GB  86.0GB  67.1MB               kernel             msftdata
 4      86.0GB  86.0GB  67.1MB               kernel_b           msftdata
 5      86.0GB  86.0GB  459kB                kernel-dtb         msftdata
 6      86.0GB  86.0GB  459kB                kernel-dtb_b       msftdata
 7      86.0GB  86.1GB  66.1MB               recovery           msftdata
 8      86.1GB  86.1GB  524kB                recovery-dtb       msftdata
 9      86.1GB  86.1GB  262kB                kernel-bootctrl    msftdata
10      86.1GB  86.1GB  262kB                kernel-bootctrl_b  msftdata
11      86.1GB  86.2GB  105MB                RECROOTFS          msftdata
12      86.2GB  500GB   414GB   ext4         UDA                msftdata

Is it sufficient to replace the contents of the active ‘kernel’ and ‘kernel-dtb’ partitions with the kernel ‘Image’ file and ‘tegra186-p3636-0001-p3509-0000-a01.dtb’ respectively? Is there anything else which needs to be done?

Can I just ‘dd’ the files on to these partitions instead of using the flash script if I’m doing an OTA to the device and need to run the update locally rather than via USB?

hello zsaleeba,

you cannot dd them directly, since those binary files were sign/encrypted before flashing into partitions.
however, you may try running flash script with --no-flash to generate sign/encrypted files, then you’ll able copy them with dd utility.

Word of caution: When using dd to fill in a partition, especially a signed partition (where the signature can add a few bytes), make sure the partition is large enough to hold the dd content.

Thanks. I’ll keep that in mind.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.