android的system.img分为两种,
一种是raw ext4 image,其特点是完整的ext4分区镜像(包含很多全零的无效填充区),可以直接使用mount进行挂载,因此比较大
$ file system.img
system_raw.img: Linux rev 1.0 ext4 filesystem data, UUID=xxxx(extents) (large files)
另一种是sparse ext4 image,是一个非常普通的dat文件。由于它将raw ext4进行稀疏描述,因此尺寸比较小(没有全零的无效填充区)
$ file system.img
system.img: data
simg2img的位置在“out/host/linux-x86/bin/simg2img”
simg2img源码的位置在“system/core/libsparse”
//sparse image转化成为ext4的raw imge
Usage: simg2img <sparse_image_files> <raw_image_file>
//ext4的raw image to sparse image
Usage: img2simg <raw_image_file> <sparse_image_file> [<block_size>]
————————————————
版权声明:本文为CSDN博主「luckywang1103」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/luckywang1103/article/details/77776456