/************************************************************************* * I.MX6 system.img unpack repack * 说明: * 以前的system.img直接ext4的,现在的system.img是data类型的,需要工具 * 进行转换才行,需要这些工具主要是还是为了减少开发中编译等待时间过长。 * * 2016-9-10 深圳 南山平山村 曾剑锋 ************************************************************************/ 一、参考文档: 1. Android中system.img的两种格式及其相互转换方法 http://www.th7.cn/Program/Android/201501/381202.shtml 2. ext4 unpack/repack tools http://web.djodjo.org/article/download/android/tools/x86_linux/ext4tools 二、执行命令: 1. source ./build/envsetup.sh 2. make img2simg_host 三、编译输出信息: ...... including ./system/security/softkeymaster/Android.mk ... including ./system/vold/Android.mk ... including ./tools/external/fat32lib/Android.mk ... *** Overlay change detected, clean shared intermediate files... *** rm -rf out/target/common/obj/APPS/framework-res_intermediates out/target/common/obj/APPS/Launcher2_intermediates out/target/common/obj/APPS/SettingsProvider_intermediates out/target/common/obj/APPS/Settings_intermediates out/target/common/obj/APPS/Bluetooth_intermediates Import includes file: out/host/linux-x86/obj32/EXECUTABLES/img2simg_host_intermediates/import_includes Header: out/target/product/generic/obj/include/libexpat/expat.h Header: out/target/product/generic/obj/include/libexpat/expat_external.h Header: out/target/product/generic/obj/include/libpng/png.h Header: out/target/product/generic/obj/include/libpng/pngconf.h Header: out/target/product/generic/obj/include/libpng/pngusr.h Header: out/target/product/generic/obj/include/selinux/selinux.h Header: out/target/product/generic/obj/include/selinux/label.h Header: out/target/product/generic/obj/include/selinux/context.h Header: out/target/product/generic/obj/include/selinux/avc.h Header: out/target/product/generic/obj/include/selinux/android.h Header: out/target/product/generic/obj/include/libsonivox/eas.h Header: out/target/product/generic/obj/include/libsonivox/eas_types.h Header: out/target/product/generic/obj/include/libsonivox/eas_reverb.h Header: out/target/product/generic/obj/include/libsonivox/jet.h Header: out/target/product/generic/obj/include/libsonivox/ARM_synth_constants_gnu.inc Header: out/target/product/generic/obj/include/libwpa_client/wpa_ctrl.h Header: out/target/product/generic/obj/include/libwpa_client/qca-vendor.h host C: img2simg_host <= system/core/libsparse/img2simg.c Export includes file: system/core/libsparse/Android.mk -- out/host/linux-x86/obj32/EXECUTABLES/img2simg_host_intermediates/export_includes host Executable: img2simg_host (out/host/linux-x86/obj32/EXECUTABLES/img2simg_host_intermediates/img2simg) Install: out/host/linux-x86/bin/img2simg #### make completed successfully (03:18 (mm:ss)) #### zengjf@zengjf:~/myandroid$ 四、真正的img2simg 1. 上面编译出来的img2simg还是有问题,会报如下错误: zengjf@zengjf:~/myandroid$ img2simg out/target/product/sabresd_6dq/obj/PACKAGING/systemimage_intermediates/system.img system.img img2simg: ../../core/libsparse/sparse.c:143: write_all_blocks: Assertion `pad >= 0' failed. Aborted (core dumped) 2. 下载参考文档中的img2simg,验证可行。