Flash EMMC with image file?

I would like to flash the emmc of a production nano module with an image file created with jetson-disk-image-creator.sh. Is there a way to do this with flash.sh or otherwise?

The SD card image and eMMC images are not compatible.

On the other hand, you could experiment with it if you have time. There are a lot of partitions involved in booting, and these have a strong dependency with the hardware model and the rootfs image. If you were to use only the rootfs (label “APP”) partition, and pretend it is a clone, then the following would install that partition, but the correct “other” partition boot content (this still wouldn’t work, but I’ll expand on this later):

  1. Place a copy of the rootfs partition (e.g., via dd extraction or via loopback mount) in “Linux_for_Tegra/bootloader/system.img”.
  2. Flash such that it “reuses” the existing “system.img” via the “-r” option:
    sudo ./flash.sh -r jetson-nano-emmc mmcblk0p1

You’d probably need to add the size argument since there is no guarantee the SD card partition size is the default size. The actual partition size in bytes will be evenly divisible by 1024 either twice ("MiB") or three times ("GiB"). For example, 28GiB (basically 28 GB using 1024 instead of 1000) is “28*1024*1024*1024” bytes, or 30064771072 bytes. If your raw partition size is 30064771072, then you’d specify “-S 28GiB”:
sudo ./flash.sh -r -S 28GiB jetson-nano-emmc mmcblk0p1

One reason this will fail to boot or will have something not quite right requires explaining how the image is generated form the “rootfs/” content. The base content is purely an Ubuntu filesystem, and then “apply_binaries.sh” is used to add some custom hardware drivers on top of this. Presumably your image already has drivers, but some of them might be looking for the wrong device, not sure. Then, due to the argument passed to flash.sh, some other content is added, e.g., to “rootfs/boot/”, plus perhaps some firmware. Your SD card image will not have the right content in “rootfs/boot/”. Then the actual image is generated based on the final content of “rootfs/”, and turned into “bootloader/system.img”.

If you were to instead mount a copy of your rootfs onto “Linux_for_Tegra/rootfs/”, then your image would become that content. The old content would go away until the image is umount'd. Running a regular flash, and not using “-r”, would result in content being added to the image’s “/boot” (and perhaps other content) prior to flash. This part would then be correct, and a new “bootloader/system.img” would be generated which would be an exact match to this image other than the minor edits.

It might work then, don’t know. If it doesn’t, then you would want to run the “apply_binaries.sh” script (using sudo) against the SD card image. This won’t “just work”, but the script is for a human readable QEMU run of some commands to add “.deb” packages, and you’ll be able to see which commands failed. In some cases you will have a command fail from this because your SD card image already has the package in place. Failing to install the same package twice is a non-fatal error and is as it should be. In some other case it may be that a conflicting package is used for the SD card and this would have to be removed to allow the eMMC .deb to be installed. I don’t know for sure, I have not tried this. But if this does not work, then it’ll be close to working.

The two biggest areas of change with eMMC versus SD card will be: 1. The device tree, and 2. where the pointer points at to find configuration. Using the eMMC model flash command line should take care of having the right pointer to device, and the non-rootfs content should be correct, so anything left will likely be an issue of device tree and/or rootfs “.deb” package content.