How to build the android mainline kernels for the hikey960 hikey x15 boards - liuyq/android-issues GitHub Wiki
repo sync the android-mainline source
based on the Android Building Kernels instructions
$ mkdir android-kernel && cd android-kernel
# Mirror could be used, like
# repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/kernel/manifest -b common-android-mainline
$ repo init -u https://android.googlesource.com/kernel/manifest -b common-android-mainline
$ repo sync ${nproc}
git clone the hikey960 external modules repository
## For hikey960
$ git clone -b android-mainline-linaro https://android-git.linaro.org/git/kernel/hikey-modules hikey-modules-linaro/hikey960/android-mainline
## For hikey
$ git clone -b android-mainline-hikey https://android-git.linaro.org/git/kernel/hikey-modules hikey-modules-linaro/hikey/android-mainline
## For x15
$ git clone -b android-mainline https://android-git.linaro.org/git/kernel/omap-modules omap-modules/android-mainline
apply out of tree patches
## For hikey960
$ cd common && ../hikey-modules-linaro/hikey960/android-mainline/patchsets/apply.sh && cd -
## For hikey
$ cd common && ../hikey-modules-linaro/hikey/android-mainline/patchsets/apply.sh && cd -
## For X15
$ cd common && ../omap-modules/android-mainline/patchsets/apply.sh && cd -
building the kernel
## For hikey960
$ tools/bazel run --config=release //hikey-modules-linaro/hikey960/android-mainline:hikey960_dist -- --dist_dir=${ABS_DIR_ROOT}/out/lkft-hikey960-aosp-master-mainline-gki/vendor-kernel/dist
## For hikey
$ tools/bazel run --config=release //hikey-modules-linaro/hikey/android-mainline:hikey_dist -- --dist_dir=${ABS_DIR_ROOT}/out/lkft-hikey-aosp-master-mainline-gki/vendor-kernel/dist
## For X15
$ tools/bazel run --config=release //omap-modules/android-mainline:x15_dist -- --dist_dir=${ABS_DIR_ROOT}/out/lkft-x15-aosp-master-mainline/vendor-kernel/dist
## For hikey960
$ BUILD_CONFIG=hikey-modules-linaro/hikey960/android-mainline/build.config.hikey960 build/build.sh
## For hikey
$ BUILD_CONFIG=hikey-modules-linaro/hikey/android-mainline/build.config.hikey build/build.sh
## For X15
$ BUILD_CONFIG=omap-modules/android-mainline/build.config.x15 build/build.sh
# the out directory could be specified via the environment variable of OUT_DIR, like
# OUT_DIR=out/hikey960-mainline BUILD_CONFIG=hikey-modules-linaro/hikey960/android-mainline/build.config.hikey960 build/build.sh
artifacts path
you could find the kernel/dtb/ko files under the following directory
$ ll out/android-mainline/dist/Image.gz out/android-mainline/dist/hi3660-hikey960.dtb
-rw-rw-r-- 1 liuyq liuyq 16737946 Feb 1 11:10 out/android-mainline/dist/Image.gz
-rw-rw-r-- 1 liuyq liuyq 46744 Feb 1 11:07 out/android-mainline/dist/hi3660-hikey960.dtb
$