android - 构建android内核时的checkpolicy错误
问题描述
我正在为我的小米 mi6(代号 sagit)构建 PixelExperience。当我构建内核时,我看到 checkpolicy 错误。我该如何处理或忽略它?我从 PixelExperience 官方 github 页面下载了内核和 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/sagit和https://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)) ####
解决方案
现在重试,导致问题的原因已删除
推荐阅读
- python-3.x - ImportError:DLL 加载失败:找不到指定的模块。尝试将 tensorflow 和 keras 导入 PyCharm 时
- jquery - 计算特定的 td 并显示在另一个 td
- java - 选择后项目不显示在微调器中
- javascript - 在开发者控制台的网络选项卡上访问或获取文件
- python - 查找唯一数量的序列和读取
- android - 尽量减少应用程序中的活动数量以尽量减少可能的内存泄漏数量是否是一种好习惯?
- android - 如何从火力基地获取位置并对汽车标记进行动画处理
- ruby-on-rails - 如何使用 Waitr::Browser 显示动态站点内容以供 Nokogiri 抓取
- go - 实现一个通用的参数方法
- matlab - MATLAB 信号处理工具箱的重采样功能不适用于“线性”方法