How to flash a pre built image with secureboot?

Hi,

This is a follow up post from Secureboot on Nano.

Thanks to your support,
now I can successfully flash an image enabled Secureboot, but in which a system.img is rebuilt even with an option -r.

Thus, we can not burn our own image (APP) for our product.

Please let us know an option to achieve this.

Thanks.

Hi,
There is a README for mass flash:

nvidia/nvidia_sdk/JetPack_4.3_Linux_P3448/Linux_for_Tegra/README_Massflash.txt 

Please take a look. you should be able to do mass flash by following the steps.

nvidia/nvidia_sdk/JetPack_4.3_Linux_P3448/Linux_for_Tegra/README_Massflash.txt

Thanks. I have never realized this exists.

I will try this, but with this method, the pre-built image is not replaced with the default one, right?

I followed the guide and confirmed -r option did work, but ended up with an error Error: </partition> does not exist.. What does this error mean?

$ sudo ./nvmassflashgen.sh -x 0x21 -y PKC -u ../emi_pkc.pem -r jetson-nano-emmc mmcblk0p1
================================================================================
|| Generate Massflash Image in the master host:                               ||
|| Requires the Jetson connected in RCM mode.                                 ||
================================================================================
1 Jetson devices in RCM mode. USB: 3-9
+-------------------------------------------------------------------------------
| Step 1: Generate Command File
+-------------------------------------------------------------------------------
###############################################################################
# L4T BSP Information:
# R32 , REVISION: 3.1
###############################################################################
Board ID() version() 
copying bctfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/BCT/P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg)... done.
copying bootloader(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
copying initrd(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/l4t_initrd.img)... done.
	populating kernel to rootfs... done.
	populating initrd to rootfs... done.
	populating /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a00.dtb to rootfs... done.
Making Boot image... done.
Existing sosfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/nvtboot_recovery.bin) reused.
copying tegraboot(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/nvtboot.bin)... done.
copying cpu_bootloader(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
copying bpffile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/sc7entry-firmware.bin)... done.
Existing badpagefile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/badpage.bin) reused.
copying wb0boot(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/warmboot.bin)... done.
Existing tosfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/tos-mon-only.img) reused.
Existing eksfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/eks.img) reused.
copying dtbfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a00.dtb)... done.
Copying nv_boot_control.conf to rootfs
Reusing existing system.img... 
done.
Existing tbcfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/nvtboot_cpu.bin) reused.
copying tbcdtbfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a00.dtb)... done.
copying cfgfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/cfg/flash_l4t_t210_emmc_p3448.xml) to flash.xml... done.
copying flasher(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
Existing flashapp(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/tegraflash.py) reused.
./tegraflash.py --cfg flash.xml --bl cboot.bin --bct  P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg --odmdata 0x94000 --bldtb tegra210-p3448-0000-p3449-0000-a00.dtb.signed --applet nvtboot_recovery.bin    --cmd "sign"  --chip 0x21 --key /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/emi_pkc.pem  
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
 
[   0.0110 ] tegrasign --key /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/emi_pkc.pem --getmode mode.txt
[   0.0125 ] PKC key in Open SSL format
[   0.0129 ] Key size is 256 bytes
[   0.0171 ] 
[   0.0824 ] Generating RCM messages
[   0.0843 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 0 --download rcm nvtboot_recovery.bin 0 0
[   0.0863 ] RCM 0 is saved as rcm_0.rcm
[   0.0873 ] RCM 1 is saved as rcm_1.rcm
[   0.0876 ] List of rcm files are saved in rcm_list.xml
[   0.0876 ] 
[   0.0876 ] Signing RCM messages
[   0.0896 ] tegrasign --key /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/emi_pkc.pem --list rcm_list.xml --pubkeyhash pub_key.key
[   0.0916 ] PKC key in Open SSL format
[   0.0921 ] Key size is 256 bytes
[   0.0924 ] Saving public key  in pub_key.key
[   0.2958 ] Saving public key Hash as binary: pub_key.hash
[   0.2958 ] Saving public key Hash as big-endian text: pub_key.hash_txt
[   0.2958 ] Saving public key Hash as little-endian(sysfs) text: pub_key.hash_sysfs_txt
[   0.2958 ] 
[   0.2959 ] Copying signature to RCM mesages
[   0.2978 ] tegrarcm --chip 0x21 0 --updatesig rcm_list_signed.xml --pubkeyhash pub_key.key
[   0.3006 ] 
[   0.3007 ] Parsing partition layout
[   0.4029 ] tegraparser --pt flash.xml.tmp
[   0.4057 ] 
[   0.4058 ] Creating list of images to be signed
[   0.4178 ] tegrahost --chip 0x21 0 --partitionlayout flash.xml.bin --list images_list.xml
[   0.4312 ] 
[   0.4312 ] Generating signatures
[   0.4330 ] tegrasign --key /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/emi_pkc.pem --list images_list.xml --pubkeyhash pub_key.key
[   0.4350 ] PKC key in Open SSL format
[   0.4355 ] Key size is 256 bytes
[   0.4358 ] Saving public key  in pub_key.key
[   1.7701 ] Saving public key Hash as binary: pub_key.hash
[   1.7701 ] Saving public key Hash as big-endian text: pub_key.hash_txt
[   1.7701 ] Saving public key Hash as little-endian(sysfs) text: pub_key.hash_sysfs_txt
[   1.7701 ] 
[   1.7701 ] Generating br-bct
[   1.7952 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg --chip 0x21 0
[   1.7970 ] Copying Sdram info from 0 to 1 set
[   1.8012 ] Copying Sdram info from 1 to 2 set
[   1.8012 ] Copying Sdram info from 2 to 3 set
[   1.8012 ] 
[   1.8012 ] Updating boot device parameters
[   1.8031 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatedevparam flash.xml.bin
[   1.8045 ] Warning: No sdram params
[   1.8047 ] 
[   1.8047 ] Updating bl info
[   1.8065 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updateblinfo flash.xml.bin --updatesig images_list_signed.xml
[   1.8094 ] 
[   1.8095 ] Updating secondary storage information into bct
[   1.8110 ] tegraparser --pt flash.xml.bin --chip 0x21 0 --updatecustinfo P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct
[   1.8130 ] 
[   1.8130 ] Updating Odmdata
[   1.8147 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatefields Odmdata =0x94000
[   1.8164 ] Warning: No sdram params
[   1.8167 ] 
[   1.8167 ] Get Signed section of bct
[   1.8182 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --listbct bct_list.xml
[   1.8201 ] 
[   1.8201 ] Signing BCT
[   1.8235 ] tegrasign --key /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/emi_pkc.pem --list bct_list.xml --pubkeyhash pub_key.key
[   1.8250 ] PKC key in Open SSL format
[   1.8253 ] Key size is 256 bytes
[   1.8255 ] Saving public key  in pub_key.key
[   1.9354 ] Saving public key Hash as binary: pub_key.hash
[   1.9354 ] Saving public key Hash as big-endian text: pub_key.hash_txt
[   1.9354 ] Saving public key Hash as little-endian(sysfs) text: pub_key.hash_sysfs_txt
[   1.9355 ] 
[   1.9355 ] Updating BCT with signature
[   1.9374 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatesig bct_list_signed.xml --pubkeyhash pub_key.key
[   1.9396 ] 
[   1.9397 ] Copying signatures
[   1.9413 ] tegrahost --chip 0x21 0 --partitionlayout flash.xml.bin --updatesig images_list_signed.xml --pubkeyhash pub_key.key
[   1.9535 ] 
[   1.9536 ] Updating BFS information on BCT
[   1.9550 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatebfsinfo flash.xml.bin --pubkeyhash pub_key.key
[   1.9563 ]    BFS:
[   1.9578 ]      0: [PT ] flash.xml.bin (size=4319/131072)
[   1.9585 ]      1: [TBC] nvtboot_cpu.bin.signed (size=65760/196608)
[   1.9592 ]      2: [RP1] tegra210-p3448-0000-p3449-0000-a00.dtb.signed (size=215392/1048576)
[   1.9603 ]      3: [EBT] cboot.bin.signed (size=484304/655360)
[   1.9610 ]      4: [WB0] warmboot.bin.signed (size=3952/131072)
[   1.9617 ]      5: [BPF] sc7entry-firmware.bin.signed (size=3376/262144)
[   1.9625 ] BFS0: 131072 @ 2560 SUM 080edbe7 over 2883584 bytes
[   1.9632 ]    BFS:
[   1.9633 ]      0: [PT-1] flash.xml.bin (size=4319/131072)
[   1.9639 ]      1: [TBC-1] nvtboot_cpu.bin.signed (size=65760/196608)
[   1.9647 ]      2: [RP1-1] tegra210-p3448-0000-p3449-0000-a00.dtb.signed (size=215392/1048576)
[   1.9657 ]      3: [EBT-1] cboot.bin.signed (size=484304/655360)
[   1.9665 ]      4: [WB0-1] warmboot.bin.signed (size=3952/131072)
[   1.9672 ]      5: [BPF-1] sc7entry-firmware.bin.signed (size=3376/262144)
[   1.9680 ] BFS1: 131072 @ 8704 SUM 080edbe7 over 2883584 bytes
[   1.9687 ]    KFS:
[   2.0028 ]      0: [DTB] tegra210-p3448-0000-p3449-0000-a00.dtb.signed (size=215392/1048576)
[   2.0038 ]      1: [TOS] tos-mon-only.img.signed (size=54448/6291456)
[   2.0046 ]      2: [EKS] eks.img (size=1028/81920)
[   2.0051 ]      3: [LNX] boot.img.signed (size=483328/67092480)
[   2.0058 ] KFS0: 1048576 @ 29376546 SUM e6e0a216 over 7905280 bytes
[   2.0089 ]    KFS:
[   2.0464 ]      0: [DTB-1] tegra210-p3448-0000-p3449-0000-a00.dtb.signed (size=215392/1048576)
[   2.0475 ]      1: [TOS-1] tos-mon-only.img.signed (size=54448/6291456)
[   2.0483 ]      2: [EKS-1] eks.img (size=1028/81920)
[   2.0490 ]      3: [LNX-1] boot.img.signed (size=483328/67092480)
[   2.0502 ] KFS1: 1048576 @ 29522082 SUM e6e0a216 over 7905280 bytes
[   2.0524 ] 
[   2.0525 ] Copying signed file in /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/signed
./tegraflash.py --bl cboot.bin.signed --bct  P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --odmdata 0x94000 --bldtb tegra210-p3448-0000-p3449-0000-a00.dtb.signed --applet rcm_1_signed.rcm --cmd "secureflash;reboot"  --cfg flash.xml --chip 0x21    --bins "EBT cboot.bin; DTB tegra210-p3448-0000-p3449-0000-a00.dtb"  --key "/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/emi_pkc.pem" 
saving flash command in /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/flashcmd.txt
saving Windows flash command to /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/flash_win.bat
*** no-flash flag enabled. Exiting now... *** 
+-------------------------------------------------------------------------------
| Step 2: Extract Signed Binaries
+-------------------------------------------------------------------------------
copying cboot.bin.signed ... succeeded.
copying P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct ... succeeded.
copying tegra210-p3448-0000-p3449-0000-a00.dtb.signed ... succeeded.
copying rcm_1_signed.rcm ... succeeded.
copying flash.xml ... succeeded.
copying flash.xml.bin ... succeeded.
Error: </partition> does not exist.

Also, whenever I execute the nvmassflashgen.sh, it fails for the first time as follow. But it succeded at the next excution (without plugging off).

$ sudo ./nvmassflashgen.sh -x 0x21 -y PKC -u ../emi_pkc.pem -r jetson-nano-emmc mmcblk0p1
================================================================================
|| Generate Massflash Image in the master host:                               ||
|| Requires the Jetson connected in RCM mode.                                 ||
================================================================================
1 Jetson devices in RCM mode. USB: 3-9
+-------------------------------------------------------------------------------
| Step 1: Generate Command File
+-------------------------------------------------------------------------------
###############################################################################
# L4T BSP Information:
# R32 , REVISION: 3.1
###############################################################################
./tegraflash.py --chip 0x21 --applet "/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/nvtboot_recovery.bin" --skipuid --cmd "dump eeprom boardinfo cvm.bin" --key "/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/emi_pkc.pem" 
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
 
[   0.0036 ] Generating RCM messages
[   0.0053 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 0 --download rcm /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/nvtboot_recovery.bin 0 0
[   0.0070 ] RCM 0 is saved as rcm_0.rcm
[   0.0080 ] RCM 1 is saved as rcm_1.rcm
[   0.0080 ] List of rcm files are saved in rcm_list.xml
[   0.0080 ] 
[   0.0081 ] Signing RCM messages
[   0.0097 ] tegrasign --key /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/emi_pkc.pem --list rcm_list.xml --pubkeyhash pub_key.key
[   0.0114 ] PKC key in Open SSL format
[   0.0119 ] Key size is 256 bytes
[   0.0122 ] Saving public key  in pub_key.key
[   0.2238 ] Saving public key Hash as binary: pub_key.hash
[   0.2238 ] Saving public key Hash as big-endian text: pub_key.hash_txt
[   0.2238 ] Saving public key Hash as little-endian(sysfs) text: pub_key.hash_sysfs_txt
[   0.2238 ] 
[   0.2239 ] Copying signature to RCM mesages
[   0.2259 ] tegrarcm --chip 0x21 0 --updatesig rcm_list_signed.xml --pubkeyhash pub_key.key
[   0.2286 ] 
[   0.2287 ] Boot Rom communication
[   0.2306 ] tegrarcm --chip 0x21 0 --rcm rcm_list_signed.xml --skipuid
[   0.2325 ] RCM version 0X4
[   0.5980 ] Boot Rom communication failed
[   0.5981 ] 
Error: Return value 3
Command tegrarcm --chip 0x21 0 --rcm rcm_list_signed.xml --skipuid
Reading board information failed.
*** ERROR: flashcmd.txt generation failed.

Hi,
For the error

Error: Return value 3
Command tegrarcm --chip 0x21 0 --rcm rcm_list_signed.xml --skipuid
Reading board information failed.

Please add
BOARDID=3448 FAB=200 BOARDSKU=0002
in the command line.

Also have you tried the command without -r? Don’t see the option listed in README_Massflash.txt

Oh, I see. I need those parameters again.

I have tried and found the command finished successfully.

$ sudo ./nvmassflashgen.sh BOARDID=3448 FAB=200 BOARDSKU=0002 -x 0x21 -y PKC -u ../emi_pkc.pem -r jetson-nano-emmc mmcblk0p1
================================================================================
|| Generate Massflash Image in the master host:                               ||
|| Requires the Jetson connected in RCM mode.                                 ||
================================================================================
1 Jetson devices in RCM mode. USB: 3-9
+-------------------------------------------------------------------------------
| Step 1: Generate Command File
+-------------------------------------------------------------------------------
###############################################################################
# L4T BSP Information:
# R32 , REVISION: 3.1
###############################################################################
Board ID() version() 
copying bctfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/BCT/P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg)... done.
copying bootloader(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
copying initrd(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/l4t_initrd.img)... done.
	populating kernel to rootfs... done.
	populating initrd to rootfs... done.
	populating /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a00.dtb to rootfs... done.
Making Boot image... done.
Existing sosfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/nvtboot_recovery.bin) reused.
copying tegraboot(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/nvtboot.bin)... done.
copying cpu_bootloader(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
copying bpffile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/sc7entry-firmware.bin)... done.
Existing badpagefile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/badpage.bin) reused.
copying wb0boot(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/warmboot.bin)... done.
Existing tosfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/tos-mon-only.img) reused.
Existing eksfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/eks.img) reused.
copying dtbfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a00.dtb)... done.
Copying nv_boot_control.conf to rootfs
Making system.img... 
	populating rootfs from /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/rootfs ... done.
	Sync'ing system.img ... done.
	Converting RAW image to Sparse image... 

---- Raw to Sparse Image Converter v1.0 ----------------------------
  0: RAW:     6291456(      6 blks) ==>          28:6291468
  1: SKP:    31457280(     30 blks) ==>     6291496:12
  2: RAW:     2097152(      2 blks) ==>     6291508:2097164
  3: SKP:    94371840(     90 blks) ==>     8388672:12
  4: RAW:     1048576(      1 blks) ==>     8388684:1048588
  5: SKP:     3145728(      3 blks) ==>     9437272:12
  6: RAW:    44040192(     42 blks) ==>     9437284:44040204
  7: SKP:     1048576(      1 blks) ==>    53477488:12
  8: RAW:   220200960(    210 blks) ==>    53477500:220200972
  9: SKP:     3145728(      3 blks) ==>   273678472:12
 10: RAW:    80740352(     77 blks) ==>   273678484:80740364
 11: SKP:    15728640(     15 blks) ==>   354418848:12
 12: RAW:   168820736(    161 blks) ==>   354418860:168820748
 13: SKP:     3145728(      3 blks) ==>   523239608:12
 14: RAW:   265289728(    253 blks) ==>   523239620:265289740
 15: SKP:     3145728(      3 blks) ==>   788529360:12
 16: RAW:   265289728(    253 blks) ==>   788529372:265289740
 17: SKP:     3145728(      3 blks) ==>  1053819112:12
 18: RAW:   842006528(    803 blks) ==>  1053819124:842006540
 19: SKP:     1048576(      1 blks) ==>  1895825664:12
 20: RAW:    95420416(     91 blks) ==>  1895825676:95420428
 21: SKP:    30408704(     29 blks) ==>  1991246104:12
 22: RAW:    32505856(     31 blks) ==>  1991246116:32505868
 23: SKP:    34603008(     33 blks) ==>  2023751984:12
 24: RAW:    17825792(     17 blks) ==>  2023751996:17825804
 25: SKP:    15728640(     15 blks) ==>  2041577800:12
 26: RAW:  1074790400(   1025 blks) ==>  2041577812:1074790412
 27: SKP:     3145728(      3 blks) ==>  3116368224:12
 28: RAW:   265289728(    253 blks) ==>  3116368236:265289740
 29: SKP:     3145728(      3 blks) ==>  3381657976:12
 30: RAW:    67108864(     64 blks) ==>  3381657988:67108876
 31: SKP:     4194304(      4 blks) ==>  3448766864:12
 32: RAW:   105906176(    101 blks) ==>  3448766876:105906188
 33: SKP:     3145728(      3 blks) ==>  3554673064:12
 34: RAW:    36700160(     35 blks) ==>  3554673076:36700172
 35: SKP:     1048576(      1 blks) ==>  3591373248:12
 36: RAW:    35651584(     34 blks) ==>  3591373260:35651596
 37: SKP:     2097152(      2 blks) ==>  3627024856:12
 38: RAW:    15728640(     15 blks) ==>  3627024868:15728652
 39: SKP:     1048576(      1 blks) ==>  3642753520:12
 40: RAW:    32505856(     31 blks) ==>  3642753532:32505868
 41: SKP:     1048576(      1 blks) ==>  3675259400:12
 42: RAW:    33554432(     32 blks) ==>  3675259412:33554444
 43: SKP:     1048576(      1 blks) ==>  3708813856:12
 44: RAW:    27262976(     26 blks) ==>  3708813868:27262988
 45: SKP:     5242880(      5 blks) ==>  3736076856:12
 46: RAW:   119537664(    114 blks) ==>  3736076868:119537676
 47: SKP:     6291456(      6 blks) ==>  3855614544:12
 48: RAW:    54525952(     52 blks) ==>  3855614556:54525964
 49: SKP:     4194304(      4 blks) ==>  3910140520:12
 50: RAW:    40894464(     39 blks) ==>  3910140532:40894476
 51: SKP:     1048576(      1 blks) ==>  3951035008:12
 52: RAW:    24117248(     23 blks) ==>  3951035020:24117260
 53: SKP:     1048576(      1 blks) ==>  3975152280:12
 54: RAW:    49283072(     47 blks) ==>  3975152292:49283084
 55: SKP:    26214400(     25 blks) ==>  4024435376:12
 56: RAW:    16777216(     16 blks) ==>  4024435388:16777228
 57: SKP:    83886080(     80 blks) ==>  4041212616:12
 58: RAW:  1222639616(   1166 blks) ==>  4041212628:1222639628
 59: SKP:     1048576(      1 blks) ==>  5263852256:12
 60: RAW:    65011712(     62 blks) ==>  5263852268:65011724
 61: SKP:     3145728(      3 blks) ==>  5328863992:12
 62: RAW:   668991488(    638 blks) ==>  5328864004:668991500
 63: SKP:     2097152(      2 blks) ==>  5997855504:12
 64: RAW:    61865984(     59 blks) ==>  5997855516:61865996
 65: SKP:    22020096(     21 blks) ==>  6059721512:12
 66: RAW:    28311552(     27 blks) ==>  6059721524:28311564
 67: SKP:    72351744(     69 blks) ==>  6088033088:12
 68: RAW:     1048576(      1 blks) ==>  6088033100:1048588
 69: SKP:     3145728(      3 blks) ==>  6089081688:12
 70: RAW:    74448896(     71 blks) ==>  6089081700:74448908
 71: SKP:     5242880(      5 blks) ==>  6163530608:12
 72: RAW:  1157627904(   1104 blks) ==>  6163530620:1157627916
 73: SKP:    33554432(     32 blks) ==>  7321158536:12
 74: RAW:    11534336(     11 blks) ==>  7321158548:11534348
 75: SKP:     5242880(      5 blks) ==>  7332692896:12
 76: RAW:   200278016(    191 blks) ==>  7332692908:200278028
 77: SKP:     1048576(      1 blks) ==>  7532970936:12
 78: RAW:    57671680(     55 blks) ==>  7532970948:57671692
 79: SKP:     1048576(      1 blks) ==>  7590642640:12
 80: RAW:    36700160(     35 blks) ==>  7590642652:36700172
 81: SKP:     5242880(      5 blks) ==>  7627342824:12
 82: RAW:    57671680(     55 blks) ==>  7627342836:57671692
 83: SKP:     1048576(      1 blks) ==>  7685014528:12
 84: RAW:   128974848(    123 blks) ==>  7685014540:128974860
 85: SKP:     5242880(      5 blks) ==>  7813989400:12
 86: RAW:   183500800(    175 blks) ==>  7813989412:183500812
 87: SKP:     1048576(      1 blks) ==>  7997490224:12
 88: RAW:    49283072(     47 blks) ==>  7997490236:49283084
 89: SKP:    26214400(     25 blks) ==>  8046773320:12
 90: RAW:    14680064(     14 blks) ==>  8046773332:14680076
 91: SKP:    85983232(     82 blks) ==>  8061453408:12
 92: RAW:   417333248(    398 blks) ==>  8061453420:417333260
 93: SKP:     2097152(      2 blks) ==>  8478786680:12
 94: RAW:    88080384(     84 blks) ==>  8478786692:88080396
 95: SKP:     4194304(      4 blks) ==>  8566867088:12
 96: RAW:    96468992(     92 blks) ==>  8566867100:96469004
 97: SKP:     4194304(      4 blks) ==>  8663336104:12
 98: RAW:    23068672(     22 blks) ==>  8663336116:23068684
 99: SKP:     2097152(      2 blks) ==>  8686404800:12
100: RAW:   108003328(    103 blks) ==>  8686404812:108003340
101: SKP:     1048576(      1 blks) ==>  8794408152:12
102: RAW:    74448896(     71 blks) ==>  8794408164:74448908
103: SKP:     1048576(      1 blks) ==>  8868857072:12
104: RAW:   255852544(    244 blks) ==>  8868857084:255852556
105: SKP:     4194304(      4 blks) ==>  9124709640:12
106: RAW:    99614720(     95 blks) ==>  9124709652:99614732
107: SKP:     1048576(      1 blks) ==>  9224324384:12
108: RAW:    40894464(     39 blks) ==>  9224324396:40894476
109: SKP:     1048576(      1 blks) ==>  9265218872:12
110: RAW:   103809024(     99 blks) ==>  9265218884:103809036
111: SKP:     5242880(      5 blks) ==>  9369027920:12
112: RAW:    22020096(     21 blks) ==>  9369027932:22020108
113: SKP:     3145728(      3 blks) ==>  9391048040:12
114: RAW:    89128960(     85 blks) ==>  9391048052:89128972
115: SKP:   565182464(    539 blks) ==>  9480177024:12
116: RAW:     9437184(      9 blks) ==>  9480177036:9437196
117: SKP:    24117248(     23 blks) ==>  9489614232:12
118: RAW:    18874368(     18 blks) ==>  9489614244:18874380
119: SKP:    81788928(     78 blks) ==>  9508488624:12
120: RAW:     1048576(      1 blks) ==>  9508488636:1048588
121: SKP:     3145728(      3 blks) ==>  9509537224:12
122: RAW:   339738624(    324 blks) ==>  9509537236:339738636
123: SKP:     1048576(      1 blks) ==>  9849275872:12
124: RAW:   546308096(    521 blks) ==>  9849275884:546308108
125: SKP:  1121976320(   1070 blks) ==> 10395583992:12
126: RAW:    11534336(     11 blks) ==> 10395584004:11534348
127: SKP:     1048576(      1 blks) ==> 10407118352:12
128: RAW:     1048576(      1 blks) ==> 10407118364:1048588
129: SKP:    19922944(     19 blks) ==> 10408166952:12
130: RAW:    23068672(     22 blks) ==> 10408166964:23068684
131: SKP:    77594624(     74 blks) ==> 10431235648:12
132: RAW:  1331691520(   1270 blks) ==> 10431235660:1331691532
133: SKP:    10485760(     10 blks) ==> 11762927192:12
134: RAW:     7340032(      7 blks) ==> 11762927204:7340044
135: SKP:   663748608(    633 blks) ==> 11770267248:12
-- Total: ---------------------------------------------------
136 CHUNK 15032385536(  14336 blks) ==> 11770267260(11225 blks)

done.
system.img built successfully. 
Existing tbcfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/nvtboot_cpu.bin) reused.
copying tbcdtbfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a00.dtb)... done.
copying cfgfile(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/cfg/flash_l4t_t210_emmc_p3448.xml) to flash.xml... done.
copying flasher(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
Existing flashapp(/home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/tegraflash.py) reused.
./tegraflash.py --bl cboot.bin --bct  P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg --odmdata 0x94000 --bldtb tegra210-p3448-0000-p3449-0000-a00.dtb --applet nvtboot_recovery.bin --cmd "flash; reboot"  --cfg flash.xml --chip 0x21    --bins "EBT cboot.bin; DTB tegra210-p3448-0000-p3449-0000-a00.dtb" 
saving flash command in /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/flashcmd.txt
saving Windows flash command to /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/flash_win.bat
*** no-flash flag enabled. Exiting now... *** 
+-------------------------------------------------------------------------------
| Step 2: Sign Binaries
+-------------------------------------------------------------------------------
./tegraflash.py --bl cboot.bin --bct  P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg --odmdata 0x94000 --bldtb tegra210-p3448-0000-p3449-0000-a00.dtb --applet nvtboot_recovery.bin --cmd " sign"  --cfg flash.xml --chip 0x21    --bins "EBT cboot.bin; DTB tegra210-p3448-0000-p3449-0000-a00.dtb"  --keep --skipuid
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
 
[   0.4082 ] tegrasign --key None --getmode mode.txt
[   0.4099 ] Assuming zero filled SBK key
[   0.4101 ] 
[   0.4684 ] Generating RCM messages
[   0.4703 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 0 --download rcm nvtboot_recovery.bin 0 0
[   0.4723 ] RCM 0 is saved as rcm_0.rcm
[   0.4732 ] RCM 1 is saved as rcm_1.rcm
[   0.4735 ] List of rcm files are saved in rcm_list.xml
[   0.4735 ] 
[   0.4736 ] Signing RCM messages
[   0.4755 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.key
[   0.4774 ] Assuming zero filled SBK key
[   0.4881 ] 
[   0.4881 ] Copying signature to RCM mesages
[   0.4901 ] tegrarcm --chip 0x21 0 --updatesig rcm_list_signed.xml
[   0.5374 ] 
[   0.5374 ] Parsing partition layout
[   0.7585 ] tegraparser --pt flash.xml.tmp
[   1.0729 ] 
[   1.0730 ] Creating list of images to be signed
[   1.2839 ] tegrahost --chip 0x21 0 --partitionlayout flash.xml.bin --list images_list.xml
[   2.0567 ] 
[   2.0567 ] Generating signatures
[   2.0587 ] tegrasign --key None --list images_list.xml --pubkeyhash pub_key.key
[   2.0606 ] Assuming zero filled SBK key
[   2.7748 ] 
[   2.7748 ] Generating br-bct
[   3.2368 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg --chip 0x21 0
[   3.2387 ] Copying Sdram info from 0 to 1 set
[   3.4316 ] Copying Sdram info from 1 to 2 set
[   3.4316 ] Copying Sdram info from 2 to 3 set
[   3.4316 ] 
[   3.4316 ] Updating boot device parameters
[   3.4332 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatedevparam flash.xml.bin
[   3.4352 ] Warning: No sdram params
[   3.5134 ] 
[   3.5134 ] Updating bl info
[   3.5153 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updateblinfo flash.xml.bin --updatesig images_list_signed.xml
[   3.6186 ] 
[   3.6187 ] Updating secondary storage information into bct
[   3.6206 ] tegraparser --pt flash.xml.bin --chip 0x21 0 --updatecustinfo P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct
[   3.7097 ] 
[   3.7098 ] Updating Odmdata
[   3.7117 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatefields Odmdata =0x94000
[   3.7136 ] Warning: No sdram params
[   3.8167 ] 
[   3.8168 ] Get Signed section of bct
[   3.8187 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --listbct bct_list.xml
[   3.8208 ] 
[   3.8208 ] Signing BCT
[   3.8247 ] tegrasign --key None --list bct_list.xml --pubkeyhash pub_key.key
[   3.8266 ] Assuming zero filled SBK key
[   3.8276 ] 
[   3.8277 ] Updating BCT with signature
[   3.8296 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatesig bct_list_signed.xml
[   4.0075 ] 
[   4.0076 ] Copying signatures
[   4.0096 ] tegrahost --chip 0x21 0 --partitionlayout flash.xml.bin --updatesig images_list_signed.xml
[   4.4488 ] 
[   4.4489 ] Updating BFS information on BCT
[   4.4509 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatebfsinfo flash.xml.bin
[   4.4528 ]    BFS:
[   4.4560 ]      0: [PT ] flash.xml.bin (size=4337/131072)
[   4.4566 ]      1: [TBC] nvtboot_cpu.bin.encrypt (size=65760/196608)
[   4.4572 ]      2: [RP1] tegra210-p3448-0000-p3449-0000-a00.dtb.encrypt (size=215392/1048576)
[   4.4582 ]      3: [EBT] cboot.bin.encrypt (size=484304/655360)
[   4.4588 ]      4: [WB0] warmboot.bin.encrypt (size=3952/131072)
[   4.4594 ]      5: [BPF] sc7entry-firmware.bin.encrypt (size=3376/262144)
[   4.4602 ] BFS0: 131072 @ 2560 SUM 49803955 over 2883584 bytes
[   4.4608 ]    BFS:
[   4.4614 ]      0: [PT-1] flash.xml.bin (size=4337/131072)
[   4.4617 ]      1: [TBC-1] nvtboot_cpu.bin.encrypt (size=65760/196608)
[   4.4620 ]      2: [RP1-1] tegra210-p3448-0000-p3449-0000-a00.dtb.encrypt (size=215392/1048576)
[   4.4625 ]      3: [EBT-1] cboot.bin.encrypt (size=484304/655360)
[   4.4628 ]      4: [WB0-1] warmboot.bin.encrypt (size=3952/131072)
[   4.4631 ]      5: [BPF-1] sc7entry-firmware.bin.encrypt (size=3376/262144)
[   4.4635 ] BFS1: 131072 @ 8704 SUM 49803955 over 2883584 bytes
[   4.4638 ]    KFS:
[   4.5074 ]      0: [DTB] tegra210-p3448-0000-p3449-0000-a00.dtb.encrypt (size=215392/1048576)
[   4.5084 ]      1: [TOS] tos-mon-only.img.encrypt (size=54208/6291456)
[   4.5091 ]      2: [EKS] eks.img (size=1028/81920)
[   4.5095 ]      3: [LNX] boot.img.encrypt (size=483328/67092480)
[   4.5101 ] KFS0: 1048576 @ 29376546 SUM 23c068dd over 7905280 bytes
[   4.5125 ]    KFS:
[   4.5512 ]      0: [DTB-1] tegra210-p3448-0000-p3449-0000-a00.dtb.encrypt (size=215392/1048576)
[   4.5522 ]      1: [TOS-1] tos-mon-only.img.encrypt (size=54208/6291456)
[   4.5529 ]      2: [EKS-1] eks.img (size=1028/81920)
[   4.5534 ]      3: [LNX-1] boot.img.encrypt (size=483328/67092480)
[   4.5540 ] KFS1: 1048576 @ 29522082 SUM 23c068dd over 7905280 bytes
[   4.5977 ] 
[   4.5978 ] Copying signed file in /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/signed
Keep temporary directory /home/tsato/Desktop/l4timages/Nano/L4T32.3.1/Linux_for_Tegra/bootloader/4819
+-------------------------------------------------------------------------------
| Step 3: Generate Mass-flash scripts
+-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
| Step 4: Generate Mass-flash image tarball
+-------------------------------------------------------------------------------
copying nvmflash.sh ... succeeded.
copying nvaflash.sh ... succeeded.
copying emmc_bootblob_ver.txt ... succeeded.
mfi_jetson-nano-emmc/
mfi_jetson-nano-emmc/mkbctpart
mfi_jetson-nano-emmc/tos-mon-only.img
mfi_jetson-nano-emmc/P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct.encrypt
mfi_jetson-nano-emmc/boot.img.signed
mfi_jetson-nano-emmc/images_list.xml
mfi_jetson-nano-emmc/flash.xml.bin
mfi_jetson-nano-emmc/nvtboot.bin.signed
mfi_jetson-nano-emmc/sc7entry-firmware.bin
mfi_jetson-nano-emmc/P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct
mfi_jetson-nano-emmc/nvtboot_recovery.bin
mfi_jetson-nano-emmc/tegra210-p3448-0000-p3449-0000-a00.dtb
mfi_jetson-nano-emmc/cboot.bin.encrypt
mfi_jetson-nano-emmc/tos-mon-only.img.signed
mfi_jetson-nano-emmc/rcm_1.rcm
mfi_jetson-nano-emmc/LICENSE.mkgpt
mfi_jetson-nano-emmc/tegrarcm
mfi_jetson-nano-emmc/cvm.bin
mfi_jetson-nano-emmc/cboot.bin
mfi_jetson-nano-emmc/tos.img
mfi_jetson-nano-emmc/mkgpt
mfi_jetson-nano-emmc/mkbootimg
mfi_jetson-nano-emmc/P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg
mfi_jetson-nano-emmc/nvtboot.bin.encrypt
mfi_jetson-nano-emmc/boot.img
mfi_jetson-nano-emmc/tegrabct
mfi_jetson-nano-emmc/rcm_1_signed.rcm
mfi_jetson-nano-emmc/rp4.blob
mfi_jetson-nano-emmc/rcm_list_signed.xml
mfi_jetson-nano-emmc/l4t_initrd.img
mfi_jetson-nano-emmc/odmfuse_pkc.xml
mfi_jetson-nano-emmc/eks.img
mfi_jetson-nano-emmc/warmboot.bin.signed
mfi_jetson-nano-emmc/nvaflash.sh
mfi_jetson-nano-emmc/warmboot.bin
mfi_jetson-nano-emmc/cboot.bin.signed
mfi_jetson-nano-emmc/tegrahost
mfi_jetson-nano-emmc/warmboot.bin.encrypt
mfi_jetson-nano-emmc/tegra210-p3448-0000-p3449-0000-a00.dtb.encrypt
mfi_jetson-nano-emmc/rcm_list.xml
mfi_jetson-nano-emmc/tegraflash_internal.py
mfi_jetson-nano-emmc/NVIDIA_Trademark_License_Addendum_SW.pdf
mfi_jetson-nano-emmc/chkbdinfo
mfi_jetson-nano-emmc/tegraparser
mfi_jetson-nano-emmc/nvidia-l4t-bootloader_32.3.1-20191209225816_arm64.deb
mfi_jetson-nano-emmc/tegradevflash
mfi_jetson-nano-emmc/tegraflash.py
mfi_jetson-nano-emmc/LICENSE.tos-mon-only.img.arm-trusted-firmware
mfi_jetson-nano-emmc/LICENSE.mkbootimg
mfi_jetson-nano-emmc/nvmflash.sh
mfi_jetson-nano-emmc/nvtboot_cpu.bin.encrypt
mfi_jetson-nano-emmc/bmp.blob
mfi_jetson-nano-emmc/mksparse
mfi_jetson-nano-emmc/nv_boot_control.conf
mfi_jetson-nano-emmc/badpage.bin
mfi_jetson-nano-emmc/nvtboot_cpu.bin.signed
mfi_jetson-nano-emmc/sc7entry-firmware.bin.signed
mfi_jetson-nano-emmc/LICENSE.mkbctpart
mfi_jetson-nano-emmc/tegra210-p3448-0000-p3449-0000-a00.dtb.signed
mfi_jetson-nano-emmc/sc7entry-firmware.bin.encrypt
mfi_jetson-nano-emmc/extlinux.conf
mfi_jetson-nano-emmc/tegrasign
mfi_jetson-nano-emmc/rcm_0_signed.rcm
mfi_jetson-nano-emmc/LICENSE.mksparse
mfi_jetson-nano-emmc/system.img
mfi_jetson-nano-emmc/bct_list_signed.xml
mfi_jetson-nano-emmc/LICENSE.chkbdinfo
mfi_jetson-nano-emmc/bct_list.xml
mfi_jetson-nano-emmc/nvtboot_cpu.bin
mfi_jetson-nano-emmc/tegra210-p3448-0002-p3449-0000-b00.dtb
mfi_jetson-nano-emmc/flash_win.bat
mfi_jetson-nano-emmc/nvtboot.bin
mfi_jetson-nano-emmc/emmc_bootblob_ver.txt
mfi_jetson-nano-emmc/rcm_0.rcm
mfi_jetson-nano-emmc/LICENSE.u-boot
mfi_jetson-nano-emmc/rcm_0_encrypt.rcm
mfi_jetson-nano-emmc/rcm_1_encrypt.rcm
mfi_jetson-nano-emmc/tegraflash_internal.pyc
mfi_jetson-nano-emmc/flash.xml
mfi_jetson-nano-emmc/nvtboot_recovery_cpu.bin
mfi_jetson-nano-emmc/boot.img.encrypt
mfi_jetson-nano-emmc/images_list_signed.xml
mfi_jetson-nano-emmc/tos-mon-only.img.encrypt
mfi_jetson-nano-emmc/initrd
mfi_jetson-nano-emmc/BUP_generator.py
mfi_jetson-nano-emmc/LICENSE
********************************************************************************
*** Mass Flashing tarball mfi_jetson-nano-emmc.tbz2 is ready.
********************************************************************************
    1. Download mfi_jetson-nano-emmc.tbz2 to each flashing hosts.
    2. Untar mfi_jetson-nano-emmc.tbz2. ( tar xvjf mfi_jetson-nano-emmc.tbz2 )
    3. cd mfi_jetson-nano-emmc
    4. Connect Jetson boards(jetson-nano-emmc only) and put them in RCM mode.
    5. ./nvmflash.sh


Then, we can flash this image in batches.

But again, system.img was rebuilt, and with which our own pre-built one was replaced.

So, how are we supposed to flash our own image? Is there any way to achieve this without -r option? Perhaps, extract the mfi tarball file, replace the system.img with our own image, and compress again?

Hi,
Please find the line in nvmassflashgen.sh

BOARDID=${BOARDID} BOARDSKU=${BOARDSKU} FAB=${FAB} FUSELEVEL=${FUSELEVEL} ${curdir}/flash.sh --no-flash $@

And add -r

Thanks, it did work!