Remotely Updating the Rootfs for Jetson NX using NVMe

Hi there,

My aim is to be able to be able to remotely update the rootfs which I believe is possible from the documentation:
https://docs.nvidia.com/jetson/archives/r35.1/DeveloperGuide/text/SD/SoftwarePackagesAndTheUpdateMechanism.html#updating-jetson-linux-with-image-based-over-the-air-update

Specifically the section:

The OTA tool package can be used to create OTA payload package for … Updating the rootfs only

MyEquipment:

  • Jetson NX carrier board
  • Jetpack 5.0.2
  • Required to boot from an external NVMe SSD
  • Host computer Ubuntu 20.04

I followed workflow 4 in README_initrd_flash.txt to derive the following, to initially flash my NX:

sudo ROOTFS_AB=1 ./tools/kernel_flash/l4t_initrd_flash.sh \
      --external-device nvme0n1 \
      -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_ab.xml \
      -S 8GiB  --showlogs \
      jetson-xavier-nx-devkit-emmc external

I booted it up and went through the initial setup, so at this point I believe I have a jetson that would be capable of receiving OTA.

Now if we move to my build server I built a new rootfs image, which would be the payload to send OTA. So I tried this:

sudo ROOTFS_AB=1 BOARDID=3668 FAB=100 BOARDSKU=0001 ./tools/kernel_flash/l4t_initrd_flash.sh \
      --external-device nvme0n1 \
      -S 8GiB \
      -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_ab.xml \
      --no-flash \
      jetson-xavier-nx-devkit-emmc \
      external

This completed successfully, but it’s here that I start to get stuck.

I tried running the following, assuming that the rootfs image was bootloader/system.img

sudo -E ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh -sr -f bootloader/system.img jetson-xavier-nx-devkit-emmc R32-7

Which gave the output:

SUCCESS: generate binaries for OTA "boardid=3668;fab=100;boardsku=;boardrev=;fuselevel_s=1;chiprev=2;board=jetson-xavier-nx-devkit-emmc;rootdev=mmcblk0p1;signed_img_dir=images-R35-ToT"
SUCCESS: generate binaries for OTA "boardid=3668;fab=100;boardsku=;boardrev=;fuselevel_s=1;chiprev=2;board=jetson-xnx-devkit-emmc-R32i;rootdev=mmcblk0p1;signed_img_dir=images-R32i"
SUCCESS: generate binaries for OTA "boardid=3668;fab=100;boardsku=;boardrev=;fuselevel_s=1;chiprev=2;board=jetson-xnx-devkit-emmc-R32x-R35i;rootdev=mmcblk0p1;signed_img_dir=images-R32x-R35i"
SUCCESS: generate binaries for OTA "boardid=3668;fab=100;boardsku=;boardrev=;fuselevel_s=1;chiprev=2;board=jetson-xnx-devkit-emmc-R35A-R35i;rootdev=mmcblk0p1;signed_img_dir=images-R35A-R35i"
SUCCESS: generate binaries for OTA "boardid=3668;fab=301;boardsku=;boardrev=;fuselevel_s=1;chiprev=2;board=jetson-xavier-nx-devkit-emmc;rootdev=mmcblk0p1;signed_img_dir=images-R35-ToT"
SUCCESS: generate binaries for OTA "boardid=3668;fab=301;boardsku=;boardrev=;fuselevel_s=1;chiprev=2;board=jetson-xnx-devkit-emmc-R32i;rootdev=mmcblk0p1;signed_img_dir=images-R32i"
SUCCESS: generate binaries for OTA "boardid=3668;fab=301;boardsku=;boardrev=;fuselevel_s=1;chiprev=2;board=jetson-xnx-devkit-emmc-R32x-R35i;rootdev=mmcblk0p1;signed_img_dir=images-R32x-R35i"
SUCCESS: generate binaries for OTA "boardid=3668;fab=301;boardsku=;boardrev=;fuselevel_s=1;chiprev=2;board=jetson-xnx-devkit-emmc-R35A-R35i;rootdev=mmcblk0p1;signed_img_dir=images-R35A-R35i"

