本文主要是介绍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 meantto augment AOSP policy across different device types. In Android 8.0, adding a policy toBOARD_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 includeit as part of their policy so it can be relied upon (leading to restrictions on the type ofpolicy 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 existin the core platform tree (not device-specific directories). This is an artifact of buildsystem’s distinction between devices and global components; conceptually this is apart of the device-specific policy described below.● device/XXX/YYY/sepolicy. Includes device-specific policy. Also includes devicecustomizations to policy, which in Android 8.0 now corresponds to policy forcomponents on the vendor image
这篇关于init: cannot setexeccon(‘u:r:logd:s0‘): Invalid argument的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!