解压和打包boot.img,userdata.img,system.img
工具下载链接地址: http://pan.baidu.com/s/1eQs2vNs
$dtbTool -s 2048 -o arch/arm/boot/dt.img -p dtc arch/arm/boot/
$ ./unpackbootimg -i boot.img支持解压zImage和ramdiskfs
$./spilt_bootimg.pl boot.img支持解压kernel ,ramdiskfs和 dt.img
$ mkdir ramdisk
$ cd ramdisk
$ gzip -dc ../boot.img-ramdisk.gz | cpio -i
解压userdata.img和system.img
$./simg2img ./userdata.img userdata.raw.img
$./simg2img ./system.img system.raw.img
$mkdir data
$mkdir system
$sudo mount -t ext4 -o loop userdata.raw.img ./data
$sudo mount -t ext4 -o loop system.raw.img ./system
打包boot.img
$./mkbootfs root > ./ramdisk.img
$./mkbootimg --kernel kernel --ramdisk ramdisk.img --dt dt.img --cmdline "console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37" --base 0x00000000 --pagesize 2048 --output boot.img
打包userdata.img和system.img
$./make_ext4fs -s -l 10M -a data ./userdata.img ./data
$./make_ext4fs -s -l 550M -a system ./system.img ./system
具体请参考 http://blog.csdn.net/sjz_iron/article/details/8246029