Jetson/TX1 Cloning

From eLinux.org
Jump to: navigation, search

Using the L4T tools, it is possible to create a carbon copy of Jetson TX1 by backing-up and restoring the eMMC partitions.

The Jetson must be connected to a remote PC over USB and entered into recovery mode.

Cloning the Image

cd into the directory containing the L4T bootloader on the remote PC. The command below will save the 15GB eMMC image to the specified file on the remote PC.

 $ sudo ./tegraflash.py --bl cboot.bin --applet nvtboot_recovery.bin --chip 0x21 --cmd "read APP my_backup_image_APP.img"
dusty@dusty-ubuntu-PC:~/workspace/JetPack-L4T-2.0/Linux_for_Tegra_tx1/bootloader$ sudo ./tegraflash.py --bl cboot.bin --applet nvtboot_recovery.bin --chip 0x21 --cmd "read APP my_backup_jetpack_231_APP.img"
[sudo] password for dusty: 
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.0025 ] Generating RCM messages
[   0.0047 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 --download rcm nvtboot_recovery.bin 0 0
[   0.0059 ] RCM 0 is saved as rcm_0.rcm
[   0.0105 ] RCM 1 is saved as rcm_1.rcm
[   0.0105 ] List of rcm files are saved in rcm_list.xml
[   0.0105 ] 
[   0.0105 ] Signing RCM messages
[   0.0149 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.hash
[   0.0164 ] Assuming zero filled SBK key
[   0.0313 ] 
[   0.0313 ] Copying signature to RCM mesages
[   0.0325 ] tegrarcm --chip 0x21 --updatesig rcm_list_signed.xml
[   0.0339 ] 
[   0.0339 ] Boot Rom communication
[   0.0348 ] tegrarcm --rcm rcm_list_signed.xml
[   0.0357 ] BootRom is not running
[   0.2092 ] 
[   0.2093 ] Retrieving storage infomation
[   0.2104 ] tegrarcm --oem platformdetails storage storage_info.bin
[   0.2113 ] Applet version 00.01.0000
[   0.3594 ] Saved platform info in storage_info.bin
[   0.3606 ] 
[   0.3606 ] Reading BCT from device for further operations
[   0.3606 ] Sending bootloader and pre-requisite binaries
[   0.3619 ] tegrarcm --download ebt cboot.bin 0 0
[   0.3630 ] Applet version 00.01.0000
[   0.5354 ] Sending ebt
[   0.5381 ] [................................................] 100%
[   0.8105 ] 
[   0.8111 ] tegrarcm --boot recovery
[   0.8117 ] Applet version 00.01.0000
[   0.9603 ] 
[   0.9603 ] Reading partition
[   0.9621 ] tegradevflash --read APP /home/dusty/workspace/JetPack-L4T-2.0/Linux_for_Tegra_tx1/bootloader/my_backup_jetpack_231_APP.img
[   0.9629 ] Cboot version 00.01.0000
[   1.6797 ] Reading partition APP in file /home/dusty/workspace/JetPack-L4T-2.0/Linux_for_Tegra_tx1/bootloader/my_backup_jetpack_231_APP.img
[   1.6807 ] [................................................] 100%
[ 3279.1986 ]

It takes nearly 1 hour to backup the image from the TX1.

Restoring the Image

Using flash.sh

The recommended way to restore multiple units with different serial numbers is to save the image as "system.img" and use the head L4T flashing script, flash.sh, with the -r option (to reuse your backed-up system.img without rebuilding the vanilla image from scratch):

 $ sudo ./flash.sh -r jetson-tx1 mmcblk0p1

Using tegraflash.py

If you are restoring to the same unit, the command below will flash the attached Jetson with the provided image file:

 $ sudo ./tegraflash.py --bl cboot.bin --applet nvtboot_recovery.bin --chip 0x21 --cmd "write APP my_backup_image_APP.img"
dusty@dusty-ubuntu-PC:~/workspace/JetPack-L4T-2.0/Linux_for_Tegra_tx1/bootloader$ sudo ./tegraflash.py --bl cboot.bin --applet nvtboot_recovery.bin --chip 0x21 --cmd "write APP my_backup_jetpack_231_APP.img"
[sudo] password for dusty: 
Sorry, try again.
[sudo] password for dusty: 
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.0027 ] Generating RCM messages
[   0.0050 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 --download rcm nvtboot_recovery.bin 0 0
[   0.0061 ] RCM 0 is saved as rcm_0.rcm
[   0.0081 ] RCM 1 is saved as rcm_1.rcm
[   0.0089 ] List of rcm files are saved in rcm_list.xml
[   0.0124 ] 
[   0.0125 ] Signing RCM messages
[   0.0146 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.hash
[   0.0157 ] Assuming zero filled SBK key
[   0.0242 ] 
[   0.0243 ] Copying signature to RCM mesages
[   0.0255 ] tegrarcm --chip 0x21 --updatesig rcm_list_signed.xml
[   0.0272 ] 
[   0.0272 ] Boot Rom communication
[   0.0283 ] tegrarcm --rcm rcm_list_signed.xml
[   0.0293 ] BR_CID: 0x32101001640ca588100000000aff8380
[   0.1769 ] RCM version 0X210001
[   0.2645 ] Boot Rom communication completed
[   1.2711 ] 
[   1.2711 ] Sending bootloader and pre-requisite binaries
[   1.2720 ] tegrarcm --download ebt cboot.bin 0 0
[   1.2727 ] Applet version 00.01.0000
[   1.4215 ] Sending ebt
[   1.4241 ] [................................................] 100%
[   1.7419 ] 
[   1.7426 ] tegrarcm --boot recovery
[   1.7432 ] Applet version 00.01.0000
[   1.8947 ] 
[   1.8948 ] Writing partition
[   1.8966 ] tegradevflash --write APP /home/dusty/workspace/JetPack-L4T-2.0/Linux_for_Tegra_tx1/bootloader/my_backup_jetpack_231_APP.img
[   1.8973 ] Cboot version 00.01.0000
[   2.6234 ] Writing partition APP with /home/dusty/workspace/JetPack-L4T-2.0/Linux_for_Tegra_tx1/bootloader/my_backup_jetpack_231_APP.img
[   2.6241 ] [................................................] 100%
[ 823.6449 ]

Flashing the image is considerably faster, it takes around 15 minutes.