How to pack the Jetson SDK Components(CUDA, CUDA-X AI and so on) in the system.img when flash the system?

Dear sir:
I want to pack the Jetson SDK Components(such as CUDA and so on) into the system.img when i used the flash.sh command. How to do it?

Technically, if you knew all of the apt package install commands, you could use the QEMU emulator on the host PC to add them. This is very involved and not trivial. What works better is to install the Jetson normally with JetPack/SDK Manager, tell it to install those apps, and then save a copy of the image has on the NX. That image can be used over and over as many times as you want rather than generating a new system.img each time (you’d just put your image in at “bootloader/system.img”, and then flash with the “-r” option on the command line (for eMMC models).

Note that you’d clone an eMMC model, but for an SD card model, then you could just use dd to copy the content from the host PC. If you want details, then let us know if this is an eMMC model or an SD card model. Since you are interested in this, it seems that you likely have the eMMC model.

Tks!

How to save a copy of the image has on the NX?

Keep in mind that you should know which release produced the image before you use the image. Prior to clone see what shows up with “head -n 1 /etc/nv_tegra_release”, and make sure you label your clone as being paired with that release.

Is this an eMMC model? The answer differs with this compared to SD card model. However, if it is eMMC, then it is similar to flashing, but a slightly different command produces a clone rather than flashing an image. If the rootfs is 28GB, then you’d need about 34GB of space on the host PC for a clone. That’s cutting it close though, so I recommend having at least 50GB of free space.

Then, with the NX in recovery mode and having the micro-B USB cable from NX to host, you’d run this command from the “~/nvidia/nvidia_sdk/JetPack...version.../Linux_for_Tegra/” directory:
sudo ./flash.sh -r -k APP -G my_backup.img jetson-xavier mmcblk0p1
(depending on model it might be something other than “jetson-xavier”…note the many “*.conf” files in “Linux_for_Tegra/”…targets are based on that, but without the “.conf” file name suffix)

This will produce two files:

  • my_backup.img
  • my_backup.img.raw

The “raw” image is an entire partition which can be loopback mounted, edited, so on, and then used for flash. The other is the “sparse” file, and saves space, but cannot be loopback mounted, edited, so forth…this is only for flashing. If you copy either one to the “Linux_for_Tegra/bootloader/system.img” name, and then flash with the “-r” option on command line, this will give you a full flash with that image and won’t generate a new default image. Larger images take longer to flash. Sparse images will approach the size of the raw image as the filesystem fills up, but will be much smaller if the filesystem is mostly empty.

Do note that you should not cross the clone from one release with the flash software of another release. Also, if you flash with the clone, then do a full flash, don’t just flash the APP/rootfs partition.

1 Like

hello hy_401,

please also keep in mind you should backup/restore the system.img with the same JetPack release version.
for example, there’s unexpected failure if you backup system.img from JP-4.4 and restore it to JP-4.6.

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