Hikey960 kernel for AOSP specific version build

Need to build an Hikey960 kernel specific version for your AOSP image?Follow these steps and you’ll learn how…

Hikey960 kernel

Kernel build instructions for the Hikey960 are available in file device/linaro/hikey/hikey960/README, explaining how to build latest commit for a specific branch.

However, sometimes it could be needed to build a specific version, for example the one available in a pre-built image.

In order to do so, the first step is to identify which commit has been used for that specific kernel image. This piece information is available in the kernel output during loading, flowing from the debug UART:

[    0.000000] Linux version 4.9.124-g96a73cde6d81
([email protected]) (Android (4679922 based on
r326829) clang version 7.0.1
(https://android.googlesource.com/toolchain/clang
32fb8450f65708b63c9a35046b2d
1ee775e08733) (https://android.googlesource.com/toolchain/llvm
67f3e6a51d93777841e0fb6d07f71fdf343df239) (based on LLVM 7.0.1svn)) #1
SMP PREEMPT Fri Aug 31 17:51:27 UTC 2018

We now know the needed version (4.9.124-g96a73cde6d81): to build that kernel follow the instructions in the above mentioned file and, instead of checking-out the suggested branch, check-out the desired commit, e.g.

git checkout hikey-4.9.124-g96a73cde6d81

Then continue following the instructions to build the kernel as usual.

Note that, according to the chosen kernel version, you could need to
change also the HDMI binaries.