init: cannot setexeccon(‘u:r:logd:s0‘): Invalid argument

android 8.0添加新的sepolicy权限后,烧boot.img,system.img到手机里面,发现服务无法起来:
init: cannot setexeccon('u:r:logd:s0'): Invalid argument
service logcatserive /system/bin/logcat -v threadtime  -b radio -r 1024 - -n 10 -f /data/logcat-radio-log
    class late_start
    user root
    group system
    disabled
    seclabel u:r:logcat:s0
一般这样的报错有两种原因:
1、要seclable的文件不存在,例如上面的service,/system/bin/logcat不存在,就要查看手机里面改文件是否存在,对应的权限是否正确;
2、Android 8.0上面,Sepolicy权限发生了变化, device/XXX/YYY/sepolicy 存储在vendor.img中,假设修改的权限再该目录中,就要同时刷入vendor.img到手机中,
否则会报该错误,cannot setexeccon;
Android 8.0权限相关资料:
Policy placement
In Android 7.0, partners could add policy to BOARD_SEPOLICY_DIRS, including policy meant
to augment AOSP policy across different device types. In Android 8.0, adding a policy to
BOARD_SEPOLICY_DIRS places the policy only in the vendor image.
In Android 8.0 AOSP, policy exists in the following locations:
● system/sepolicy/public. Includes policy exported for use in vendor-specific policy.
Everything goes into the Android 8.0 compatibility infrastructure, and vendors include
it as part of their policy so it can be relied upon (leading to restrictions on the type of
policy that can be placed here). Consider this the platform’s exported policy API:
Anything that deals with the interface between /system and /vendor should be here.
● system/sepolicy/private. Includes policy necessary for the functioning of the system
image, but of which vendor image policy should have no knowledge.
● system/sepolicy/vendor. Includes policy for components that go in /vendor but exist
in the core platform tree (not device-specific directories). This is an artifact of build
system’s distinction between devices and global components; conceptually this is a
part of the device-specific policy described below.
● device/XXX/YYY/sepolicy. Includes device-specific policy. Also includes device
customizations to policy, which in Android 8.0 now corresponds to policy for
components on the vendor image
 
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值