[flame] System image: use make_ext4fs/ext2img instead of libsparse
Currently the sparse system image built for the Mozilla Flame is unflashable.
Diffing the pmOS image against the original B2G image shows these differences:
$ file B2G-system.img B2G-system.img: Android sparse image, version: 1.0, Total of 107392 4096-byte output blocks in 1228 input chunks. $ file pmOS-system.img pmOS-system.img: Android sparse image, version: 1.0, Total of 91136 4096-byte output blocks in 87 input chunks.
There is a noticable difference in input chunks.
Digging deeper into the B2G build logs, it seems they build the rootfs using
make_ext4fs with some custom parameters:
16:56:50 INFO - + make_ext4fs -s -S out/target/product/flame/root/file_contexts -l 439877632 -a system out/target/product/flame/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/flame/system 16:56:55 INFO - Creating filesystem with parameters: 16:56:55 INFO - Size: 439877632 16:56:55 INFO - Block size: 4096 16:56:55 INFO - Blocks per group: 32768 16:56:55 INFO - Inodes per group: 6720 16:56:55 INFO - Inode size: 256 16:56:55 INFO - Journal blocks: 1678 16:56:55 INFO - Label: 16:56:55 INFO - Blocks: 107392 16:56:55 INFO - Block groups: 4 16:56:55 INFO - Reserved block group size: 31 16:56:55 INFO - Created filesystem with 1286/26880 inodes and 74641/107392 blocks
I wonder whether this might be the cause of my invalid system image (WIP), and in general whether we might want to use
make_ext4fs for creating the rootfs.
Alternatively, I might be barking up the wrong tree and this might be similar to https://github.com/anestisb/android-simg2img/issues/2 in which case we can look into using
ext2simg instead of
img2simg for sparse images.