Mtk Android 打包解包*.img

打包/解包 boot.img, system.img, userdata.img, or recovery.img


[DESCRIPTION]

MTK codebase编译出来的image必须使用MTK codebase里的工具才能解开或打包,网络上的打包/解包工具不能在MTKimage里使用

 

[KEYWORD]

打包

解包

diff.pyc

pack.pyc

 

[SOLUTION]

解包/打包工具放在:mediatek/build/tools/images/

解包方法:使用diff.pyc工具

使用方法: python ./diff.pyc <image file>
<image file> 只能为 boot.img, system.img, userdata.img, or recovery.img
例子:
python ./diff.pyc boot.img
output ramdisk folder:  /tmp/xxxx
output kernel file: /tmp/xxxx-kernel

打包方法:使用pack.pyc工具

使用方法:
python ./pack.pyc [-2|-4|-eMMC size] <folder>
Option:
-2:  NAND 2K block
-4:  NAND 4K block
-eMMC size: eMMC image size, ex. -512 for 512MB
<folder> 
只能是system, data, cache,否则制作出来的image权限不对,会开不了机
例子:
python ./pack.pyc -512 data
data目录的文件打包生成EXT4格式的userdata.img
system.img: make_ext4fs -s -l 512M -a system system.img /tmp/system
原文地址:https://www.cnblogs.com/LoongEmbedded/p/5298419.html