Hi,
We need to use Docker to create a flashing setup. I’ve used Flashing Orin NX using custom docker container - #4 by benyamin as an example and got up to the point where the target boots and even got to flash the NVME, but that worked only once and then failed as ssh somehow timed out while the QSPI was being erased:
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for device to expose ssh ......Waiting for device to expose ssh ...Run command: flash on fc00:1:1:0::2
SSH ready
blockdev: cannot open /dev/mmcblk0boot0: No such file or directory
[ 0]: l4t_flash_from_kernel: Serial Number: 1421823001379
[ 0]: l4t_flash_from_kernel: Starting to create gpt for emmc
Active index file is /mnt/internal/flash.idx
Number of lines is 61
max_index=60
[ 1]: l4t_flash_from_kernel: Successfully create gpt for emmc
[ 1]: l4t_flash_from_kernel: Starting to create gpt for external device
Active index file is /mnt/external/flash.idx
Number of lines is 22
max_index=21
writing item=1, 9:0:primary_gpt, 512, 19968, gpt_primary_9_0.bin, 16896, fixed-<reserved>-0, 977155b6b1ea5b0415af6d03a5ed3ba520cab76b
Writing primary_gpt partition with gpt_primary_9_0.bin
Offset is not aligned to K Bytes, no optimization is applied
dd if=/mnt/external/gpt_primary_9_0.bin of=/dev/nvme0n1 bs=1 skip=0 seek=512 count=16896
16896+0 records in
16896+0 records out
16896 bytes (17 kB, 16 KiB) copied, 0.032323 s, 523 kB/s
Writing primary_gpt partition done
Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used.
Warning: Not all of the space available to /dev/nvme0n1 appears to be used, you can fix the GPT to use all of the space (an extra 380580528 blocks) or continue with the current setting?
Writing secondary_gpt partition with gpt_secondary_9_0.bin
Offset is not aligned to K Bytes, no optimization is applied
dd if=/mnt/external/gpt_secondary_9_0.bin of=/dev/nvme0n1 bs=1 skip=0 seek=61203267072 count=16896
16896+0 records in
16896+0 records out
16896 bytes (17 kB, 16 KiB) copied, 0.0283855 s, 595 kB/s
Writing secondary_gpt partition done
Fix/Ignore? Fix
Warning: Not all of the space available to /dev/nvme0n1 appears to be used, you can fix the GPT to use all of the space (an extra 380580528 blocks) or continue with the current setting?
Model: TS256GMTE110S (nvme)
Disk /dev/nvme0n1: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
2 20.5kB 134MB 134MB A_kernel msftdata
3 134MB 135MB 786kB A_kernel-dtb msftdata
4 135MB 168MB 33.2MB A_reserved_on_user msftdata
5 168MB 302MB 134MB B_kernel msftdata
6 302MB 303MB 786kB B_kernel-dtb msftdata
7 303MB 336MB 33.2MB B_reserved_on_user msftdata
8 336MB 420MB 83.9MB recovery msftdata
9 420MB 421MB 524kB recovery-dtb msftdata
10 421MB 488MB 67.1MB esp msftdata
11 488MB 572MB 83.9MB recovery_alt msftdata
12 572MB 572MB 524kB recovery-dtb_alt msftdata
13 572MB 639MB 67.1MB esp_alt msftdata
14 639MB 1059MB 419MB UDA msftdata
15 1059MB 1562MB 503MB reserved msftdata
16 1562MB 1687MB 126MB fat16 resin-boot boot, esp
17 1687MB 2438MB 751MB ext4 resin-rootA msftdata
18 2438MB 3189MB 751MB ext4 resin-rootB msftdata
19 3189MB 3210MB 21.0MB ext4 resin-state msftdata
20 3210MB 61.2GB 58.0GB resin-data msftdata
[ 2]: l4t_flash_from_kernel: Expanding last partition to fill the storage device
[ 2]: l4t_flash_from_kernel: Successfully create gpt for external device
[ 2]: l4t_flash_from_kernel: Starting to flash to emmc
Flash index file is /mnt/internal/flash.idx
Active index file is /mnt/internal/flash.idx
Number of lines is 61
max_index=60
Number of lines is 61
max_index=60
[ 2]: l4t_flash_from_kernel: Starting to flash to external device
Active index file is /mnt/external/flash.idx
Number of lines is 22
max_index=21
[ 2]: l4t_flash_from_kernel: Starting to flash to qspi
QSPI storage size: 67108864 bytes.
writing item=0, 9:0:master_boot_record, 0, 512, mbr_9_0.bin, 512, fixed-<reserved>-0, 694898d1c345bdb31b377790ed7fc0b0db184bf7
writing item=1, 9:0:primary_gpt, 512, 19968, gpt_primary_9_0.bin, 16896, fixed-<reserved>-0, 977155b6b1ea5b0415af6d03a5ed3ba520cab76b
writing item=2, 9:0:A_kernel, 20480, 134217728, , , fixed-<reserved>-2,
[ 2]: l4t_flash_from_kernel: Warning: skip writing A_kernel partition as no image is specified
writing item=3, 9:0:A_kernel-dtb, 134238208, 786432, , , fixed-<reserved>-3,
[ 3]: l4t_flash_from_kernel: Warning: skip writing A_kernel-dtb partition as no image is specified
writing item=4, 9:0:A_reserved_on_user, 135024640, 33161216, , , fixed-<reserved>-4,
[ 3]: l4t_flash_from_kernel: Warning: skip writing A_reserved_on_user partition as no image is specified
writing item=5, 9:0:B_kernel, 168185856, 134217728, , , fixed-<reserved>-5,
[ 3]: l4t_flash_from_kernel: Warning: skip writing B_kernel partition as no image is specified
writing item=6, 9:0:B_kernel-dtb, 302403584, 786432, , , fixed-<reserved>-6,
[ 3]: l4t_flash_from_kernel: Warning: skip writing B_kernel-dtb partition as no image is specified
writing item=7, 9:0:B_reserved_on_user, 303190016, 33161216, , , fixed-<reserved>-7,
[ 3]: l4t_flash_from_kernel: Warning: skip writing B_reserved_on_user partition as no image is specified
writing item=8, 9:0:recovery, 336351232, 83886080, , , fixed-<reserved>-8,
[ 3]: l4t_flash_from_kernel: Warning: skip writing recovery partition as no image is specified
writing item=9, 9:0:recovery-dtb, 420237312, 524288, , , fixed-<reserved>-9,
[ 3]: l4t_flash_from_kernel: Warning: skip writing recovery-dtb partition as no image is specified
writing item=10, 9:0:esp, 420761600, 67108864, uefi_jetson.bin, 3342336, fixed-<reserved>-10, 87462abb434db49791f26e029929eb9e170cd539
Writing esp partition with uefi_jetson.bin
Get size of partition through connection.
3342336 bytes from /mnt/external/uefi_jetson.bin to /dev/nvme0n1: 1KB block=3264 remainder=0
dd if=/mnt/external/uefi_jetson.bin of=/dev/nvme0n1 bs=1K skip=0 seek=410900 count=3264
3264+0 records in
3264+0 records out
3342336 bytes (3.3 MB, 3.2 MiB) copied, 0.0443841 s, 75.3 MB/s
Writing esp partition done
writing item=11, 9:0:recovery_alt, 487870464, 83886080, , , fixed-<reserved>-11,
[ 3]: l4t_flash_from_kernel: Warning: skip writing recovery_alt partition as no image is specified
writing item=12, 9:0:recovery-dtb_alt, 571756544, 524288, , , fixed-<reserved>-12,
[ 3]: l4t_flash_from_kernel: Warning: skip writing recovery-dtb_alt partition as no image is specified
writing item=13, 9:0:esp_alt, 572280832, 67108864, , , fixed-<reserved>-13,
[ 3]: l4t_flash_from_kernel: Warning: skip writing esp_alt partition as no image is specified
writing item=14, 9:0:UDA, 639401984, 419430400, , , fixed-<reserved>-14,
[ 3]: l4t_flash_from_kernel: Skip writing UDA partition
writing item=15, 9:0:reserved, 1058832384, 502792192, , , fixed-<reserved>-15,
[ 4]: l4t_flash_from_kernel: Warning: skip writing reserved partition as no image is specified
writing item=16, 9:0:resin-boot, 1561624576, 125829120, , , fixed-<reserved>-16,
[ 4]: l4t_flash_from_kernel: Warning: skip writing resin-boot partition as no image is specified
writing item=17, 9:0:resin-rootA, 1687453696, 750780416, , , fixed-<reserved>-17,
[ 4]: l4t_flash_from_kernel: Warning: skip writing resin-rootA partition as no image is specified
writing item=18, 9:0:resin-rootB, 2438234112, 750780416, , , fixed-<reserved>-18,
[ 4]: l4t_flash_from_kernel: Successfully flash the emmc
[ 4]: l4t_flash_from_kernel: Warning: skip writing resin-rootB partition as no image is specified
writing item=19, 9:0:resin-state, 3189014528, 20971520, , , fixed-<reserved>-19,
[ 4]: l4t_flash_from_kernel: Warning: skip writing resin-state partition as no image is specified
writing item=20, 9:0:resin-data, 3209986048, 57993277440, , , expand-<reserved>-20,
[ 4]: l4t_flash_from_kernel: Warning: skip writing resin-data partition as no image is specified
writing item=21, 9:0:secondary_gpt, 61203267072, 16896, gpt_secondary_9_0.bin, 16896, fixed-<reserved>-0, 9849235129cc423ba016bdf1bcbfe3244ff27638
[ 4]: l4t_flash_from_kernel: Successfully flash the external device
Flash failure
Either the device cannot mount the NFS server on the host or a flash command has failed. Check your network setting (VPN, firewall,...) to make sure the device can mount NFS server. Debug log saved to /tmp/tmp.FBLkoKsMFK. You can access the target's terminal through "sshpass -p root ssh root@fc00:1:1:0::2"
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
Cleaning up...
Unfortunately, most of the times, the container hangs like this:
/tmp/bsp-mount/Linux_for_Tegra
***************************************
* *
* Step 3: Start the flashing process *
* *
***************************************
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for device to expose ssh ......Waiting for device to expose ssh ...Run command: flash on fc00:1:1:0::2
SSH ready
and on the device I see:
bash-5.1# [ 234.467261] nfs: server fc00:1:1:0::1 not responding, timed out
[ 234.467284] NFS: state manager: lease expired failed on NFSv4 server fc00:1:1:0::1 with error 110
If I run the exact same flash command but from the hostOS from /tmp/bsp-mount/Linux_for_Tegra, which is the bind-mount of the container and has the exact same sources, flashing always works as expected and completes successfully.
In the container I’ve installed openssh-server as per the above forums post and am starting it with:
docker container run --rm -it --privileged -v /dev/:/dev/ -v ~/images:/data/images -v /tmp/bsp-mount/Linux_for_Tegra:/tmp/bsp-mount/Linux_for_Tegra -v /run/nvidia_initrd_flash/docker_host_network:/run/nvidia_initrd_flash/docker_host_network -v /dev/bus/usb:/dev/bus/usb/ --network host -p 2222:22 orin-image /bin/bash
I’ve tried running sshpass -p root ssh root@fc00:1:1:0::2 after the failure and am getting:
ssh: connect to host fc00:1:1::2 port 22: Network is unreachable
from both the HostOS and from the Docker container. Both Docker and HostOS are Ubuntu 22.04.
Thanks