Building an Android Donut ROM – Part 2 of 4
As already mentioned in Part 1, here’s the next part of our series ‘Building an Android Donut ROM. Again thanks to Chris Soyars.
After we complete this series, we will start with a new one, Building an Android Nexus One / Passion ROM. There will be lots of screenshots and maybe some videos. It will be a ‘work in progress’ as I have never built a ROM for my new baby yet. You will see all the errors I make (if any
) and I also count on you to point out stuff in the comments.
Get the Kernel Source
First, you need to download the kernel source. To continue on with the theme of building against Cyanogen’s repositories, we will check out his kernel source.
cd
git clone git://github.com/cyanogen/cm-kernel.git
This will take a while. Once the repository has cloned, simply do the following to create a local branch of theandrod-2.6.29-donut branch.
cd cm-kernel
git checkout -b mydonut origin/android-2.6.29-donut
Setting up the Environment
We need to set some environment variables to point to the ARM compiler which is included with the Android Source, as well as set our target architecture (ARM).
export CROSS_COMPILE=~/donut-build/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
export ARCH=arm
Next we need a kernel configuration. For your convenience, I’ve prepared one for you here. You need to save this as .config (notice the period before the word config) in your cm-kernel directory.
Building the Kernel
Ok, here is the fun part!
make -j2 oldconfig zImage
That’s it! Really, it’s that simple. The kernel will be located in arch/arm/boot/zImage. Don’t try to boot this kernel though, before we can do that we need to pack it into a boot.img along with a ramdisk.








