How to compile Android kernel reference official documentation: https://source.android.com/source/building-kernels.html Android on Ubuntu 14.04 Kernel also did not encounter any difficult problems. The main points are as follows: First look at the CPU model of emulator: ADB shell[email protected]:/# Cat/proc/cpuinfo
Processor:ARMv7 Processor Rev 0 (v7l)
bogomips:378.47
FEATURES:SWP half thumb fastmult vfp edsp neon Vfpv3 TLS
CPU implementer:0x41
CPU Architecture:7
CPU variant:0x0
CPU PART:0XC08
CPU revision:0
Hardware:goldfish
revision:0000
serial:0000000000000000 1, download Android kernel source code:/data/data/android$ mkdir kernel/data/data/android$ CD kernel/data/data/ android/kernel$ git clone https://android.googlesource.com/kernel/goldfish.git/data/data/android/kernel/goldfish$ git branch-a/data/data/android/kernel/goldfish$ git checkout-b android-goldfish-3.4 remotes/origin/ android-goldfish-3.4 2, SET environment variables:
/data/data/Android/kernel/goldfish$ export ARCH=arm
/data/data/Android/kernel/goldfish$ export SUBARCH=arm
/data/data/Android/kernel/goldfish$ export CROSS_COMPILE=arm-eabi-3. Add the cross-compilation tool to the PATH:/data/data/android/kernel/goldfish$ export path= $PATH:/data/data/android/prebuilts/gcc/ Linux-x86/arm/arm-eabi-4.6/bin 4, modify the hardware configuration file Goldfish_defconfig (Note: Arm V5 is goldfish_defconfig, arm V7 is goldfish_armv7_ Defconfig):/data/data/android/kernel/goldfish$Make goldfish_armv7_defconfig5. Perform compilation:/data/data/android/kernel/goldfish$ make 6, compile successfully: Objcopy arch/arm/boot/zimage
Kernel:arch/arm/boot/zimage are ready note: The red place is especially important to note that the two need to be consistent, otherwise it will cause the emulator to always be black screen! How to let the simulator use compiled kernel, refer to another piece of article: http://www.cnblogs.com/tanlon/p/4279157.html
Original Ubuntu 14.04 compiled Android Kernel