How to compile the HTC Hero kernel

I don’t know how many people watch the news about the sources around the HTC but couple days ago HTC released there kernel sources for the Hero phone. I though it would be nice to see if I can get it to compile.

As you may have guest I did manage to compile the kernel. Here you can find the steps how to do so your self. You can follow the manual way, if you have used my script for building your workspace then you can use these two new scripts to get and compile the scripts or you can take the scripts and modify them to work in your environment.

So lets start, first of we need to get the kernel and extract it in our repo, (~/mydroid or ~/myandroid):

wget http://member.america.htc.com/download/RomCode/Source_and_Binaries/kernel_hero_0078c992.tar.bz2
tar xvjf kernel_hero_0078c992.tar.bz2
rm -rf kernel_hero_0078c992.tar.bz2

Before we can try to compile the kernel we need to get the config file from our device, this is how we do that:

adb pull /proc/config.gz .
gunzip config.gz
mv config .config

Make sure your .config file is in the root of ~/myandroid/kernel-hero

If you are using my script you don’t need to do this because I already have provided the config settings inside the script.

Now that we have prepared all that we have to try to compile it, to do so we have to follow these steps:

cd ~/myandroid/kernel-hero
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/myandroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
make

If all goes well the kernel should compile. You can find the compiled kernel at ~/myandroid/arch/arm/boot/zImage
I have not tested this kernel yet, but I will try to do so soon. When I test the kernel I will post an update.

You can download my scripts getHtcHeroKernelSources and compileHtcHeroKernel.