Skip to content

Compiling Instruction

nanikjava edited this page Jan 28, 2013 · 6 revisions

My recommended approach in compiling the kernel is to checkout Google's Android code as it contains the compiler along with several utilities that are useful, the instruction to download and compile the Android source code can be found here http://source.android.com/source/index.html

The compiler used in this project can be found in Android source code repo, which normally resides inside in the prebuilt/ directory - for example when you check out the android-4.2.1_r1 branch from Android repo you will find the compiler resides in the prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/ directory.

Steps to compile the kernel

  • Use the following command inside the kernel directory

make ARCH=arm CROSS_COMPILE=/media/Seagate/Data/Android/AOSP/JellyBean/android-4.1.2_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- goldfish_armv7_defconfig

in my case my Android resides in /media/Seagate/Data/Android/AOSP/JellyBean/android-4.1.2_r1 directory, the instruction above will create the .config file using the Goldfish machine definition that has been provided called goldfish_armv7_defconfig

  • On completion of step 1 do the full compilation using the following command

make ARCH=arm CROSS_COMPILE=/media/Seagate/Data/Android/AOSP/JellyBean/android-4.1.2_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- -j2

  • Once the compilation completes you will get a file called zImage inside the arch/arm/boot directory. This is the file that you will use to boot Android with

  • To instruct the emulator to use the new kernel you need to use the following command

emulator -verbose -show-kernel -kernel /arch/arm/boot/zImage

Clone this wiki locally