Take our usability survey to improve this site.

Building Kernels Manually

This section applies to kernels that aren't enabled for building with Repo. In particular, this table lists the name and locations of kernel sources and binaries to build manually.

Device Binary location in AOSP tree Source location Build configuration
easel N/A kernel/arm64 mnh_prod_defconfig
angler device/huawei/angler-kernel kernel/msm angler_defconfig
bullhead device/lge/bullhead-kernel kernel/msm bullhead_defconfig
shamu device/moto/shamu-kernel kernel/msm shamu_defconfig
fugu device/asus/fugu-kernel kernel/x86_64 fugu_defconfig
volantis device/htc/flounder-kernel kernel/tegra flounder_defconfig
hammerhead device/lge/hammerhead-kernel kernel/msm hammerhead_defconfig
flo device/asus/flo-kernel/kernel kernel/msm flo_defconfig
deb device/asus/flo-kernel/kernel kernel/msm flo_defconfig
manta device/samsung/manta/kernel kernel/exynos manta_defconfig
mako device/lge/mako-kernel/kernel kernel/msm mako_defconfig
grouper device/asus/grouper/kernel kernel/tegra tegra3_android_defconfig
tilapia device/asus/grouper/kernel kernel/tegra tegra3_android_defconfig
maguro device/samsung/tuna/kernel kernel/omap tuna_defconfig
toro device/samsung/tuna/kernel kernel/omap tuna_defconfig
panda device/ti/panda/kernel kernel/omap panda_defconfig
stingray device/moto/wingray/kernel kernel/tegra stingray_defconfig
wingray device/moto/wingray/kernel kernel/tegra stingray_defconfig
crespo device/samsung/crespo/kernel kernel/samsung herring_defconfig
crespo4g device/samsung/crespo/kernel kernel/samsung herring_defconfig

Downloading sources

Download the source for the kernel you want to build using the appropriate git clone command. For example, the following command clones the hikey kernel, used for the HiKey reference boards:

git clone https://android.googlesource.com/kernel/hikey-linaro

A full list of kernel projects can be found in the kernel directory. Below are some of the commonly used kernels and their respective git clone commands.

The exynos project has the kernel sources for Nexus 10, and can be used as a starting point for work on Samsung Exynos chipsets.

git clone https://android.googlesource.com/kernel/exynos

The goldfish project contains the kernel sources for the emulated platforms.

git clone https://android.googlesource.com/kernel/goldfish

The hikey-linaro project is used for HiKey reference boards, and can be used as a starting point for work on HiSilicon 620 chipsets.

git clone https://android.googlesource.com/kernel/hikey-linaro

The msm project has the sources for ADP1, ADP2, Nexus One, Nexus 4, Nexus 5, Nexus 6, Nexus 5X, Nexus 6P, Nexus 7 (2013), Pixel, and Pixel XL, and can be used as a starting point for work on Qualcomm MSM chipsets.

git clone https://android.googlesource.com/kernel/msm

The omap project is used for PandaBoard and Galaxy Nexus, and can be used as a starting point for work on TI OMAP chipsets.

git clone https://android.googlesource.com/kernel/omap

The samsung project is used for Nexus S, and can be used as a starting point for work on Samsung Hummingbird chipsets.

git clone https://android.googlesource.com/kernel/samsung

The tegra project is for Xoom, Nexus 7 (2012), and Nexus 9, and can be used as a starting point for work on NVIDIA Tegra chipsets.

git clone https://android.googlesource.com/kernel/tegra

The x86_64 project has the kernel sources for Nexus Player, and can be used as a starting point for work on Intel x86_64 chipsets.

git clone https://android.googlesource.com/kernel/x86_64

Building the kernel

If you don't intend to build the default branch (for example, master), you need to check out the desired commit before building. See Identifying kernel versions for how to identify the kernel version of a prebuilt kernel binary. Now you're ready to build the kernel. The following build commands use the hikey kernel:

cd hikey-linaro
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-android-
make hikey_defconfig

To build a different kernel, simply replace hikey-linaro with the name of the kernel you want to build and hikey_defconfig with the name of the corresponding defconfig file.

The image outputs to the arch/arm64/boot/ directory; the kernel binary outputs to the arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb file. Follow the instructions in Running the kernel for how to embedd the freshly built kernel into your AOSP image.