修改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

  直接可用。

posted @ 2016-07-19 13:54  得即高歌失即休  阅读(2505)  评论(0编辑  收藏  举报