I have made some modification in the android source codes recompile sources and now I have system.img, but I don't know how I can install that image on Android Phone. Have anybody do something similar ? Can anybody provide me some links or information how I can do that ? I am using HTC Amaze Phone.
1 Answer
If you have a fastboot-enabled bootloader then it should be pretty simple. Just put the system.img file somewhere on your PC, connect your device via a USB cable, reboot into your bootloader's fastboot mode and then:
fastboot flash system /path/to/system.img
If you don't have fastboot then you'll have to jump through some more hoops. One option would be to use something like unyaffs to extract the contents of the system.img (if it's an ext2/3/4 filesystem then just mount it) and then package it up as a zip file that can be installed from a custom recovery. There are some tutorials floating around that explain the syntax of the installer script file, but the easiest way to figure it out would probably be to download a custom ROM for your device, unzip it, and look at the updater-script file (should be META-INF/com/google/android/updater-script
in the archive).
You may also be able to get away with simply using dd
on the device, though I'd be careful if you decide to try it, and make sure you're booted into recovery:
adb push system.img /sdcard/
adb shell
dd if=/sdcard/system.img of=/your/system/partition
Alternatively, you can often build the source so that it creates a zip file instead of raw images, then install the zip from recovery. I'd suggest checking to see see if you have something like make otapackage
available to you.
-
♦ I have run
fastboot flash system /path/to/system.img
command and it successful install system.img on my phone HTC Amaze but when I try to switch it on, only HTC screen come up and my phone do not turn on :((( Can you help me. May 2, 2012 at 12:41 -
@ViToBrothersApoyan: There's a lot of reasons that could be happening, unfortunately. Where did you get the source code from? If it isn't from HTC then you may be missing necessary proprietary drivers to get the device to boot. May 2, 2012 at 13:26
-
♦ no I get that sources from Android official site source.android.com/source/initializing.html May 2, 2012 at 13:53
-
1@ViToBrothersApoyan: The best method is probably to grab a custom recovery image (like ClockworkMod) and flash it from fastboot:
fastboot flash recovery /path/to/recovery.img
. Then you can use that to make a backup and/or flash a ROM of your choice. Flashing a new ROM should get your device into a bootable state, and you can get ROMs from XDA. May 2, 2012 at 14:14 -
1@ViToBrothersApoyan: Download the appropriate recovery image for your device. There are links for a bunch of different devices on the page I linked to. Then boot into that recovery image, copy the zip file onto your phone, and use the recovery to install the zip file. May 2, 2012 at 19:11