Building Firmware... Not for the Infirm...

A project I’m working on requires the use of a custom firmware image, so I’ve been exposed to the joy that is trying to build and use the open source version of Android, and to be honest it’s left me a little battered.

If you’re on an ADP1, and you’re just looking to build a 1.6 firmware, you’re in for a smooth ride. JBQ and his helpers did a fantastic job and created some easy to follow instructions which you can use to build a firmware image from the donut-plus-aosp branch of the central android repository. The first prototype of the project used this build and a working firmware was created in a matter of hours (once the necessary custom components were available)

Unfortunately 1.6 is no longer in with the in crowd, and so the next version had to run on a Nexus 1 under Android 2.1. This is where I hit the first snag; the AOSP build project seems to have stopped at 1.6, which means that there are no instructions for building a firmware for the Nexus 1 using just the central Android repository.

So the next thing I did is turn to the website of the legend that is Cyanogen. If you hunt through the sites wiki you can find a set of build instructions which allow you to build his Android distribution from his repository.

Great…. or so I though.¬†Unfortunately the build didn’t go so well. First off I had a warning about a change in the API, not good, but as this was still a proof-of-concept version, so I worked around it by updating the API profile, and got a fastbootable image. (Yes, before you say it; I know updating the API profile is something you should never do, but this is a proof-of-concept firmware with a very very very limited distribution).

Once I had my fresh shiny boot, recovery, and system images I used fastboot to put them onto the N1 and, to my joy, it booted and did what I expected. Then I pressed the home key and the shine went off my new images. The press registered because the ‘phone vibrated, but it didn’t actually do anything, so it was more of a “vibrate the phone” soft button than a “take me to the home screen button”.

So I went back to cyanogens repository to check what build of his code I had the source for, but, unfortunately it doesn’t seem to have any tags for versions, so if you want the eclair build you get the latest eclair build and I couldn’t find any way of making sure that I had to code for, say, his last stable build, so that was a dead end. (Don’t get me wrong, Cyanogen has done a fastastic job in getting as far as he has, and yes I have donated, but unfortunately I needed ¬†a stable build).

The end result; well, I’m not happy with it, but I ended up getting the Cyanogen mod file, grafting in the components I needed to add from my local build, then re-zipping it, re-signing it, and installing it using the recovery image built from his tree.

This does what I need for now, but hopefully, some time in the not too distant future, I the Eclair / Nexus 1 build will be as easy as the donut / dream build is at the moment.