kdrag0n/adevtool

Error during AOSP build after adding adevtool-extracted blobs

ConradGyllenhaal opened this issue · 2 comments

Hello there,

I'm trying to compile AOSP branch android-12.1.0_r7 for sunfish (Pixel 4a) device.

After using adevtool to extract the blobs (and put under vendor/google_devices) I encounter errors about sepolicy during the build, that stop it.

Here they are:

[ 51% 75020/144890] build out/target/product/sunfish/obj/ETC/sepolicy.recovery_intermediates/sepolicy
FAILED: out/target/product/sunfish/obj/ETC/sepolicy.recovery_intermediates/sepolicy
/bin/bash -c "(ASAN_OPTIONS=detect_leaks=0 out/host/linux-x86/bin/checkpolicy -M -c             30 -o out/target/product/sunfish/obj/ETC/sepolicy.recovery_intermediates/sepolicy.tmp out/target/product/sunfish/obj/ETC/sepolicy.recovery_intermediates/sepolicy.recovery.conf ) && (out/host/linux-x86/bin/sepolicy-analyze out/target/product/sunfish/obj/ETC/sepolicy.recovery_intermediates/sepolicy.tmp permissive > out/target/product/sunfish/obj/ETC/sepolicy.recovery_intermediates/sepolicy.permissivedomains ) && (if [ \"eng\" = \"user\" -a -s out/target/product/sunfish/obj/ETC/sepolicy.recovery_intermediates/sepolicy.permissivedomains ]; then            echo \"==========\" 1>&2;               echo \"ERROR: permissive domains not allowed in user builds\" 1>&2;           echo \"List of invalid domains:\" 1>&2;              cat out/target/product/sunfish/obj/ETC/sepolicy.recovery_intermediates/sepolicy.permissivedomains 1>&2;          exit 1;   
            fi ) && (mv out/target/product/sunfish/obj/ETC/sepolicy.recovery_intermediates/sepolicy.tmp out/target/product/sunfish/obj/ETC/sepolicy.recovery_intermediates/sepolicy )"
device/google/sunfish-sepolicy/vendor/qcom/common/attributes:2:ERROR 'Duplicate declaration of type' at token ';' on line 6386:
attribute vendor_persist_type;
#line 1 "device/google/sunfish-sepolicy/vendor/qcom/common/attributes"
checkpolicy:  error(s) encountered while parsing configuration

[ 51% 75021/144890] build out/target/product/sunfish/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows
FAILED: out/target/product/sunfish/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows
/bin/bash -c "(ASAN_OPTIONS=detect_leaks=0 out/host/linux-x86/bin/checkpolicy -M -c             30 -o out/target/product/sunfish/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows.tmp out/target/product/sunfish/obj/FAKE/sepolicy_neverallows_intermediates/policy.conf ) && (out/host/linux-x86/bin/sepolicy-analyze out/target/product/sunfish/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows.tmp neverallow -w -f out/target/product/sunfish/obj/FAKE/sepolicy_neverallows_intermediates/policy_2.conf ||           ( echo \"\" 1>&2;         echo \"sepolicy-analyze failed. This is most likely due to the use\" 1>&2;            echo \"of an expanded attribute in a neverallow assertion. Please fix\" 1>&2;         echo \"the policy.\" 1>&2;      exit 1 ) ) && (touch out/target/product/sunfish/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows.tmp ) && (mv out/target/product/sunfish/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows.tmp out/target/product/sunfish/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows )"
device/google/sunfish-sepolicy/vendor/qcom/common/attributes:2:ERROR 'Duplicate declaration of type' at token ';' on line 6386:
attribute vendor_persist_type;
#line 1 "device/google/sunfish-sepolicy/vendor/qcom/common/attributes"
checkpolicy:  error(s) encountered while parsing configuration
[ 51% 75068/144890] //frameworks/base:framework-cppstream-protos generate 2
frameworks/base/core/proto/android/os/batteryusagestats.proto:22:1: warning: Import frameworks/proto_logging/stats/enums/os/enums.proto but not used.
17:15:28 ninja failed with: exit status 1

Do you have an idea of what could be the culprit?

Kind regards

This doesn't seem related to adevtool.

How to fix this?