How to create a distributable image of a SD card for Jetson Nano

Hi,

I have setup a development system for my Jetson and I need to port / create an image of the current setup so that I can flash it into multiple SD cards which can be used in different Jetson Nano boards. Any idea how I can achieve this? I was able to clone the setup but on reading up I saw people mentioning that it is not the ideal way to create a distributable form of the setup (one which will not cause any filesystem / port issues). Any help is much appreciated.

Thanks.

You may try cloning using the same JetPack version for getting image and flashing.
I wouldn’t further comment on that, but you may also onsider using Docker for deploying your software on various L4T releases.

Please use the tool jetson-disk-image-creator.sh from your driver package. If you don’t know what is driver package, better trying sdkmanager first.

Hello @WayneWWW ,
I tried to run the jetson-disk-image-creator.sh from ‘Linux_for_Tegra’ module using sudo privileges, but it failed at ‘making boot image’. Sharing the terminal output below for your reference. Did I miss any step?

sudo ./jetson-disk-image-creator.sh -o sd-blob.img -b jetson-nano -r 300
[sudo] password for ********:


 Jetson Disk Image Creation Tool     

jetson-disk-image-creator.sh - creating signed images
~/Linux_for_Tegra ~/Linux_for_Tegra/tools
###############################################################################

L4T BSP Information:

R32 , REVISION: 5.1

###############################################################################
/home/wipro/Linux_for_Tegra/flash.sh: line 613: ./tegrarcm: cannot execute binary file: Exec format error
Board ID(3448) version(300)
copying bctfile(/home/wipro/Linux_for_Tegra/bootloader/t210ref/BCT/P3448_A00_lpddr4_204Mhz_P987.cfg)… done.
copying bootloader(/home/wipro/Linux_for_Tegra/bootloader/t210ref/cboot.bin)… done.
copying initrd(/home/wipro/Linux_for_Tegra/bootloader/l4t_initrd.img)… done.
populating kernel to rootfs… done.
populating initrd to rootfs… done.
populating /home/wipro/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-b00.dtb to rootfs… done.
Making Boot image… failed.

Also, I’m running these on the jetson nano sd card whose image I need to create. That is okay right? I haven’t created any custom rootfs as of now.

@Honey_Patouceul , Thaks for your reply.

I didn’t understand your first point. Did you meant that I need to use the tools from the same Jetpack version to do the cloning / creating a clone of SD card which can be used in different Nanos?

On your second suggestion, we are thinking of docker too, but as we build more applications on this image we are afraid we might run into some docker dependencies or limitations. So thought we’ll try to see if we can replicate the current setup directly for now.

No, totally not ok. That driver package is for x64 ubuntu host. But not for arm64 device as jetson nano. We tell this info on the sdkmanager webstie.

@WayneWWW , So just to clarify, the only way to run that script is via host computer and through that I can create the image of the SD card?

Yes, our official sdcard image is also using this tool to create from a x64 ubuntu host.

1 Like

Ok thank you @WayneWWW . Really helpful, its clear now. Will close this and choose the solution.

Hello @WayneWWW

As you suggested, I’m trying to run do the flashing using the driver package (I can’t connect the jetson nano to host computer since i only have a micro usb to power it on. So SDK manager can’t be used). So I got the L4T driver package (folder name: Linux_for_Tegra) and upon reading ‘README_Massflash.txt’, i understood that ‘offline’ method is the way to go for me.

My doubt is 1. Is my approach correct? 2. For ‘BOARDID’ parameter in offline method for ‘nvmassflashgen.sh’ file, only ‘jetson-nano-devkit-emmc’ is mentioned. Is this applicable to the sd card version of jetson-nano also?

