Build android boot image (desire)

  1. Download some file
    repack-bootimg.pl
    unpack-bootimg.pl
    split_bootimg.pl
  2. Dump boot.img from device
    cat /dev/mtd/mtd2 > /sdcard/boot.img
  3. Un-pack boot.img
    ./split_bootimg.pl boot.img
  4. Extract the ramdisk.
    mkdir ramdisk
    cd ramdisk
    gzip -dc ../boot.img-ramdisk.gz | cpio -i
    cd ..
  5. Recreate ramdisk (the mkbootfs binary produced from building the Android source code)
    mkbootfs ./ramdisk | gzip > ramdisk-new.gz
  6. Re-pack boot.img
    mkbootimg --cmdline 'no_console_suspend=1 console=null' --base 0x20000000 --kernel boot.img-kernel --ramdisk ramdisk-new.gz -o boot-new.img

    For Nexus One : Add --base 0x20000000 to mkbootimg command-line.

    (Note: the console=null command line option was introduced in the TC4-RC30 boot images to remove the root shell (TODO: add link))

  7. Flashing your new image back onto the phone
    adb push ./mynewimage.img /sdcard
    (android shell) cat /dev/zero > /dev/mtd/mtd2
    write: No space left on device [this is ok, you can ignore]
    (android shell) flash_image boot /sdcard/boot-new.img
  8. Reboot
Reference:

沒有留言:

張貼留言