Generating Image with DUVM Disabled in Chain A

Disabling DUVM in one bootchain saves about 512M memory but DUVM is required to support OTA, so DUVM must be enabled in another bootchain.

This chapter describes how to generate the image with DUVM disabled in chain A. The workflow is:

For example, on p3663-01 in Linux:
  1. Create the DUVM enabled bsp_image:
    cd drive-foundation
    ./make/bind_partitions --oot_kernel -b p3663-a01 linux
    sudo rm -rf ${PWD}/../out/bsp_images_enable_duvm
    ./tools/flashtools/bootburn/create_bsp_images.py -b p3663-a01 -B qspi -r 1 -g ${PWD}/../out/bsp_images_enable_duvm 
  2. Create the DUVM disabled bsp_image:
    cd drive-foundation
    ./make/bind_partitions --oot_kernel -b p3663-a01 linux ENABLE_UPDATE_VM=n
    sudo rm -rf ${PWD}/../out/bsp_images_disable_duvm
    ./tools/flashtools/bootburn/create_bsp_images.py -b p3663-a01 -B qspi -r 1 -g ${PWD}/../out/bsp_images_disable_duvm 
  3. Combine the two bsp_image and merge the FileToFlash.txt:
    /bin/cp -r ../out/bsp_images_enable_duvm ../out/bsp_images
    /bin/cp -v ../out/bsp_images_disable_duvm/642-63663-0001-001_TS2/flash-images/A_* ../out/bsp_images/*/flash-images/

    Edit ${PWD}/../out/bsp_images/642-63663-0001-001_TS2/flash-images/FileToFlash.txt, remove all partitions starting with A_, and copy all the partitions starting with A_ from ${PWD}/../out/bsp_images_disable_duvm/642-63663-0001-001_TS2/flash-images/FileToFlash.txt.

    For example:

    ${PWD}/../out/bsp_images/642-63663-0001-001_TS2/flash-images/FileToFlash.txt

    # LinuxPartitionName, PartitionName, FileName, Start, Size, BlockCount, Resize, sku_dependent, BchPartitionName, ImageHeaderType, MD5, ReadWrite
    /dev/block/3270000.spi bct A_bct_BR_zerosign.bct 0 524288 2 0 0 bct 11 0d834af29fe12c88cb4479749c2eee0b 1
    /dev/block/3270000.spi pt 2_PT.bin 524288 524288 2 0 0 pt 12 38c394701d467caa22a79ff189d17ad6 1
    /dev/block/3270000.spi bad-page 4_bad_page_zerosign.bin 47185920 524288 2 0 0 bad-page 13 c8ae3b6fa7dd7f3edce3ef46c72e7dee 0
    /dev/block/3270000.spi A_pt A_1_PT.bin 47710208 262144 1 0 0 A_pt 12 dbaf2e0e579b270df35884ed2b023303 0
    /dev/block/3270000.spi A_mb1-bootloader A_2_mb1_t234_prod_zerosign.bin 47972352 524288 2 0 0 A_mb1-bootloader 12 8f9745dfa3bee493fb9acdf8ceae60e5 0
    ... ...
    /dev/block/2500000.ufshci:0 A_2_kernel-dtb A_2_2_tegra_dtb_zerosign.dtb 29043720192 262144 64 0 0 A_2_kernel-dtb 12 6192fd847cac917e6c815a23dfdbe8d2 0
    /dev/block/2500000.ufshci:0 A_2_kernel A_2_3_kernel_zerosign.img 29043982336 24641536 6016 0 0 A_2_kernel 12 cd311f5a0e155fb544c203845c29ae05 0
    /dev/block/2500000.ufshci:0 pers-ota 12_pers-ota_null 111937585152 268435456 65536 0 0 pers-ota 4 d41d8cd98f00b204e9800998ecf8427e 1
    # LinuxPartitionName, PartitionName, FileName, Start, Size, BlockCount, Resize, sku_dependent, BchPartitionName, ImageHeaderType, MD5, ReadWrite
    /dev/block/3270000.spi B_pt B_1_PT.bin 57409536 262144 1 0 0 B_pt 12 dbaf2e0e579b270df35884ed2b023303 0
    /dev/block/3270000.spi B_mb1-bootloader B_2_mb1_t234_prod_zerosign.bin 57671680 524288 2 0 0 B_mb1-bootloader 12 8f9745dfa3bee493fb9acdf8ceae60e5 0
    ... ...
    /dev/block/2500000.ufshci:0 B_2_kernel-dtb B_2_2_tegra_dtb_zerosign.dtb 84878295040 262144 64 0 0 B_2_kernel-dtb 12 6192fd847cac917e6c815a23dfdbe8d2 0
    /dev/block/2500000.ufshci:0 B_2_kernel B_2_3_kernel_zerosign.img 84878557184 24641536 6016 0 0 B_2_kernel 12 cd311f5a0e155fb544c203845c29ae05 0
    # LinuxPartitionName, PartitionName, FileName, Start, Size, BlockCount, Resize, sku_dependent, BchPartitionName, ImageHeaderType, MD5, ReadWrite
    /dev/block/3270000.spi C_pt C_1_PT.bin 1048576 262144 1 0 0 C_pt 12 e35f0efb6ceb1a9143f04a9b96839da0 0
    /dev/block/3270000.spi C_mb1-bootloader C_2_mb1_t234_prod_zerosign.bin 1310720 524288 2 0 0 C_mb1-bootloader 12 8f9745dfa3bee493fb9acdf8ceae60e5 0
    ... ...
    /dev/block/3270000.spi C_2_kernel-dtb C_2_2_tegra_dtb_zerosign.dtb 38535168 262144 1 0 0 C_2_kernel-dtb 12 91f6383654cd23d4c8e90a25836a2c7b 0
    /dev/block/3270000.spi C_2_kernel C_2_3_kernel_zerosign.img 38797312 6291456 24 0 0 C_2_kernel 12 cd311f5a0e155fb544c203845c29ae05 0 
    ${PWD}/../out/bsp_images_disable_duvm/642-63663-0001-001_TS2/flash-images/FileToFlash.txt
    # LinuxPartitionName, PartitionName, FileName, Start, Size, BlockCount, Resize, sku_dependent, BchPartitionName, ImageHeaderType, MD5, ReadWrite
    /dev/block/3270000.spi bct A_bct_BR_zerosign.bct 0 524288 2 0 0 bct 11 0d834af29fe12c88cb4479749c2eee0b 1
    /dev/block/3270000.spi pt 2_PT.bin 524288 524288 2 0 0 pt 12 0897c7557db1a5a9ac0cffbc9c434612 1
    /dev/block/3270000.spi bad-page 4_bad_page_zerosign.bin 47185920 524288 2 0 0 bad-page 13 c8ae3b6fa7dd7f3edce3ef46c72e7dee 0
    /dev/block/3270000.spi A_pt A_1_PT.bin 47710208 262144 1 0 0 A_pt 12 986d803850e8b875b516d8e631341c9d 0
    /dev/block/3270000.spi A_mb1-bootloader A_2_mb1_t234_prod_zerosign.bin 47972352 524288 2 0 0 A_mb1-bootloader 12 8f9745dfa3bee493fb9acdf8ceae60e5 0
    ... ...
    /dev/block/2500000.ufshci:0 A_1_gos0-gpt A_1GPT_bak28_00.bin 27969581056 135168 33 0 0 A_1_gos0-gpt 4 99727eb540f7cf04721e2247947cb265 0
    /dev/block/2500000.ufshci:0 A_gos0-rw-overlay A_gos0-rw-overlay_35_ext4.img 27969716224 1073741824 262144 1 0 A_gos0-rw-overlay 4 a3a905f260af21eeec4fa816ff70a709 1
    # LinuxPartitionName, PartitionName, FileName, Start, Size, BlockCount, Resize, sku_dependent, BchPartitionName, ImageHeaderType, MD5, ReadWrite
    /dev/block/3270000.spi B_pt B_1_PT.bin 57409536 262144 1 0 0 B_pt 12 986d803850e8b875b516d8e631341c9d 0
    /dev/block/3270000.spi B_mb1-bootloader B_2_mb1_t234_prod_zerosign.bin 57671680 524288 2 0 0 B_mb1-bootloader 12 8f9745dfa3bee493fb9acdf8ceae60e5 0
    ... ...
    /dev/block/2500000.ufshci:0 B_1_gos0-gpt B_1GPT_bak28_00.bin 83804155904 135168 33 0 0 B_1_gos0-gpt 4 99727eb540f7cf04721e2247947cb265 0
    /dev/block/2500000.ufshci:0 B_gos0-rw-overlay B_gos0-rw-overlay_35_ext4.img 83804291072 1073741824 262144 1 0 B_gos0-rw-overlay 4 aa7089bb3a4bdd46ed51dd6b7dc1e448 1
    # LinuxPartitionName, PartitionName, FileName, Start, Size, BlockCount, Resize, sku_dependent, BchPartitionName, ImageHeaderType, MD5, ReadWrite
    /dev/block/3270000.spi C_pt C_1_PT.bin 1048576 262144 1 0 0 C_pt 12 e35f0efb6ceb1a9143f04a9b96839da0 0
    /dev/block/3270000.spi C_mb1-bootloader C_2_mb1_t234_prod_zerosign.bin 1310720 524288 2 0 0 C_mb1-bootloader 12 8f9745dfa3bee493fb9acdf8ceae60e5 0
    ... ...
    /dev/block/3270000.spi C_2_kernel-dtb C_2_2_tegra_dtb_zerosign.dtb 38535168 262144 1 0 0 C_2_kernel-dtb 12 2a4a2a367f01f64fda1fa3d1632c4156 0
    /dev/block/3270000.spi C_2_kernel C_2_3_kernel_zerosign.img 38797312 6291456 24 0 0 C_2_kernel 12 cd311f5a0e155fb544c203845c29ae05 0

    Remove the line A_pt to A_2_kernel in ${PWD}/../out/bsp_images/642-63663-0001-001_TS2/flash-images/FileToFlash.txt, then copy the A_pt to A_gos0-rw-overlay in ${PWD}/../out/bsp_images_disable_duvm/642-63663-0001-001_TS2/flash-images/FileToFlash.txt and paste to ${PWD}/../out/bsp_images/642-63663-0001-001_TS2/flash-images/FileToFlash.txt.

    The final result in ${PWD}/../out/bsp_images/642-63663-0001-001_TS2/flash-images/FileToFlash.txt:
    # LinuxPartitionName, PartitionName, FileName, Start, Size, BlockCount, Resize, sku_dependent, BchPartitionName, ImageHeaderType, MD5, ReadWrite
    /dev/block/3270000.spi bct A_bct_BR_zerosign.bct 0 524288 2 0 0 bct 11 0d834af29fe12c88cb4479749c2eee0b 1
    /dev/block/3270000.spi pt 2_PT.bin 524288 524288 2 0 0 pt 12 38c394701d467caa22a79ff189d17ad6 1
    /dev/block/3270000.spi bad-page 4_bad_page_zerosign.bin 47185920 524288 2 0 0 bad-page 13 c8ae3b6fa7dd7f3edce3ef46c72e7dee 0
    /dev/block/3270000.spi A_pt A_1_PT.bin 47710208 262144 1 0 0 A_pt 12 986d803850e8b875b516d8e631341c9d 0
    /dev/block/3270000.spi A_mb1-bootloader A_2_mb1_t234_prod_zerosign.bin 47972352 524288 2 0 0 A_mb1-bootloader 12 8f9745dfa3bee493fb9acdf8ceae60e5 0
    ... ...
    /dev/block/2500000.ufshci:0 A_1_gos0-gpt A_1GPT_bak28_00.bin 27969581056 135168 33 0 0 A_1_gos0-gpt 4 99727eb540f7cf04721e2247947cb265 0
    /dev/block/2500000.ufshci:0 A_gos0-rw-overlay A_gos0-rw-overlay_35_ext4.img 27969716224 1073741824 262144 1 0 A_gos0-rw-overlay 4 a3a905f260af21eeec4fa816ff70a709 1
    /dev/block/2500000.ufshci:0 pers-ota 12_pers-ota_null 111937585152 268435456 65536 0 0 pers-ota 4 d41d8cd98f00b204e9800998ecf8427e 1
    # LinuxPartitionName, PartitionName, FileName, Start, Size, BlockCount, Resize, sku_dependent, BchPartitionName, ImageHeaderType, MD5, ReadWrite
    /dev/block/3270000.spi B_pt B_1_PT.bin 57409536 262144 1 0 0 B_pt 12 dbaf2e0e579b270df35884ed2b023303 0
    /dev/block/3270000.spi B_mb1-bootloader B_2_mb1_t234_prod_zerosign.bin 57671680 524288 2 0 0 B_mb1-bootloader 12 8f9745dfa3bee493fb9acdf8ceae60e5 0
    ... ...
    /dev/block/2500000.ufshci:0 B_2_kernel-dtb B_2_2_tegra_dtb_zerosign.dtb 84878295040 262144 64 0 0 B_2_kernel-dtb 12 6192fd847cac917e6c815a23dfdbe8d2 0
    /dev/block/2500000.ufshci:0 B_2_kernel B_2_3_kernel_zerosign.img 84878557184 24641536 6016 0 0 B_2_kernel 12 cd311f5a0e155fb544c203845c29ae05 0
    # LinuxPartitionName, PartitionName, FileName, Start, Size, BlockCount, Resize, sku_dependent, BchPartitionName, ImageHeaderType, MD5, ReadWrite
    /dev/block/3270000.spi C_pt C_1_PT.bin 1048576 262144 1 0 0 C_pt 12 e35f0efb6ceb1a9143f04a9b96839da0 0
    /dev/block/3270000.spi C_mb1-bootloader C_2_mb1_t234_prod_zerosign.bin 1310720 524288 2 0 0 C_mb1-bootloader 12 8f9745dfa3bee493fb9acdf8ceae60e5 0
    ... ...
    /dev/block/3270000.spi C_2_kernel-dtb C_2_2_tegra_dtb_zerosign.dtb 38535168 262144 1 0 0 C_2_kernel-dtb 12 91f6383654cd23d4c8e90a25836a2c7b 0
    /dev/block/3270000.spi C_2_kernel C_2_3_kernel_zerosign.img 38797312 6291456 24 0 0 C_2_kernel 12 cd311f5a0e155fb544c203845c29ae05 0