Image based OTA with custom partition

Hi, I’m trying to upgrade my tx2 nx from 32.6.1 to 32.7.4 (carrier board based on xavier nx devkit)

I followed the guide in developer guide, and rootfs upgrade was successful.

But, I found that some partition I added not included in the payload and partition contents were same as 32.6.1

32.6.1 has additional partition named “test_a”, “test_b”, “test_c”

and also

32.7.4 has partition named “test_a”, “test_b”, “test_c”

I saw Image_based_OTA_Examples.txt, and it says If 32.7.4 have a same partition layout as 32.6.1, I have nothing to change. but partition is not updated.

which file I should change?

What I’ve done for add partition is just modified flash_l4t_t186.xml

thanks.

Hi mjnhb20011,

image-based OTA would not support partition layout change during update.
(i.e. your partition should be exact the same for both R32.6.1 and R32.7.4)

Please make sure you are using the same partition layout for R32.6.1 and also the OTA package of R32.7.4.

Image_based_OTA_Examples.txt says I can customize partition layouts. you mean this feature is not support in current release?

Anyway, flash.sh script and flash_l4t_t186.xml is same between rel 32.6.1 and 32.7.4

updated 32.7.4 file system has partition for test_a,b,c,d,e.

files inside test_* partition is changed, and those modifications were not applied in updated 32.7.4

files for 32.6.1 were still exist.

flash_l4t_t186.xml difference between original is

+        <partition name="test_a" type="data">
+            <allocation_policy> sequential </allocation_policy>
+            <filesystem_type> basic </filesystem_type>
+            <size>  TESTSIZE </size>
+            <file_system_attribute> 0 </file_system_attribute>
+            <allocation_attribute> 0x8 </allocation_attribute>
+            <percent_reserved> 0 </percent_reserved>
+            <filename> TESTFILE </filename>
+            <description> **Required.** Contains the data. </description>
+        </partition>
+        <partition name="test_b" type="data">
+            <allocation_policy> sequential </allocation_policy>
+            <filesystem_type> basic </filesystem_type>
+            <size> TESTSIZE </size>
+            <file_system_attribute> 0 </file_system_attribute>
+            <allocation_attribute> 0x8 </allocation_attribute>
+            <percent_reserved> 0 </percent_reserved>
+            <filename> TESTFILE </filename>
+            <description> **Required.** Contains the as executable file. </description>
+        </partition>
+        <partition name="test_c" type="data">
+            <allocation_policy> sequential </allocation_policy>
+            <filesystem_type> basic </filesystem_type>
+            <size> TESTSIZE </size>
+            <file_system_attribute> 0 </file_system_attribute>
+            <allocation_attribute> 0x8 </allocation_attribute>
+            <percent_reserved> 0 </percent_reserved>
+            <filename> TESTFILE </filename>
+            <description> **Required.** Contains the as executable file. </description>
+        </partition>
+        <partition name="test_d" type="data">
+            <allocation_policy> sequential </allocation_policy>
+            <filesystem_type> basic </filesystem_type>
+            <size> TESTSIZE </size>
+            <file_system_attribute> 0 </file_system_attribute>
+            <allocation_attribute> 0x8 </allocation_attribute>
+            <percent_reserved> 0 </percent_reserved>
+            <filename> TESTFILE </filename>
+            <description> **Required.** Contains the setup data. </description>
+        </partition>
+        <partition name="test_e" type="data">
+            <allocation_policy> sequential </allocation_policy>
+            <filesystem_type> basic </filesystem_type>
+            <size> TESTSIZE </size>
+            <file_system_attribute> 0 </file_system_attribute>
+            <allocation_attribute> 0x8 </allocation_attribute>
+            <percent_reserved> 0 </percent_reserved>
+            <filename> TESTFILE </filename>
+            <description> **Required.** Contains the runtime data. </description>
+        </partition>
         <partition name="UDA" type="data">
             <allocation_policy> sequential </allocation_policy>
             <filesystem_type> basic </filesystem_type>

I thought ota_payload_package.tar.gz should contain test_a,b,c,d,e.img
but there is only system.img

Is there anything I should fix?

What’s the test_a,b,d,e.img used for?

Are they all rootfs? Which partition you are using to mount for rootfs?

Why you expect that there should be multiple system.img?

partition test_a,b,c,d,e is for launching our application. they are all diffrent name, I chaneged it’s name to test_abcde just in case.

I can’t understand what this means.
/dev/mmcblk0p1 → system.img (rootfs)
/dev/mmcblk0p33 → test_a.img
/dev/mmcblk0p34 → test_b.img
/dev/mmcblk0p35 → test_c.img
/dev/mmcblk0p36 → test_d.img
/dev/mmcblk0p37 → test_e.img

/etc/fstab
# <file system> <mount point>             <type>          <options>                               <dump> <pass>
/dev/root            /                     ext4           defaults                                     0 0
/dev/mmcblk0p33      /test_a               ext4           defaults                                     0 0
/dev/mmcblk0p34      /test_b               ext4           defaults                                     0 0
/dev/mmcblk0p35      /test_c               ext4           defaults                                     0 0
/dev/mmcblk0p36      /test_d               ext4           defaults                                     0 0
/dev/mmcblk0p37      /test_e               ext4           defaults                                     0 0

I hope this can answer your question.

I use APP partition to mount rootfs

contents of those partitions are not in system.img so i expected there should be another images to overwrite partitions.

Do you mean that you have the same partition layout for both R32.6.1 and R32.7.4 but the content inside test_* not update after OTA update?
Have you checked if the content in rootfs updated after performing OTA?

Please share the partition layout you are using.
and also 2 log files:

  1. generate OTA package on the host
  2. serial console log from the board when OTA update is performed

buld_base_recovery.txt (1.6 KB)
l4t_generate_ota_package.txt (73.4 KB)
nv_ota_start_log.txt (9.1 KB)
ota_performed_log.txt (102.2 KB)

Hi, I uploaded logs of ota processed.

yes, username and password are changed and /etc/nv_tegra_release also changed to 32.7.4.

Hi, @KevinFFF do I need to modify l4t_generate_ota_package.sh and l4t_update_partitions for
copy test_*.img to ota payload and write it to partition?

For R32.6.1 to R32.7.4, you don’t need to run build_base_recovery_image.sh

Making setup.img...
        populating rootfs from /home/mjnhb2001/ota_test/rel_32.7.4/Linux_for_Tegra/setup ... tar: *: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors

Are you using setup.img instead of system.img?

I’m using system.img for rootfs

setup.img is for application setup partition and there is nothing inside (empty partition)

Actually, my goal is changed to update bootloader, rootfs, test_b, test_c

I modified function copy_common_images in l4t_generate_ota_package.sh

to make ota payload include test_b.img test_b.img.sha1sum, test_c.img, test_c.img.sha1sum

I used dd to overwrite test_b, test_c but dd corrupted filesystem.

What I’m trying to do now is

update_rootfs_partition /mnt/ota_work/system.img /dev/mmcblk0p1 /mnt/ota_work

after run this command,

run update_rootfs_partition /mnt/ota_work/test_b.img /dev/mmcblk0p34 /mnt/ota_work

please correct me if I’m wrong.

Thanks

You have to implement this for your custom usage.

You should have only one rootfs. I’m not clear about why you run this manually.

Could you generate the OTA package including your custom partition?

Hi, I modified l4t_generate_ota_package.sh to include partitions image.

Also, created script for update extra partition refer to nv_ota_rootfs_updater.sh

and used it through nv_ota_update_rootfs_in_recovery.sh

I tested and all of the partitions were successfully upgraded.

thanks for your support.

1 Like

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