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.

8 thoughts on “How to compile the HTC Hero kernel

  1. Jamie

    I get an error
    No rule to make target `drivers/usb/function/projector.o` needed by `drivers/usb/function/built-in.o`

    Any idea?

  2. Jamie

    so I went through the .config and changed the projector line to N… now it looks like it’s going to finish, but I get “arm-eabi-ld: no machine record defined” on “make: *** [.tmp_vmlinux1] Error 1″

    Any ideas?

  3. admin

    I think it has all to do with the config, witch one did you use? You could try out the ‘lox’s’ idea that he gave you on xda form, “make msm7200a_defconfig”. Let me hear if you find out what is bugging you.

  4. Agree

    I get an error
    No rule to make target `net/netfilter/xt_MARK.o’, needed by `net/netfilter/built-in.o’
    Any ideas?

  5. Pingback: HOWTO: Compiling TUN/TAP Driver for atrix (Atrix ATT / 4.5.91) | UPUPDD

Comments are closed.