I’ve thought extensively about your first point. The problem is that a file system has to be created, and this requires a block device. In recovery mode the Jetson is not a mass storage device. Thus, there is no way to perform this operation directly on the Jetson without intermediate memory (the host PC’s disk).
Unfortunately, the recovery mode Jetson is something of a black box, and so unless NVIDIA exposes a recovery mode Jetson as (at least in part) a USB mass storage device (and this might not even be possible), then there is no “simple” solution.
A possible host side workaround would be rather complicated, but possible: Modify the equivalent of loopback program “losetup
” (and possibly the kernel) to serialize (a data pipe) losetup
where it can take a serial stream (which is what a recovery mode Jetson accepts when writing to it via USB) and apply mkfs.ext4
as if it were a block device, but the stream is used to populate the recovery mode Jetson. This would be a fascinating project (reminding me of the evolution of parallel ATA drives to serial/SATA drives, but for losetup
), but not simple, and requiring full access to recovery mode’s internal workings, so it is unlikely “reasonable”.
At least for now adding other storage to the host PC while generating the file system seems to be the only way to go.
For decreasing time, this is why NVIDIA added the ability to flash via sparse file systems instead of the standard raw file systems. Unfortunately one has to first create a raw file system prior to the sparse. The up side is that if you “reuse” the file system, then you never again have to create one. You could in fact have a number of external drives with different file systems and mount the one you want; flash would go fast if you have this pre-created “library” of reusable images. For the “flash.sh
” program, this is the “-r
” option.
Your last thought on out of the box resizing is something which might be much more possible in the JetPack/SDKM 5 release (or any release using UEFI). Having UEFI actually makes it possible to add intelligent software in the boot stages which would be similar to a bootable install DVD or thumb drive. For this I’d probably need access to the JetPack/SDKM source for it to be useful (there would not be any need to access the proprietary firmware setup occurring in UEFI for setup prior to the standardized parts which are presented in the middle of UEFI boot). UEFI makes a lot of fascinating new possibilities available, but one would need access to the installer software for it to be intuitive.
One variation is based on what you mention about a smaller raw image size: A smaller image could be installed, and then expanded (it would basically be an in-place equivalent to what gparted
does, partly in the recovery mode Jetson, and partly in the host side flash software). Big project.