已经添加了sepolicy,但还是编译报错,报错如下:
编译报错:init : Could not start service ‘vendor.secure_element-default’ as part of class ‘hal’: File /vendor/bin/hw/vendor.sprd.hardware.secure_element-service(labeled “u:object_r:vendor_file:s0”) has incorrect label or no domain transition from u:r:init:s0 to another SELinux domain defined. Have you configured your service correctly? https://source.android.com/security/selinux/device-policy#label_new_services_and_address_denials
原因:log显示这个服务标签不正确或者domain域转换有问题。找了一圈问题,发现是没有在编译开关那里添加配置sepolicy的路径,尤其是自定义的sepolicy,系统会找不到、添加自定义sepolicy的写法如下
BOARD_VENDOR_SEPOLICY_DIRS += $(call md-path-cur)/msepolicy/vendor/