> 2) Add files into that container. If possible, be able to resize > the > file holding the container, as well as resize the partitions defined > inside. > Mount the image in a VM, where you have some tool (partition magic? PQ magic?) that can shrink Windows filesystems (FAT16/FAT32/NTFS). Booted from a small "service" system disk.
After that tool is finished, you should end up with some deallocated space at the end of your raw image file. You can then use qemu-img to shrink the image file - or so I understand. See also my previous note, if this stuff with raw images and resizing wouldn't be easier to solve with a more modern image format - provided that you can get a hypervisor for Android that can work with them. Frank
