构建Android内核时出现checkpolicy错误

问题描述

我正在为小米mi6(代号sagit)构建PixelExperience。当我构建内核时,我看到checkpolicy错误。如何处理或忽略它? 我从PixelExperience官方github页面下载了kernel和device-msm8998-common。我从https://github.com/hakersky/device_xiaomi_sagit下载的设备树device-xiaomi-sagit。 我也从TheMuppet下载了供应商文件,其gitlab页面为https://gitlab.com/the-muppets/proprietary_vendor_xiaomi/-/tree/lineage-17.1/sagithttps://gitlab.com/the-muppets/proprietary_vendor_xiaomi/-/tree/lineage-17.1/msm8998-common。 下面是整个构建日志。

 /home/Android/PixelExperience/Q/ brunch sagit
[W][2020-08-16T00:57:32+0800][18861] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace,and will have user root-level access to files
[W][2020-08-16T00:57:32+0800][18861] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace,and will have group root-level access to files
[W][2020-08-16T00:57:33+0800][18964] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace,and will have user root-level access to files
[W][2020-08-16T00:57:33+0800][18964] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace,and will have group root-level access to files
Trying dependencies-only mode on a non-existing device tree?
[W][2020-08-16T00:57:34+0800][19058] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace,and will have user root-level access to files
[W][2020-08-16T00:57:34+0800][19058] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace,and will have group root-level access to files

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
CUSTOM_VERSION=PixelExperience_sagit-10.0-20200815-1657-UNOFFICIAL
TARGET_PRODUCT=aosp_sagit
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.4.0-42-generic-x86_64-Ubuntu-20.04.1-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=QQ3A.200705.002
OUT_DIR=/home/Android/PixelExperience/Q/out
PRODUCT_SOONG_NAMESPACES=device/xiaomi/msm8998-common hardware/google/pixel vendor/xiaomi/msm8998-common vendor/xiaomi/sagit vendor/miuicamera/common vendor/google-customization/apex/apex_images hardware/qcom-caf/msm8998 hardware/qcom-caf/common/fwk-detect
============================================
[W][2020-08-16T00:57:35+0800][19162] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace,and will have user root-level access to files
[W][2020-08-16T00:57:35+0800][19162] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace,and will have group root-level access to files
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
CUSTOM_VERSION=PixelExperience_sagit-10.0-20200815-1657-UNOFFICIAL
TARGET_PRODUCT=aosp_sagit
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.4.0-42-generic-x86_64-Ubuntu-20.04.1-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=QQ3A.200705.002
OUT_DIR=/home/Android/PixelExperience/Q/out
PRODUCT_SOONG_NAMESPACES=device/xiaomi/msm8998-common hardware/google/pixel vendor/xiaomi/msm8998-common vendor/xiaomi/sagit vendor/miuicamera/common vendor/google-customization/apex/apex_images hardware/qcom-caf/msm8998 hardware/qcom-caf/common/fwk-detect
============================================
[W][2020-08-16T00:57:35+0800][19336] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace,and will have user root-level access to files
[W][2020-08-16T00:57:35+0800][19336] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace,and will have group root-level access to files
[W][2020-08-16T00:57:35+0800][19346] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace,and will have user root-level access to files
[W][2020-08-16T00:57:35+0800][19346] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace,and will have group root-level access to files
[W][2020-08-16T00:58:02+0800][19601] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace,and will have user root-level access to files
[W][2020-08-16T00:58:02+0800][19601] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace,and will have group root-level access to files
[W][2020-08-16T00:59:13+0800][19790] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace,and will have user root-level access to files
[W][2020-08-16T00:59:13+0800][19790] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace,and will have group root-level access to files
vendor/xiaomi/sagit/BoardConfigVendor.mk was modified,regenerating...
[W][2020-08-16T00:59:15+0800][19951] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace,and will have user root-level access to files
[W][2020-08-16T00:59:15+0800][19951] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace,and will have group root-level access to files
vendor/xiaomi/sagit/Android.mk was modified,regenerating...
[ 99% 503/504] finishing build rules ...
platform_testing/build/tasks/tests/platform_test_list.mk: warning: platform_tests: Unknown installed file for module 'LauncherRotationStressTest' 
[W][2020-08-16T01:00:08+0800][21602] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace,and will have user root-level access to files
[W][2020-08-16T01:00:08+0800][21602] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace,and will have group root-level access to files
/home/Android/PixelExperience/Q/out/target/product/sagit/obj/CONFIG/kati_packaging/dist.mk was modified,regenerating...
[  3% 514/14060] build /home/Android/PixelExperience/Q/out/target/product/sagit/
FAILED: /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows
/bin/bash -c "(ASAN_OPTIONS=detect_leaks=0 /home/Android/PixelExperience/Q/out/host/linux-x86/bin/checkpolicy -M -c         30 -o /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows.tmp /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/sepolicy_neverallows_intermediates/policy.conf ) && (/home/Android/PixelExperience/Q/out/host/linux-x86/bin/sepolicy-analyze /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows.tmp neverallow -w -f /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/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 /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows.tmp ) && (mv /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows.tmp /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows )"
device/xiaomi/msm8998-common/sepolicy/vendor/hal_power_default.te:19:ERROR 'unknown type debugfs_wlan' at token ';' on line 83644:
allow hal_power_default debugfs_wlan:dir { open getattr read search ioctl lock watch watch_reads };
#line 19
checkpolicy:  error(s) encountered while parsing configuration
[  3% 515/14060] build /home/Android/PixelExperience/Q/out/target/product/sagit/
FAILED: /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/sepolicy.recovery_intermediates/sepolicy
/bin/bash -c "(ASAN_OPTIONS=detect_leaks=0 /home/Android/PixelExperience/Q/out/host/linux-x86/bin/checkpolicy -M -c         30 -o /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/sepolicy.recovery_intermediates/sepolicy.tmp /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/sepolicy.recovery_intermediates/sepolicy.recovery.conf ) && (/home/Android/PixelExperience/Q/out/host/linux-x86/bin/sepolicy-analyze /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/sepolicy.recovery_intermediates/sepolicy.tmp permissive > /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/sepolicy.recovery_intermediates/sepolicy.permissivedomains ) && (if [ \"userdebug\" = \"user\" -a -s /home/Android/PixelExperience/Q/out/target/product/sagit/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 /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/sepolicy.recovery_intermediates/sepolicy.permissivedomains 1>&2;       exit 1;     fi ) && (mv /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/sepolicy.recovery_intermediates/sepolicy.tmp /home/Android/PixelExperience/Q/out/target/product/sagit/obj/ETC/sepolicy.recovery_intermediates/sepolicy )"
device/xiaomi/msm8998-common/sepolicy/vendor/hal_power_default.te:19:ERROR 'unknown type debugfs_wlan' at token ';' on line 91400:
allow hal_power_default debugfs_wlan:dir { open getattr read search ioctl lock watch watch_reads };
#line 19
checkpolicy:  error(s) encountered while parsing configuration
[  3% 519/14060] Building Kernel Config
make: Entering directory '/home/Android/PixelExperience/Q/kernel/xiaomi/msm8998'
make[1]: Entering directory '/home/Android/PixelExperience/Q/out/target/product/sagit/obj/KERNEL_OBJ'
  GEN     ./Makefile
