Android Factory image's source code for hikey970


I was building from source for aosp for hikey970, following Build AOSP on HiKey970 - 96Boards
It has currrently build issues:

[100% 919/919] writing build rules …
build/make/core/Makefile:28: error: overriding commands for target `out/target/product/hikey970/system/vendor/lib/’, previously defined at build/make/core/

Meanwhile, if the source code is avaiable for the factory image(Android Open Source Project (AOSP) Downloads for HiKey970 - 96Boards), it would do much of a help.

Board based on the Kirin 970 - HI3670 Application Processor
More info: (Website coming soon…)
Buy now:

I am also encountering same issue:
build/make/core/Makefile:28: error: overriding commands for target `out/target/product/hikey970/system/vendor/lib/’, previously defined at build/make/core/

It looks like several other folks have run into this too.
Anyone found a solution yet ?

I found a newer version of that fixed the problem.
Now I am not able to find “arch/arm64/boot/dts/hisilicon/kirin970-hikey970.dtb” . Looks like it is not getting cloned.

Great news!!!
is the updated over the repo?
Update: I synced the source code again. it got ahead of that point. :slight_smile:

Now I am not able to find “arch/arm64/boot/dts/hisilicon/kirin970-hikey970.dtb” . Looks like it is not getting cloned.

→ faced the similar issue. I built it from kernel source and generated the kernel image and dtb. renamed accordingly and pasted in the device folder which was asking the files.I have built the hisilicon/kirin970-hikey970.dtb from this code: (branch: hikey970-v4.9). this was from the build from source help on hikey 970 linux website(Build & Update Linux kernel on HiKey970 - 96Boards)


The build still fails.
The latest fail logs :
[ 31% 27299/85922] build out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/reqd_policy_mask.cil
out/host/linux-x86/bin/checkpolicy: loading policy configuration from out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/reqd_policy_mask.conf
out/host/linux-x86/bin/checkpolicy: policy configuration loaded
out/host/linux-x86/bin/checkpolicy: writing CIL to out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/reqd_policy_mask.cil
[ 31% 27302/85922] build out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows
FAILED: out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows
/bin/bash -c “(rm -f out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows ) && (ASAN_OPTIONS=detect_leaks=0 out/host/linux-x86/bin/checkpolicy -M -c 30 -o out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/policy.conf )”
device/linaro/hikey/sepolicy/hostapd.te:4:ERROR ‘unknown type hostapd’ at token ‘;’ on line 45508:
typeattribute hostapd data_between_core_and_vendor_violators;

hostapd no longer directly accesses /data outside /data/vendor.

checkpolicy: error(s) encountered while parsing configuration
out/host/linux-x86/bin/checkpolicy: loading policy configuration from out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/policy.conf
[ 31% 27304/85922] build out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/plat_pub_policy.cil
out/host/linux-x86/bin/checkpolicy: loading policy configuration from out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/plat_pub_policy.conf
out/host/linux-x86/bin/checkpolicy: policy configuration loaded
out/host/linux-x86/bin/checkpolicy: writing CIL to out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/plat_pub_policy.cil.tmp
14:54:50 ninja failed with: exit status 1

failed to build some targets (19:43 (mm:ss))

Yup I have the same issue…


Disabling the hostpad worked for me.

sdash@lsv03011:~/work/hikey970/aosp_hikey970$ repo status
project device/linaro/hikey/ (*** NO BRANCH )
-m sepolicy/hostapd.te
project device/linaro/hikey-kernel/ (
– Image.gz-hikey970-4.9
– kirin970-hikey970.dtb-4.9
sdash@lsv03011:~/work/hikey970/aosp_hikey970$ repo forall -pc “git diff”

project device/linaro/hikey/
diff --git a/sepolicy/hostapd.te b/sepolicy/hostapd.te
index 86b985a…e8cc042 100644
— a/sepolicy/hostapd.te
+++ b/sepolicy/hostapd.te
@@ -1,11 +1,11 @@

TODO(b/36657258): Remove data_between_core_and_vendor_violators once

hostapd no longer directly accesses /data outside /data/vendor.

-typeattribute hostapd data_between_core_and_vendor_violators;
+###typeattribute hostapd data_between_core_and_vendor_violators;

hostapd can read and write WiFi related data and configuration.

-allow hostapd wifi_data_file:file rw_file_perms;
-r_dir_file(hostapd, wifi_data_file)
+###never allow hostapd wifi_data_file:file rw_file_perms;
+###r_dir_file(hostapd, wifi_data_file)

hostapd wants to create the directory holding its control socket.

-allow hostapd hostapd_socket:dir create_dir_perms;
+###allow hostapd hostapd_socket:dir create_dir_perms;

hostapd needs to create, bind to, read, and write its control socket.

-allow hostapd hostapd_socket:sock_file create_file_perms;
+###allow hostapd hostapd_socket:sock_file create_file_perms;

1 Like

After the above changes in the android source code, did the board boot?

I made the same changes, now the board is in boot loop with the below message:

[ 5.921064] init: Loading SELinux policy
[ 5.924997] selinux: SELinux: Could not open /sepolicy: No such file or directory
[ 5.924997]
[ 5.934147] kvm: exiting hardware virtualization
[ 5.938988] hifi_misc [I][361283]:hifi_reboot_notifier:1378: reboot +.
[ 5.945521] hifi_misc [I][361497]:hifi_reboot_notifier:1387: reboot -.
[ 5.953375] sd 0:0:0:3: [sdd] Synchronizing SCSI cache
[ 5.959650] sd 0:0:0:2: [sdc] Synchronizing SCSI cache
[ 5.965979] sd 0:0:0:1: [sdb] Synchronizing SCSI cache
[ 5.972305] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 6.142039] reboot: Restarting system with command ‘bootloader’
[MR BYPASS] 0x00000000
secdbg not DCU.
SecDbgVer exit

xloader chipid: 0x36701100, start: 412ms.
Build Date: Mar 16 2018, 11:00:12


For me its compile success, disabled the wifi , with the above code. But the board boot up is not successful yet. :frowning:

Hi ! Same problem here. Hostapd issue. I didn’t understand how do you build without it, can you explain it please ?

The same issue still exists.

I have the same problem now, have you fixed it?