Thus, I tried the falshing process once more as described in Workflow 10: Generate images for internal device and external device seperately then flash- Example 2: In this example, you want to boot Jetson Xavier NX SD from an attached NVMe SSD. The SD card does not need to be plugged in. You can also apply this if you don't want to use the emmc on the Jetson Xavier NX emmc.
I ran following commands to initially flash the the Jetson. First, downloading the Tegra_Linux_Sample-Root-Filesystem_R34.1.0_aarch64.tbz2 and Jetson_Linux_R34.1.0_aarch64.tbz2 package and extracting both of them:
sudo tar xpf Jetson_Linux_R34.1.0_aarch64.tbz2
cd Linux_for_Tegra/rootfs
sudo tar xpf ../../Tegra_Linux_Sample-Root-Filesystem_R34.1.0_aarch64.tbz2
Then for the first time applying the binaries in the Linux_for_Tegra folder:
sudo ./apply_binaries.sh
Next, following the Workflow 10 - Example 2. (Please note that I had to use the flash_l4t_external.xml because the one suggested in the ReadMe was not working for me. Then the Jetson did not boot up)
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --no-flash jetson-xavier-nx-devkit-qspi internal
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --no-flash \
--external-device nvme0n1p1 \
-c ./tools/kernel_flash/flash_l4t_external.xml \
--external-only --append jetson-xavier-nx-devkit external
Then I put the device into the recovery mode and flashed the image:
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --showlogs
So far, so good. Now the Jetson is booting up and I can configure the Ubuntu 20.04 system and install custom packages. Once I configured everything I took a look at the partitions with gparted and the look well set:
After that I mounted a usb key and stored the system image with the img2simg command as you suggested:
sudo img2simg /dev/nvme0n1p1 system.img.ext
The original system.img in Linux_for_Tegra/tools/kernel_flash/images/external has 5.04GB and the one I created 5.5GB. Thus everything looks good. For the test now, I flashed once more the original image and setup the Ubuntu tocheck, if the new image is really flashed.
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --no-flash \
--external-device nvme0n1p1 \
-c ./tools/kernel_flash/flash_l4t_external.xml \
--external-only --append jetson-xavier-nx-devkit external
Now I remove the original system.img in Linux_for_Tegra/tools/kernel_flash/images/external and the system.img.sha1sum file:
sudo rm system.img*
Rename system.img.ext to system.img and create a new sha1sum file:
mv system.img.ext system.img
sha1sum system.img > system.img.sha1sum
Then both files are copied to the external image folder:
sudo cp system.img* Linux_for_Tegra/tools/kernel_flash/images/external/
And now I tried flash the Jetson:
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --no-flash \
--external-device nvme0n1p1 \
-c ./tools/kernel_flash/flash_l4t_external.xml \
--external-only --append jetson-xavier-nx-devkit external
And receive an out of memory error at the end of the flashing process.
[ 210]: l4t_flash_from_kernel: Successfully flash the qspi
[ 210]: l4t_flash_from_kernel: Flashing success
error: file_write: write: No space left on device
Cannot write output file
[ 459]: l4t_flash_from_kernel: The device size indicated in the partition layout xml is smaller than the actual size. This utility will try to fix the GPT.
[ 459]: l4t_flash_from_kernel: nvsimg2img /home/jnitsch/nvidia_jetson/Linux_for_Tegra/tools/kernel_flash/images/external/system.img /dev/sdf1 failed
[ 459]: l4t_flash_from_kernel: Error flashing external device
Error flashing non-qspi storage
Cleaning up...
Do you have any idea what I missed here?