L4t_generate_ota_package.sh Appsize and NUM_SECTORS

Hello.

I am having some trouble understanding the l4t_generate_ota_package.sh script.
When using the script, how does it know which partition configuration file to use (for example flash_l4t_nvme_rootfs_ab.xml)?

When I do the initial flashing of my device using the l4t_initrd_flash.s script, I have to provide it. This seems to not be possible for the l4t_generate_ota_package.sh script.

When I did the initial flashing, I modified the NUM_SECTORS in the flash_l4t_nvme_rootfs_ab.xml file.
Furthermore, in the board configuration file i set the ROOTFSSIZE=60GiB.
When doing the initial flashing with the l4t_generate_ota_package.sh everything worked as expected.

Now, when I use the l4t_generate_ota_package.sh script with the mentioned adjustments (modified NUM_SECTORS and ROOTFSSIZE) it seems to fail with:
[ 2.9897 ] End sector for APP, expected at: 122159070, actual: 0
Error: Return value 4

However, if I dont do the mentioned changes it seems to generate the ota_package.
But then I am confused of how it will know the ROOTFSSIZE and the NUM_SECTORS that i used in the initial flashing.

I tried not configuring the ROOTFSSIZE in the boardconfig file but providing it to the l4t_generate_ota_package.sh script with the -S option, but i got the same error as above.

Any help is highly appriciated

Hi knezevic,

When you run this script, you will need to specify the board config, which includes the partition layout XML.

Please share the following information:

  1. The physical size of your NVMe SSD
  2. what’s the size you want to use for rootfs?
  3. what’s your base BSP and target BSP version?

How can I specify it?
Currently I use:
sudo ROOTFS_AB=1 ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh --external-device nvme0n1 jetson-orin-nano-devkit R35-4

Edit: I read your comment again, this means when specifying jetson-orin-nano-devkit and ROOTFS_AB=1
this will translate to the flash_l4t_nvme_rootfs_ab.xml, I think I understand that part now.

  1. 250GB
  2. 60GB for each APP partition
  3. Base and Target are both 35.4.1

As mentioned, I generated the ota package using the command above without changing the ROOTFSIZE, thus I expected it to use 55GiB/2= 27.5GiB as this seems to be the default in the p3667.conf.common file.
Furthermore, I left num_sectors=“NUM_SECTORS” in the flash_l4t_nvme_rootfs_ab.xml without changing it to my num_sectors=“488397168” that I used for flashing.

However, when applying the ota package (nv_ota_start.sh), It still did make the App Partitions 60GiB.

In this command, you have specify the jetson-orin-nano-devkit as your board config.

Are you using the devkit or custom board for Orin Nano?

Please configure num_sectors="419430400" in flash_l4t_nvme_rootfs_ab.xml and run the following command to generate OTA package.

$ sudo -E ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh --external-device nvme0n1 -S 60GiB jetson-orin-nano-devkit R35-4

I am currently using the devkit.

I adjusted the num_sectors="419430400" in the flash_l4t_nvme_rootfs_ab.xml
and did:

$ sudo ROOTFS_AB=1 -E ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh --external-device nvme0n1 -S 60GiB jetson-orin-nano-devkit R35-4

I still get the same error:
[ 2.9897 ] End sector for APP, expected at: 122159070, actual: 0
Error: Return value 4

Please note that if i dont specify the num_sectors and don’t provide the -S option to the script the generating of the ota image will work, and if i apply the package (doing the ota update), it will still have the 60GiB that i initially flashed.

Please modify flash_l4t_t234_nvme_rootfs_ab.xml instead of flash_l4t_nvme_rootfs_ab.xml.

Do you mean that if you don’t modify anything, the result is expected…? (rootfs would be 60GiB?)

Can you explain the difference between those 2 files?

When I did the initial flashing of my device I used:

sudo ROOTFS_AB=1  ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_nvme_rootfs_ab.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" --showlogs --network usb0 jetson-orin-nano-devkit internal

What I mean is if I don’t modify the NUM_OF_SECTORS and dont provive the -S option, the result is what I want, but not what I expect. I expect the rootfs would be 55GiB/2 as described in the p3767.conf.common file:

ROOTFSSIZE=55GiB;
....
# Rootfs A/B:
if [ "${ROOTFS_AB}" == 1 ]; then
	rootfs_ab=1
	val=$(echo ${ROOTFSSIZE} | sed 's/GiB//g');
	val=`expr ${val} / 2`;
	ROOTFSSIZE="${val}GiB";
fi;

But as explained, when I do the OTA update it is 60GiB.

The APP partition in flash_l4t_t234_nvme_rootfs_ab.xml is put at the end of the disk.
However, The APP partition in flash_l4t_nvme_rootfs_ab.xml is put at the start of the disk.

You should use flash_l4t_t234_nvme_rootfs_ab.xml to flash the board of T234 series.

As my understanding, it should be 55GiB/2 as the default rootfs size.
How could it know 60GB if you never specify this size…?

I did specify it when doing the initial flashing.

Anyway, I modified the num_sectors in flash_l4t_t234_nvme_rootfs_ab.xml now and everything worked as expected.

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