system.img文件 解包/打包

解压img文件
解包/打包工具放在:mediatek/build/tools/images/
请先确认是否有打过patch:ALPS00393168,如果没有请打上再解包/打包
解包方法:使用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

注意事项:请将需要解包/打包的image或文件夹放在mediatek/build/tools/images/,在该目录下执行命令,请不要复制脚本到某个目录在执行,因为diff.pyc/pack.pyc会调用其他脚本,复制脚本到其他目录会导致找不到对应脚本。

你可能感兴趣的:(system.img文件 解包/打包)