1. Download Kernel Source
Study:
1. Refer to the AOSP official kernel download Address:
Http://source.android.com/source/building-kernels.html
2. Goto https://android.googlesource.com/kernel/msm.git Check which branch your would get,
For Secure Phone Checkout ANDROID-MSM-HAMMERHEAD-3.4-KITKAT-MR1 version
Commands
$ git clone https://android.googlesource.com/kernel/msm.git Hammerhead-kernel
$ CD Hammerhead-kernel
$ git checkout android-msm-hammerhead-3.4-kitkat-mr1
2. Build Kernel
$ CD $ (Aosp_path)
$ . build/envsetup.sh
$ lunch 12
$ Export Arch=arm
$ Export Subarch=arm
$ Export cross_compile=arm-eabi-
$ CD Hammerhead-kernel
$ make Hammerhead_defconfig
$ make
3. Verify Kernel
CP $ (KERNEL) ARCH/ARM/BOOT/ZIMAG-DTB (android_root) Out/target/product/hammerhead/kernel
Out/host/linux-x86/bin/mkbootimg--kernel Out/target/product/hammerhead/kernel--ramdisk out/target/product/ Hammerhead/ramdisk.img--cmdline "Console=ttyhsl0,115200,n8 androidboot.hardware=hammerhead user_debug=31 maxcpus=2 Msm_watchdog_v2.enable=1 "--base 0x00000000--pagesize 2048--ramdisk_offset 0x02900000--tags_offset 0x02700000-- Output out/target/product/hammerhead/boot.img
adb shell su 0 reboot bootloader
FastBoot Flash Boot out/target/product/hammerhead/boot.img
FastBoot reboot
How to download Android kernel kernel source code, compile burn write verification