http://forum.androidspin.com/showthread.php/3973-ADVANCED-How-To-Mod-BOOT-amp-RECOVERY
[ADVANCED] How To Mod: BOOT & RECOVERY
This is heavily based on:
HOWTO: Unpack, Edit, and Re-Pack Boot Images
Android Magic
.img file is special (it is not regular, it has magic), it is the image file of a particular NAND partition...
- Use Linux
- Get mkbootfs & mkbootimg
- these are tools made when compiling Android OS source code
- If you do not want to compile your own source code just download the binaries
- This download link is from an XDA forum post
- the zip has the correct binaries but they are named with "-linux-x86", feel free to rename
- This is just to let you know it was compiled for Linux (maybe you can find one for Windows?) and x86 architecture
- Get split_boot.zip from HOW TO post mentioned in the beginning
- Grab a boot.img or recovery.img (my examples will be based on recovery) - see post #3 for grabbing these from your device
- Split it
Code:./split_bootimg.pl recovery.img- It could tell you that there is no Android Magic... in which case this file cannot be split this way... tell us about it...
- Examine
- You will have two new files based on whatever file name you gave above
- kernel will have "-kernel"
- YES this is the kernel (compressed) for this .img
- you have successfully extracted the kernel
- you cannot edit these
- you can mix and match
- if I know the kernel from older boot works I can just use it with my newly edited ramdisk
- ramdisk will have "-ramdisk.gz"
- feel free to rename
- Unpack Ramdisk
Code:mkdir ramdisk_recovery cd ramdisk_recovery gzip -dc ../recovery.img-ramdisk.gz | cpio -i
- Examine
- In all ramdisk you will have a few folders and files:
- data
- dev
- etc
- proc
- res
- images for recovery go here
- sbin
- the actually recovery binary goes here
- also adbd
- sys
- system
- tmp
- default.prop
- init
- init.goldfish.rc
- init.rc
- init.yuhua.rc
- init.yuhua.sh
- initlogo.rle
- obviously recovery and boot will be different
- Compare stock ones with ones I edited
- Use Beyond Compare or Meld
- Pack-up Ramdisk
Code:mkbootfs ./ramdisk_recovery | gzip > ramdisk_recovery-edited.gz
- Back to IMG
Code:mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel recovery.img-kernel --ramdisk ramdisk_recovery-edited.gz -o recovery-edited.img- use file good file names! Or you might end up with many test tries and cannot figure out what you did for each
- Here you can mix and match kernels
- Now Flash via recovery or something
- Only mess with boot or recovery if you break both you will have a bricked device