System image is still very large after mksparse

Finally I got the smaller image:

losetup --find --show clone.img.raw # assume loop device is /dev/loop6
zerofree -v /dev/loop6 # That’s it!
losetup -d /dev/loop6
./bootloader/mksparse --fillpattern=0 clone.img.raw clone.img
ls -lh clone.*
-rwxr-xr-x 1 root root 8.2G Apr 4 21:21 clone.img
-rw-r–r-- 1 root root 14G Apr 4 21:19 clone.img.raw

I think either the unused space is not set to 0 on EMMC, or flash.sh did wrong when cloning.
Thank you anyway, @linuxdev .

2 Likes