[转]How to easy split the Android boot image
来源:互联网 发布:矛盾矩阵 编辑:程序博客网 时间:2024/06/05 14:57
http://whiteboard.ping.se/Android/Unmkbootimg
I've put together a small utility undoing what mkbootimg does. Compared to similarutilities this also extracts the base addresses and command line parameters. It can also extract the kernel and root file system from a boot image embedded in a larger file, such as an update image.
Using this tool you can easily extract the ram root file system and kernel from the Android boot image.
Note that only parameters different from default are displayed, so if unmkbootimg does not display base address for example, you'll not have to specify it to mkbootimg neither.
About the mkbootimg build tool
For some phones, the boot image is built using non-standard offset(s). To rebuild your boot image again,you'll first have to recompile the build tool mkbootimg with the new offset(s). The unmkbootimg tool will tell you if this is needed and what offsets(s) to change.
- How to recompile mkbootimg
Download
- unmkbootimg version 1.2, gziped binary for GNU/Linux.
Feedback
- XDA forum thread
Usage
$ unmkbootimg boot.img Kernel size 2419636Kernel address 0x20008000Ramdisk size 152656Ramdisk address 0x21000000Secondary size 0Secondary address 0x20f00000Kernel tags address 0x20000100Flash page size 2048Board name is ""Command line "no_console_suspend=1"Extracting kernel to file zImage ...Extracting root filesystem to file initramfs.cpio.gz ...All done.---------------To recompile this image, use: mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x20000000 --cmdline 'no_console_suspend=1' -o new_boot.img---------------$ ls -ltotalt 5044-rw-r--r-- 1 kuisma kuisma 2576384 9 sep 09.44 boot.img-rw-r--r-- 1 kuisma kuisma 152656 9 sep 09.44 initramfs.cpio.gz-rw-r--r-- 1 kuisma kuisma 2419636 9 sep 09.44 zImage
Cavats
Some devices have a header before the actual gzip'ed cpio archive:
0000000 210 026 210 130 141 251 014 000 122 117 117 124 106 123 000 000 210 026 210 X a 251 \f \0 R O O T F S \0 \00000020 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \00000040 000 000 000 000 000 000 000 000 377 377 377 377 377 377 377 377 \0 \0 \0 \0 \0 \0 \0 \0 377 377 377 377 377 377 377 3770000060 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377*0001000 037 213 010 000 000 000 000 000 000 003 354 275 173 174 024 325
In this case above, the actual gzip starts at 0001000
with the familiar gzip header037 213
.Skip this before you proceed unpacking the initramfs.
$ dd if=initramfs.cpio.gz of=corrected-initramfs.cpio.gz bs=512 skip=1
/By Mikael Q Kuisma
- [转]How to easy split the Android boot image
- how to make boot image
- how to make boot image
- [转]如何分屏幕(How to split the Screen)
- How to Split an Image into Chunks - Java ImageIO
- How to make the sprite image ?
- How to Get an Android Device Image?
- 如何分屏幕(How to split the Screen)
- How To Improving Android Boot Time
- how to invisible the plot image in matlab
- How to make 9-patch image downloaded from the Network
- How to store an image file to SQliteDB in android
- How to store an image file to SQliteDB in android
- How to transfer image file to server from android
- how to unzip split file
- (转)How to build adb, the Android debugger
- Spring Boot How To
- How to Change the Default Boot Device by Using the Boot PROM
- 第12周项目4 - 利用遍历思想求解图问题(7)
- 第十六周项目一(4)堆排序
- 第十六周项目1-验证算法(3)冒泡排序
- java对象流重载 serialVersionUID 属性
- C++ STL 一般总结
- [转]How to easy split the Android boot image
- 修改kafka topic的offset几种方法
- mysql细节补充
- 第十五周项目3-B-树的基本操作
- 第十四周 项目1-(4)验证平衡二叉树相关算法
- <leetcode>268. Missing Number
- python3.5 opencv3.1 不能使用sift, surf。
- 第十六周 验证算法--堆排序
- 第十六周--堆排序