boot.img is not a compressed filesystem image like system.img. It is read by the bootloader, and contains little more than a kernel image and a ramdisk image.
我们可以从手机导出boot.img, 其实它并不是一个完整的文件系统 ,由google定义的文件格式。如何定义见,android-src/system/core/mkbootimg/bootimg.h
2k头文件,gzip压缩的内核,ramdisk, second stage(可选)
1F 8B 08便是内核起始处
二、boot.img解压
以下地址下载到工具,包含2个程序,
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android-serialport-api/android_bootimg_tools.tar.gz
* unpackbootimg
* mkbootimg
解压以后得到:
* boot.img-zImage ----> kernel
* boot.img-ramdisk.gz ----> ramdisk
三、重点说下这个内核boot.img-zImage
很好判断gzip格式,解压命令:
gunzip -c boot.img-ramdisk.gz | cpio -i
解压后是个特定于cpu的目标文件 arm64 pe格式
四、重新打包
mkbootimg
原文:http://www.cnblogs.com/gtoo/p/7255986.html