The “driver package” (which creates the “Linux_for_Tegra/” subdirectory for flash) has a tool (and if you’ve flashed with SDK Manager, then it would have downloaded this for you) called “mksparse”. Located in “Linux_for_Tegra/bootloader/”. To see options run “./mksparse --help”. The “–fillpattern=0” is what is used for sparse images during flash (this is the default…“bootloader/systme.img.raw” gets turned into “bootloader/system.img” via this utility).
Do be aware that once in sparse format the open source tools for sparse images won’t work with this. Keep your raw image available if you might need to edit the image.
The current JetPack official image is 18.04 (bionic) with Nvidia software on top. Is there some Ubuntu software that you can’t find? Mostly everything should be apt-get installable.
The current deployment is too fat :) I was trying to install OpenCV 3 from source after having flashed the Nvidia image to a 32 (!!) GB SD card. The compilation process run over night and I found the Jetson claiming to have ran out of disk space this morning.
Yepp. Meanwhile I was able to roll one of the smart and slim images the @pythops solution provides. 18.04 and 20.04. I’m just a bit anxious with 20.04: As far as I know DS 5.x is not known to be compatible with 20.04 (?)
What was the exact error message? More likely during the build process it ran out of memory (RAM). That’s a known issue. I’ve built OpenCV on that card size before. It might help, before you start the build to drop to the command line temporarily with:
sudo systemctl isolate multi-user.target
(and then build via the console or ssh)
That should free up enough ram for the build to complete. If you still want to, by all means, use the pythops repo to create your own image. I looked at @pythops code. It’s simple and to the point, using debootstrap to create a rootfs, ansible to configure it, and seems to follow Nvidia’s instructions to add their software to the rootfs. So good job, @pythops . This is hard stuff and you seem to have nailed it.
@mdegans Well, disk full :) And indeed, 30 GB have been consumed (df -H) I have no clue what happened. I repeated later, but abandoned in favour of @pythops solution (which works great). There are some minor problems (e.g. the ./flash.sh needed to be altered in order to meet my environment and there was a nameserver entry necessary in order to pass the apt updates at build time).
But the basic image is 1.4 GB. And it is blazing fast. I was using the 18.04 branch, because I feared incompatibilities of DS 5.x with 20.04.
Also, Docker can take up a ton of space so you could try purging any images and containers you’re not using. If you’re like me you forget --rm a lot and that can quickly fill up a disk so.