#
# configuration written to .config
#
make[1]: Leaving directory '/home/Android/PixelExperience/Q/out/target/product/sagit/obj/KERNEL_OBJ'
make: Leaving directory '/home/Android/PixelExperience/Q/kernel/xiaomi/msm8998'
make: Entering directory '/home/Android/PixelExperience/Q/kernel/xiaomi/msm8998'
make[1]: Entering directory '/home/Android/PixelExperience/Q/out/target/product/sagit/obj/KERNEL_OBJ'
  GEN     ./Makefile
scripts/kconfig/conf  --savedefconfig=defconfig Kconfig
make[1]: Leaving directory '/home/Android/PixelExperience/Q/out/target/product/sagit/obj/KERNEL_OBJ'
make: Leaving directory '/home/Android/PixelExperience/Q/kernel/xiaomi/msm8998'
FAILED: [W][2020-08-16T01:00:08+0800][21608] void cmdline::logParams(nsjconf_t *)():250 Process will be UID/EUID=0 in the global user namespace,and will have user root-level access to files
[W][2020-08-16T01:00:08+0800][21608] void cmdline::logParams(nsjconf_t *)():260 Process will be GID/EGID=0 in the global user namespace,and will have group root-level access to files
01:00:27 ninja failed with: exit status 1

#### failed to build some targets (02:53 (mm:ss)) ####

解决方法

现在重试,导致该问题的原因已删除

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...