Edit: Some more info (providing in case if it helps). I ran the following command for my setup (jetson nano SDcard → offline mass flash method. It failed and this is the result from terminal. Can you provide some info on what I’m doing wrong? Should I build anything?

sudo BOARDID=3448 BOARDSKU=0002 FAB=200 FUSELEVEL=fuselevel_production ./nvmassflashgen.sh jetson-nano-devkit-emmc mmcblk0p1

|| Generate Massflash Image in the master host: ||
|| Requires the Jetson connected in RCM mode. ||

Generating massflash command without Jetson device connected:
BOARDID=3448 BOARDSKU=0002 FAB=200 BOARDREV= FUSELEVEL=fuselevel_production
±------------------------------------------------------------------------------
| Step 1: Generate Command File
±------------------------------------------------------------------------------
###############################################################################

L4T BSP Information:

R32 , REVISION: 5.1

###############################################################################
Board ID(3448) version(200)
copying bctfile(/home/cvlab/Documents/Linux_for_Tegra/bootloader/t210ref/BCT/P3448_A00_lpddr4_204Mhz_P987.cfg)… done.
copying bootloader(/home/cvlab/Documents/Linux_for_Tegra/bootloader/t210ref/cboot.bin)… done.
copying initrd(/home/cvlab/Documents/Linux_for_Tegra/bootloader/l4t_initrd.img)… done.
populating kernel to rootfs… done.
populating initrd to rootfs… done.
populating /home/cvlab/Documents/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0002-p3449-0000-a02.dtb to rootfs… done.
Making Boot image… done.
Existing sosfile(/home/cvlab/Documents/Linux_for_Tegra/bootloader/nvtboot_recovery.bin) reused.
copying tegraboot(/home/cvlab/Documents/Linux_for_Tegra/bootloader/t210ref/nvtboot.bin)… done.
copying cpu_bootloader(/home/cvlab/Documents/Linux_for_Tegra/bootloader/t210ref/cboot.bin)… done.
copying bpffile(/home/cvlab/Documents/Linux_for_Tegra/bootloader/t210ref/sc7entry-firmware.bin)… done.
Existing badpagefile(/home/cvlab/Documents/Linux_for_Tegra/bootloader/badpage.bin) reused.
copying wb0boot(/home/cvlab/Documents/Linux_for_Tegra/bootloader/t210ref/warmboot.bin)… done.
Existing tosfile(/home/cvlab/Documents/Linux_for_Tegra/bootloader/tos-mon-only.img) reused.
Existing eksfile(/home/cvlab/Documents/Linux_for_Tegra/bootloader/eks.img) reused.
copying dtbfile(/home/cvlab/Documents/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0002-p3449-0000-a02.dtb)… done.
Copying nv_boot_control.conf to rootfs
sed: can’t read /home/cvlab/Documents/Linux_for_Tegra/rootfs/etc/nv_boot_control.conf: Not a directory
sed: can’t read /home/cvlab/Documents/Linux_for_Tegra/rootfs/etc/nv_boot_control.conf: Not a directory
sed: can’t read /home/cvlab/Documents/Linux_for_Tegra/rootfs/etc/nv_boot_control.conf: Not a directory
sed: can’t read /home/cvlab/Documents/Linux_for_Tegra/rootfs/etc/nv_boot_control.conf: Not a directory
sed: can’t read /home/cvlab/Documents/Linux_for_Tegra/rootfs/etc/nv_boot_control.conf: Not a directory
sed: can’t read /home/cvlab/Documents/Linux_for_Tegra/rootfs/etc/nv_boot_control.conf: Not a directory
sed: can’t read /home/cvlab/Documents/Linux_for_Tegra/rootfs/etc/nv_boot_control.conf: Not a directory
sed: can’t read /home/cvlab/Documents/Linux_for_Tegra/rootfs/etc/nv_boot_control.conf: Not a directory
Making system.img…
/home/cvlab/Documents/Linux_for_Tegra/rootfs/boot/extlinux/extlinux.conf is not found, exiting…
*** ERROR: flashcmd.txt generation failed.

Did you ever prepare the root file system from download center too? it looks like you didn’t do it.

If you cannot understand how to use rootfs, check the quick start guide from download center.