Aosp build failing for hikey970

Hi All,

I am following instructions here to build kernel and aosp for hikey970.

The kernel build goes through fine.

However the aosp build fails, here’s a snippet from the log.

`[ 33% 29428/87941] build out/target/product/hikey960/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallow
FAILED: out/target/product/hikey960/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows
/bin/bash -c “(rm -f out/target/product/hikey960/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/hikey960/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows out/target/product/hikey960/obj/ETC/sepolicy_neverallows_intermediates/policy.conf )”
device/linaro/hikey/sepolicy/hostapd.te:4:ERROR ‘unknown type hostapd’ at token ‘;’ on line 48127:

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

typeattribute hostapd data_between_core_and_vendor_violators;
checkpolicy: error(s) encountered while parsing configuration`

Has someone managed to solve this, if so can you post a solution?

Thanks

I have the same problem.

device/linaro/hikey/sepolicy/hostapd.te:4:ERROR 'unknown type hostapd' at token ';' on line 48342:
typeattribute hostapd data_between_core_and_vendor_violators;

I have seen this problem reported but no fix posted.

I would really like a fix for this.

I am having a lot of problems with both the 960 and 970 boards.

First I am not an expert but i will share with you what i have figured out so far.
I also got the error

It is related more to:
[ 34% 29615/85754] build out/target/product/hikey970/obj/ETC/sepolicy_neverallo
FAILED: out/target/product/hikey970/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows

Specifically:
device/linaro/hikey/sepolicy/hostapd.te:4:ERROR

I found a similar issue occurred in the past with the dragonboard.
https://android-git.linaro.org/device/linaro/dragonboard410c.git/commit/?h=dragonboard&id=dbe30cae1ef227860089e1840aeb1cd140c0003a

I modified the following files in the aosp tree as noted in the above mentioned thread.

/AOSP/device/linaro/hikey/sepolicy/hostapd.te

/AOSP/device/linaro/hikey/manifest.xml

I did not find the file sepolicy/vendor_init.te as mentioned above.
I tried to build with only the hostapd.te and manifest.xml changes and still had error.

I’m not sure if this is 100% correct to do but i modified /AOSP-HK970/device/linaro/hikey/device-common.mk as follows. (removed hostapd)

Original

Add wifi-related packages

PRODUCT_PACKAGES += libwpa_client wpa_supplicant hostapd wificond wifilogd
PRODUCT_PROPERTY_OVERRIDES += wifi.interface=wlan0
wifi.supplicant_scan_interval=15

Changed

Add wifi-related packages

PRODUCT_PACKAGES += libwpa_client wpa_supplicant wificond wifilogd
PRODUCT_PROPERTY_OVERRIDES += wifi.interface=wlan0
wifi.supplicant_scan_interval=15

Obviously this will not build hostapd.
I believe that it is depreciated now but hostapd may need to be replaced by something else.

After those changes the AOSP build is susscessful.
Be sure to make clean so that the changes are picked up.

Please note that I Pre-Built the kernel as defined here.

After building the kernel i continued to build the entire AOSP.

Its a start anyway. I cannot test if boot is successful until later today.