> the fallocate call with FALLOC_FL_PUNCH_HOLE should do the trick.That's actually exactly what zerofree uses: http://intgat.tigress.co.uk/rmy/uml/index.html
> Also, does the code start out with a sparse disk image?Nope. It's just plain raw format. But it's damn easy to create a new disk format: https://github.com/andsens/bootstrap-vz/tree/master/common/fs
GNU truncate is one way to do this, which we use in the GCE build-debian-cloud logic.> [...] with the exception of disk space that is allocated then freed during the build.The minimize_size plugin prevents some of that by binding folders from the host system in to key locations on the chroot (/tmp and apt-cache)
> This should happen in all image builds that make raw disk images from scratch, since it's generally useful and widely portable across build filesystems/OSes even where zerofree or FALLOC_FL_PUNCH_HOLE is unavailable.OK, cool. I'll try and add it to the plugin, should just be another task and then a switch whether you want to use zerofree, sparsification or nothing. Do you have a ready-to-go command I could just plug in?