mount: /home/sr/jetson_setup/vc_mipi_nvidia/build/XavierNXSD_35.1.0/Linux_for_Tegra/R32x_R35-ToT_OTA/sysimg_tmp: wrong fs type, bad option, bad superblock on /dev/loop8, missing codepage or helper program, or other error.
Failed to mount /home/sr/jetson_setup/vc_mipi_nvidia/build/XavierNXSD_35.1.0/Linux_for_Tegra/bootloader/system.img.raw

but the error at the end suggests that I have the wrong file system type. Could you advise please on how to proceed?

Hi chh,

It seems you have -s to Skip generating the rootfs image.

Could you try to remove -f bootloader/system.img in this flash command?

sudo -E ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh -sr jetson-xavier-nx-devkit-emmc R32-7

Are you downgrade from R35.1 to R32.7?
If yes, there should be the layout change and you could not use -r parameter.

So the reason I used the -s parameter was because I thought this command:

sudo ROOTFS_AB=1 BOARDID=3668 FAB=100 BOARDSKU=0001 ./tools/kernel_flash/l4t_initrd_flash.sh \
      --external-device nvme0n1 \
      -S 8GiB \
      -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_ab.xml \
      --no-flash \
      jetson-xavier-nx-devkit-emmc \
      external

generated the rootfs, and stored it in bootloader/system.img? Is my understanding correct there? It’s important that the OTA boots from the NVMe.

Are you downgrade from R35.1 to R32.7?

No I’m not, all I’m trying to do is update the rootfs or possibly the partition layout remotely, I want to keep the BSP the same (for the time being). But at least for the current Jetpack version I’m using (5.0.2), R35-1 doesn’t work. It just shows the usage string. How can I fix that?

If you use -r parameter, it would use bootloader/system.img for rootfs.

Sorry, I’m not very clear about what you want to do. It seems you want to keep rootfs data after image based OTA, is that right?
Which Jetpack release in use now and which release you want to upgrade to?

So my requirement is to be able to have A/B filesystems, both stored on an NVMe, with some other custom partitions for storing specific data.

I don’t really want to change the BSP for the time being, so ideally it’s an OTA that just updates the rootfs. The BSP version goes from 35.1 → 35.1, I’m not bothered so long as I can update the entire rootfs with a new one in the ota_payload_package.tar.gz

Do you mean OTA to the same version?

Does the following command work for your case to create OTA package to update rootfs only?

$ sudo -E ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh -sr jetson-xavier-nx-devkit-emmc R35-1

The command:

chh@chh-desktop:~/Linux_for_Tegra_new_os$ sudo -E ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh -sr jetson-xavier-nx-devkit-emmc R35-1

produced the output:

Target board(JETSON_XAVIER_NX_DEVKIT_EMMC) and base version(R35_1) is not supported
Failed to run "ota_validate_params jetson-xavier-nx-devkit-emmc R35-1 internal /home/chris/projects/jetson_setup/vc_mipi_nvidia/build/XavierNXSD_35.1.0/Linux_for_Tegra_new_os/tools/ota_tools/version_upgrade/ota_board_specs.conf BOARD_SPECS_ARRAY CHIPID"
Usage: sudo ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh [options] <target board> <bsp version>
	Where,
		<target board>: target board. Supported boards: jetson-agx-xavier-devkit, jetson-xavier-nx-devkit-emmc.
		<bsp version>: the version of the base BSP. Supported versions: R32-7.
	options:
		-u <PKC key file>: PKC key used for odm fused board
		-v <SBK key file>: Secure Boot Key (SBK) key used for ODM fused board
		-s	Skip generating system image.
		-b	Update bootloader only. Only valid for update without layout change.
		-r	Update rootfs only. Only valid for update without layout change.
		-o	Specify the script to update rootfs partition.
		-f	Specify the rootfs image to be written to rootfs partition.
Example:
	sudo ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh -u PKCkeyfile -v SBKkeyfile jetson-xavier-nx-devkit-emmc R32-7

It doesn’t accept 35-1 as far as I can tell

It seems updating to the same release is not supported.

What contents do you want to update in rootfs? It seems there’s not necessary for you to update rootfs. Most people would want to update bootloader for driver support. Some people just update current jetpack package in rootfs with apt command.

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