How to mod: boot & Recovery

Source: Internet
Author: User
Tags unpack
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 particle NAND partition...

  1. Use Linux
  2. GetMkbootfs&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"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

  3. Get split_boot.zip from how
    To post mentioned in the beginning
  4. Grab a boot. IMG or recovery. IMG (my examples will be based on recovery )-See Post #3 for grabbing these from your device
  5. Split it
    • Code:
      ./split_bootimg.pl recovery.img
    • It cocould tell you that there is no Android magic... in which case this file cannot be split this way... tell us about it...

  6. Examine
    • You will have two new files based on whatever file name you gave abve
    • 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

  7. Unpack ramdisk
    • Code:
      mkdir ramdisk_recoverycd ramdisk_recoverygzip -dc ../recovery.img-ramdisk.gz | cpio -i

  8. 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

  9. Pack-up ramdisk
    • Code:
      mkbootfs ./ramdisk_recovery | gzip > ramdisk_recovery-edited.gz

  10. 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 your test tries and cannot figure out what you did for each
    • Here you can mix and match kernels

  11. Now flash via recovery or something
    • Only mess with boot or recovery if you break both you will have a bricked Device

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.