Thursday, July 7, 2011

Compiling custom kernel modules for HTC Evo 2.3.3 Gingerbread

Some of my current research on Android forensics and security requires the loading of custom kernel modules.  In my previous post I detailed the steps required to compile and load custom modules on a rooted phone.  I recently updated my rooted Evo to Android 2.3.3 Gingerbread and was frustrated to see that HTC has yet to release the updated kernel source code.

Using an adb shell I can see that the phone is running linux kernel
joe@zuul:~$ adb shell
# uname -a
Linux localhost #1 PREEMPT Tue Jun 14 23:58:32 CST 2011 armv7l GNU/Linux
Luckily, HTC has released the Gingerbread kernel source for another phone, the Desire HD, which runs the same kernel version.  Assuming that the the kernels from the two phones would be very similar, I tried my hand at compiling the module for my Evo with the Desire HD source.  It worked!

To compile a kernel module for the Evo with the Desire HD kernel source requires a few extra steps:

  • Download and unpack the Desire HD source code.
  • Modify Makefile at the root of the source.  Change line 4 to read: EXTRAVERSION = .10-gc0a661b
  • Follow the steps outlined in my previous post to export the config from the Evo, prepare the kernel sources, and compile the custom module
These steps worked for my phone and my module, but your mileage may vary.  It is unlikely that the kernels running on the two phones are identical, but hopefully the sources are similar enough to allow the functionality of your custom modules to work.  Of course HTC will eventually release the official kernel sources for the Evo 4G, but it's anyone's guess when that will be.

UPDATE (8/9/11):// HTC has released the EVO 2.3.3 GB Kernel sources.  See this post for details.

1 comment:

  1. Woot! Nice blog dude, some of it goes way over my head, but if I ever delve into the wonderful world of exploits, building kernels, and other craziness, I will take a second look at this blog! Keep it up!