Compile android-hikey-linaro-4.1 & android 6.0


I was compile android-hikey-linaro-4.1 and android6.0 successfull for Hikey board. But I used fastboot with
$ sudo fastboot flash ptable ptable-aosp-8g.img (release by CE AOSP RPB HiKey 15.12 Build)
$ sudo fastboot flash boot boot_fat.uefi.img (compile by me.)
$ sudo fastboot flash cache cache.img (release by CE AOSP RPB HiKey 15.12 Build)
$ sudo fastboot flash system system.img (release by CE AOSP RPB HiKey 15.12 Build)
$ sudo fastboot flash userdata userdata.img (release by CE AOSP RPB HiKey 15.12 Build)

android cannot normal running. I found compile kernel link( It used kernel_config and KCFLAGS="-fno-pic", But I don’t known that how to used kernel_config.

I was compile android 6.0 cann’t create out/target/product/hikey folder. I was programed out/target/product/generic/system.img cache.img and userdata.img. But bootloader report these invalid formate.

I was copile android 6.0 with root user, it can create hikey folder but compile failed. Could you please give some advices?



Which toolchain did you use? Can you also list the specific commands you used for your builds?
Or you can refer to for guides on building the kernel and aosp.


Android toolchain is openjdk-7. Comamnd list:

repo init -u git clone -b android-6.0.0_r260
cd .repo/
git clone -b android-6.0 local_manifests
cd …/
repo sync -j16
Download and extract the Mali vendor binaries in the above directory:

source build/
lunch hikey-userdebug
make droidcore -j8
cd out/target/product/hikey

Do complie commands, only root user can created out/target/product/hikey and compile failed. Error report:

target C++: libdeqp <= external/deqp/modules/gles31/functional/es31fSSBOArrayLengthTests.cpp
target C++: libdeqp <= external/deqp/modules/gles31/functional/es31fSSBOLayoutCase.cpp
target C++: libdeqp <= external/deqp/modules/gles31/functional/es31fSSBOLayoutTests.cpp
target C++: libdeqp <= external/deqp/modules/gles31/functional/es31fStencilTexturingTests.cpp
target C++: libdeqp <= external/deqp/modules/gles31/functional/es31fSynchronizationTests.cpp
make: *** [out/target/product/hikey/obj/SHARED_LIBRARIES/libdeqp_intermediates/modules/gles3/functional/es3fShaderOperatorTests.o] Killed
make: *** Waiting for unfinished jobs…
make: *** [out/target/product/hikey/obj/SHARED_LIBRARIES/libdeqp_intermediates/modules/gles3/functional/es3fTextureSpecificationTests.o] Killed
make: *** [out/target/product/hikey/obj/SHARED_LIBRARIES/libdeqp_intermediates/modules/gles31/functional/es31fOpaqueTypeIndexingTests.o] Killed
make: *** [out/target/product/hikey/obj/SHARED_LIBRARIES/libdeqp_intermediates/modules/gles2/functional/es2fShaderStructTests.o] Killed
make: *** [out/target/product/hikey/obj/SHARED_LIBRARIES/libdeqp_intermediates/modules/gles3/functional/es3fShaderStructTests.o] Killed
make: *** [out/target/product/hikey/obj/SHARED_LIBRARIES/libdeqp_intermediates/modules/gles3/functional/es3fShaderTextureFunctionTests.o] Killed
make: *** [out/target/product/hikey/obj/SHARED_LIBRARIES/libdeqp_intermediates/modules/gles31/functional/es31fDebugTests.o] Killed
make: *** [out/target/product/hikey/obj/SHARED_LIBRARIES/libdeqp_intermediates/modules/gles31/functional/es31fGeometryShaderTests.o] Killed
make: *** [out/target/product/hikey/obj/SHARED_LIBRARIES/libdeqp_intermediates/modules/gles31/functional/es31fIntegerStateQueryTests.o] Killed
make: *** [out/target/product/hikey/obj/SHARED_LIBRARIES/libdeqp_intermediates/modules/gles31/functional/es31fPrimitiveBoundingBoxTests.o] Killed
make: *** [out/target/product/hikey/obj/SHARED_LIBRARIES/libdeqp_intermediates/modules/gles31/functional/es31fProgramInterfaceDefinitionUtil.o] Killed
make: *** [out/target/product/hikey/obj/SHARED_LIBRARIES/libdeqp_intermediates/modules/gles31/functional/es31fProgramInterfaceQueryTestCase.o] Killed

make failed to build some targets (05:47:29 (hh:mm:ss))



For building the kernel, you need to ensure that a prebuilt toolchain is in your path:

For the android build, I’m having trouble trying to reproduce the error. Are the instructions you pasted really the ones you used? They contain typos and are old/outdated. E.g. in “repo init -u git clone -b android-6.0.0_r260”, “git clone” should be removed, and “r260” should be “r26”. Also, does not exist anymore. How did you get past these to run your build? Did you not get any errors? Did you maybe downloaded all the sources and binaries some time ago?

I’d suggest trying the instructions below, but replace the branches with the versions you want as necessary.


I have same promble with the I was modified like the link. Android can compile successfull. But cannot running successfull.
Could you give me adives please? Thank you.

$repo init -u -b android-6.0.1_r10 -g “default,-device,hikey”
$ cd .repo/
$ git clone -b android-5.0 local_manifests(I was modify the linar.xml)
$ cd –
$ repo sync -j24
$ source build/
$ lunch hikey-userdebug
$ make -j32
$ cd out/target/product/hikey

linaro.xml is:
<?xml version=“1.0” encoding=“UTF-8”?>
<!-- Repositories -->
<!-- Linaro Repositories -->
<remote name="linaro-android"
review=“” />

<remote name=“github” fetch=“” />
<remote name=“linaro-other” fetch=“git://” />
<!-- Linaro Device Configs -->
<project path=“device/linaro/hikey” name=“android_device_linaro_hikey” revision=“android-6.0” remote=“github” groups=“device,hikey” />
<project path=“device/linaro/build” name=“device/linaro/common” revision=“linaro-lollipop-experimental” remote=“linaro-android” groups=“default” />
<project path=“android-patchsets” name=“android-patchsets” revision=“master” remote=“linaro-android” groups=“default” />

<!-- Linaro Kernels -->
<project path=“kernel/linaro/hisilicon” name=“linux” revision=“hikey” remote=“github” groups=“default” />

<project path=“packages/apps/UsbSpeedSwitch” name=“android_packages_apps_UsbSpeedSwitch” revision=“master” remote=“github” groups=“device,hikey” />

Is the xml file right? If not, could you give me a demo with android6.0? Thanks!


The android-5.0 branch might be a bit outdated since it uses 3.18 kernel. Can you try below? It has 4.1 kernel.

$repo init -u -b android-6.0.1_r10 -g “default,-device,hikey”
$ cd .repo/
$ git clone -b android-5.0 local_manifests
$ cd local_manifests
$ git checkout d3709bd0dab2d7a0f83f7d9e4bcd4c11a12ff13b
$ cd …/…/
$ repo sync -j24
$ source build/
$ lunch hikey-userdebug
$ make -j32
$ cd out/target/product/hikey

Again, all above won’t work without vendor.tar.bz2. Another option, if you can consider, is to rebuild your old apps for the latest aosp instead of rebuilding an old aosp for your app. It might be easier.


Hi again,

I asked a few Android experts and found a possibly better option for you.

Download and pinned-manifest.xml from and run:
$ ./ -m pinned-manifest.xml -o

This will build a 4.1 kernel + aosp 6.0 so hopefully it works for you.


I was do next command:
mkdir Hikey_1512
cd HiKey_1512
cp /share/* ./
./ -m pinned-manifest.xml -o

But have an error: ERROR: no source overlay provided. Please download from This must be done from a browser that accepts cookies.

So I download and copy the vendor to Hikey_1512 and do:
./ -m pinned-manifest.xml -o vendor.tar.bz2
have another error:

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here:

curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn’t adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you’d like to turn off curl’s verification of the certificate, use
the -k (or --insecure) option.

Above error, I think maybe need creat repo. But I can found download information in pinned-manifest.xml. Could you give me some advices? Thanks!


There’s a problem with the certificate on the system you’re on, not on the server’s end. Google the error for more info.

Easiest way out of this is as the above message indicated, use the -k option to curl, but just be aware that the cert will not verified and hence insecure.


I was retry the command
./ -m pinned-manifest.xml -o vendor.tar.bz2

But have a problem:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2959 0 2959 0 0 4125 0 --:–:-- --:–:-- --:–:-- 4126
./repo init -u git:// -b android-6.0.0_r26 -m default.xml --repo-url=git:// -g default,-device,-non-default,hikey
./repo: line 1: syntax error near unexpected token newline' ./repo: line 1:<!DOCTYPE html>’

Have people said that repo was not correct. Could you please give me some advices? Thanks!


Your copy of repo is corrupt. Ref:!topic/android-building/E5-fW7LmYiE
Seems like you have many network issues. Are you behind some kind of firewall?