Build Configuration for the HTC Magic


A few days ago, I released build scripts that would allow developers to make images that target the T-Mobile MyTouch. I finally got a hold of a regular Magic (a Sapphire 32A) and have created a corresponding project to support building for this device. So, this will now work:

. build/
lunch htc_magic-eng

Please note the instructions regarding cherry-picking certain changes from Donut into your Android repository. The Sapphire 32A uses HTC’s kernel offsets in the boot.img, and not Google’s. Without those changes, your phone will not boot.


Casper Bang said...

Thanks Koushik! This should be handy, Looking forward to some more Android/Mono coverage. ;)

Shawn said...

Koushik rocks!!!

I say that assuming it's going to work on an Google IO device.

What about a radio image? I don't understand the branches of Android well. I'm in * default now, but what happens if say donut gets merged into this main branch. Then the images will need a new radio image won't they?

So basically this is good to go until that happens. Correct?

Also, any advice on how to manage GIT. I have some apks (Google Apps) and a Japanese IME that I want to roll into the system. Should I put them in a branch and then merge them into main. That way if I can experiment in the branches and clean out main as needed. Reasonable??? Sorry for an obvious question but I've never used GIT.

Anyway, I gotta go try your work. Thanks!!!!

Shawn said...

One trouble with cherry-pick

git cherry-pick 6ea3b8856d656752c0310ca237ed99e7451be83b
fatal: Dirty index: cannot cherry-pick

Is this ok --git cherry-pick -n 6ea3b8856d656752c0310ca237ed99e7451be83b
Finished one cherry-pick.

The -n option was specified as:


Usually the command automatically creates a commit. This flag applies the change necessary to cherry-pick the named commit to your working tree and the index, but does not make the commit. In addition, when this option is used, your index does not have to match the HEAD commit. The cherry-pick is done against the beginning state of your index.

This is useful when cherry-picking more than one commits' effect to your index in a row.

Koush said...

I think the Google IO device is a Sapphire 32B. I am unsure though. You can check in Fastboot. The MyTouch is a Sapphire 32B and the Rogers Magic I have is a Sapphire 32A. Use the appropriate project and build config (there are two).

Not sure why you can't run those git commands. Make sure you don't have any pending changes and have checked out a working branch. If you type git branch and it says "no branch", check out a branch with "git checkout -b master korg/cupcake".

You don't need the radio images as part of the build, and can apply them as separate updates. You can make them a part of your build if you want though by removing the NORADIOIMAGE flag on the make command. See the README.txt.

Shawn said...

One cherry-pick couldn't be found

git cherry-pick 67eacb9affe645dea23c753fcca0776c33a5eb2a

git cherry-pick 67eacb9affe645dea23c753fcca0776c33a5eb2a
fatal: Could not find 67eacb9affe645dea23c753fcca0776c33a5eb2a

What can I do?

Koush said...

Type "git fetch korg" in system/core to get the updates and then rerun the command. Make sure you are running the command in the proper git repo (system/core).

Also, I'd make sure that your Google IO device is a Sapphire 32B in fastboot before using the Magic build config.

Shawn said...

You are correct. Fastboot indicates the Google IO device is a Sapphire 32B.

Ok so I had the wrong repo then.

Also, I didn't have a working branch. I did (per the android docs) repo init -u git://

I'll try again

Shawn said...

Ok I used the myTouch repo and it's building now.

If you're ever in Tokyo and have any questions...

ambient-morality said...

Oops, I am getting this error while flashing
E:Failure at line 2
assert getprop("ro.product.device" == "mytouch-open" || getprop("") == "mytouch-open"
Installation aborted
Any ideas? (I did 'git init ... -b cupcake' of android branch)

Koush said...

Start the phone in fastboot and flash the recovery first.

fastboot flash recovery recovery.img

ambient-morality said...

Thanks, everything is working now!

ambient-morality said...

Oops wait...Home button and Search button don't work on a fresh cupcake build. adb logcat produces no output when I press them. Any ideas?

ambient-morality said...

Sorry, posted this in the wrong place. Since I am using tmobile mytouch my questions should have gone to your other post.

Jens said...

Hi K! ... Great work! ...

Have questions. Might be very idiotic as I am very new to hacking Android. Anyways here is my question: I want to use Donut/1.6 on my HTC Magic, 32A (As I read your post its based on Cupcake/1.5, right?) ... You have a how-to for doing that?

You rock!