How to migrate a complete system and configuration to a bare TX2

Hi,
I have reflesh my TX2 and configure the development environment (such as caffe、qt、opencv、cuda etc.),how can I migrate the complete configuration to a bare TX2.
There are at least 100 TX2 moudles will leave our factory,so it is impossible for me to cofigure one by one…

Hi chay1991, please see this page on Cloning TX2:

https://elinux.org/Jetson/TX2_Cloning

Something to keep in mind while cloning: The clone is only the rootfs. Thus the driver package used for flashing the clone onto the next Jetson must be the same release version (one rootfs won’t necessarily work correctly on a different release). Bare modules do not have any of the other partitions when they arrive, and the version of a dev kit module will be earlier than whatever L4T version is the current release…flashing with “reusing” the rootfs (system.img reused if “-r” option) still adds the other partitions so you are ok to do this, but expect non-rootfs partitions to be flashed to the version of the driver package regardless of whether the clone you are using is a version match or not.

A clone produces both a “sparse” image, e.g., “backup.img”, and also a “raw” image, e.g., “backup.img.raw”. You can flash faster with a sparse image, but you can never examine or modify it (I throw away the sparse version). For editing or examination of a clone you want the raw image while it is loopback mounted. If your clone source has something you’ve configured to be specific to that clone, e.g., passwords or network setup, then this too would be cloned and you’d want to edit the loopback raw clone (or simply fix it on the running system after the flash from clone). If you have added custom udev rules requiring something specific, e.g., the MAC address of an ethernet device, then this would need to be edited for the system the clone is going into. As long as the clone image is renamed and placed as the “bootloader/system.img” file flash will work…it won’t care which version you use. Time and required disk space is what differs between the two.

If you want to edit the larger/slower raw file and then convert it to sparse format, then the “mksparse” utility (with fillpattern “0”) will do this.

Hi dusty_nv and linuxdev,
I have some confusion after reading these tips.
1.what is rootfs? Is this mean root file system?Thus,will my environment for all users can be use after cloing?
2.My TX2 release is Jetpack R28.1 can I follw the 3 steps to configure bare board?

sudo ./flash.sh -r -k APP -G backup.img jetson-tx2 mmcblk0p1
sudo cp backup.img.raw bootloader/system.img
sudo ./flash.sh -r -k APP jetson-tx2 mmcblk0p1
  1. How can I configure more TX2 modules,must I configure one by one?
  1. "rootfs" is the root file system. If you look at all of the eMMC content visible from "/" directory (the root of the file system), and ignore other mounted systems (real or virtual), then this is rootfs (a.k.a., "/dev/mmcblk0p1"). When you go to flash a Jetson it happens to be that the "sample rootfs" is in a subdirectory to "Linux_for_Tegra/"..."Linux_for_Tegra/rootfs/". There are other partitions with content which will not be part of what you see, e.g., there is a partition which is for the bootloader.

    When you flash a Jetson the default is to flash all partitions (see “sudo gdisk -l /dev/mmcblk0”…this will list all partitions, and not just p1). When you do not use the “-r” reuse option the content from the “Linux_for_Tegra/rootfs/” is used (along with minor edits) to create “bootloader/system.img”. When you use the “-r” reuse option it is expected that “system.img” is already there and avoids regenerating this from scratch. If it happens that the image is from a clone, then this is the same as doing nothing to rootfs since it is being flashed with a copy of itself. Other content still gets flashed, e.g., the bootloader and device tree.

    When you clone a rootfs and flash it to another device even password files and customization gets cloned and propagated. If you just have the default accounts and passwords, then this is not a problem. Customization which is not specific to your hardware will work as expected, but customization relying on some specific serial number or device ID would misbehave since the other system will have a different serial number. One example is if you modified networking to do something specific with a MAC address (the MAC address will differ on other units).

  2. So far as those commands go, they are correct. However, on R28.1's driver package (which is what provides "flash.sh") flash.sh has a bug and thus an edit is noted here: https://devtalk.nvidia.com/default/topic/1000105/jetson-tx2/tx2-cloning/post/5111893/#5111893 (this is fixed in more recent releases, but R28.1 is old)
  3. It depends on what you mean by "configure" as to the configure one-by-one question. There is a way to flash multiple Jetsons, but I think this requires a more recent release (I have only one TX2, and so I have not tried flashing multiple devices simultaneously). All modules sold as just a module are completely empty, and so far as I know, all dev kits come flashed with an L4T release earlier than R28.1...so those would need to be flashed with the R28.1 driver package in order for the R28.1 rootfs to match the other partitions.

Hi ALL,
I have succeed clone my TX2,Thanks.
I will try how to clone multi TX2 onece time.