内核源码下载(在天朝因为有gfw,即便vpn速度也很慢,所以还是使用国内镜像速度快)
下面依一个是中科大的一个是清华的
git clone git://mirrors.ustc.edu.cn/aosp/kernel/msm.git
git clone git://aosp.tuna.tsinghua.edu.cn/android/kernel/msm.git
下载完成后使用下面命令查看所有分支
git branch -a
切换到你需要的分支,下面只是个范例
$ git checkout -b android-hikey-linaro-4.1 origin/android-hikey-linaro-4.1
编译内核,这里采用android源码的prebuild的gcc,如果用我自己系统的gcc根本无法编译
export PATH=/media/zmy/LinuxSource/CMAndroid/_android-6.0.0_r1/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin:$PATH
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-eabi-
make shamu_defconfig
make -j8
附注:
nexus的android不同机器对应的版本
$ git clone https://android.googlesource.com/kernel/common.git
$ git clone https://android.googlesource.com/kernel/hikey-linaro
$ git clone https://android.googlesource.com/kernel/x86_64.git
$ git clone https://android.googlesource.com/kernel/exynos.git
$ git clone https://android.googlesource.com/kernel/goldfish.git
$ git clone https://android.googlesource.com/kernel/msm.git
$ git clone https://android.googlesource.com/kernel/omap.git
$ git clone https://android.googlesource.com/kernel/samsung.git
$ git clone https://android.googlesource.com/kernel/tegra.git
The goldfish project contains the kernel sources for the emulated platforms.
The msm project has the sources for ADP1, ADP2, Nexus One, Nexus 4, Nexus 5, Nexus 6, Nexus 5X, Nexus 6P, Nexus 7 (2013), and can be used as a starting point for work on Qualcomm MSM chipsets.
The omap project is used for PandaBoard and Galaxy Nexus, and can be used as a starting point for work on TI OMAP chipsets.
The samsung project is used for Nexus S, and can be used as a starting point for work on Samsung Hummingbird chipsets.
The tegra project is for Xoom, Nexus 7 (2012), Nexus 9, and can be used as a starting point for work on NVIDIA Tegra chipsets.
The exynos project has the kernel sources for Nexus 10, and can be used as a starting point for work on Samsung Exynos chipsets.
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.
The hikey-linaro project is used for HiKey reference boards, and can be used as a starting point for work on HiSilicon 620 chipsets.