How to compile kernel — part 1

Recently HTC released the kernel source for HTC Desire. Here’s how to compile the kernel source under Ubuntu:

  1. download and unpack source code
  2. install android SDK and NDK
  3. get kernel config from your device (adb pull /proc/config.gz; gunzip config.gz; mv config .config)
  4. put .config into the root directory where you unpacked kernel source
  5. run “make oldconfig”
  6. optionally, if you plan any changes, run “make menuconfig”
  7. run “make ARCH=arm CROSS_COMPILE=~/android-ndk-r4/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-”, where long and complicated path points to the actual directory where you installed NDK

Wait about 10-20 minutes. You should get the following mesage:

Kernel: arch/arm/boot/zImage is ready

, ,

  1. #1 by Kevin on November 29, 2010 - 16:04

    This guide sounds so simple I might be able to compile a kernel. Problem is I have a droid incredible. Do you have a droid kernel guide for the incredible?

  2. #2 by lenik on November 30, 2010 - 19:57

    the kernel compile for the droid incredible is almost the same, but you have to download the kernel source from Motorola, I suppose? everything else should work just fine.

Comments are closed.