原文:http://blog.chinaunix.net/uid-26009923-id-3454597.html
1. android 编译完成之后会生生一个 system.img,要想解压system.img需要知道system.img是如何打包生成的,这个好像没有工具可以查看system.img的格式,只能一个个的试。 下载ext4_utils http://andwise.net/?attachment_id=406 应该有源码的,但这个是编译好的二进制文件,直接拿来用就行。 2. 解压 sun@ubuntu:~/ext4$ ls ext4_utils.tar.gz make_ext4fs simg2img system.img temp sun@ubuntu:~/ext4$ file system.img system.img: data //生成 ext4格式的img文件 sun@ubuntu:~/ext4$ ./simg2img system.img system.img.ext4 root@yanfa3-desktop:~/ext4# file ./system.img.ext4 ./system.img.ext4: Linux rev 1.0 ext4 filesystem data, UUID=57f8f4bc-abf4-655f-bf67-946fc0f9f25b (needs journal recovery) (extents) (large files) //最后一步挂载,挂载之后就可以像随意修改了 sun@ubuntu:~/ext4$ mkdir ./sys_dir sun@ubuntu:~/ext4$ mount -t ext4 -o loop system.img.ext4 ./sys_dir/ sun@ubuntu:~/ext4$ ./make_ext4fs -s -l 512M -a system system_new.img ./sys_dir/ sun@ubuntu:~/ext4$ file ./system_new.img ./system_new.img: data |
解压system.img
最新推荐文章于 2023-01-31 22:02:06 发布