修改Android boot.img


一 大概流程

1)  From running boot.img
 
- retrieve boot.img from device using dd on the LNX partition
- use umkbootimg to explode it
- unzip initramfs and then cpio to get the default.prop, init.rc, init.trace.rc, etc.
- change desired files
- use mkbootimg to rebuild a RENAMED bootXX.img
- adb reboot bootloader
- fastboot boot ./bootXX.img to load the image without writing to flash
- IF it comes up, check to make sure props and init is run okay ELSE powercycle to boot flashed boot.img
- Once the new image is soaked write the new image to flash: fastboot flash boot bootXX.img
 
2) From local build area
- GIT clone the android area
- change the desired files, 
- do a "make bootimage" to build boot.img
- save the running boot.img as above
- follow steps above to fastboot your private image, soak it and then flash it.
 
 用第一種流程。
 

二 具體流程

參考:

  http://www.imajeenyus.com/computer/20130301_android_tablet/android/unpack_repack_recovery_image.html

  http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images#Background

  有照着這兩篇的方法做。但我重新壓縮出來的img是不對的。原img有14.5M,我重新打包后只有8M,fastboot flash進去無法啟動。肯定有參數沒有指定對。但具體的實現就是這樣。

 

三 簡單可行的方法

  用xda上提供的簡單工具直接pack/unpack

  http://forum.xda-developers.com/showthread.php?t=2073775

  https://github.com/OrenHg/Android-Image-Kitchen/tree/AIK-Linux

  直接可用。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM