1. 报权限错误
1.1 main.log:
01-01 00:23:19.017539 960 995 E sensord : [99452248851][ERR](vendor/mediatek/proprietary/hardware/sensor/sensord/sensord_hwcntl_implement.cpp Ln1688) can not open /sys/bus/platform/drivers/gsensor/cpsdata, errno = 13(Permission denied)
1.2 kernel.log:
<36>[ 89.241161] (0)[234:logd.auditd]type=1400 audit(1420071788.770:200): avc: denied { search } for pid=995 comm="system_server" name="gsensor" dev="sysfs" ino=11618 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_gsensor_fixed_file:s0 tclass=dir permissive=0
<36>[ 89.249303] (0)[234:logd.auditd]type=1400 audit(1420071788.780:201): avc: denied { search } for pid=995 comm="system_server" name="gsensor" dev="sysfs" ino=11618 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_gsensor_fixed_file:s0 tclass=dir permissive=0
<36>[ 89.251648] (0)[234:logd.auditd]type=1400 audit(1420071788.780:202): avc: denied { search } for pid=995 comm="system_server" name="gsensor" dev="sysfs" ino=11618 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_gsensor_fixed_file:s0 tclass=dir permissive=0
<36>[ 359.429473] (2)[235:logd.auditd]type=1400 audit(1262304609.970:13197): avc: denied { read } for pid=998 comm="system_server" name="cpsdata" dev="sysfs" ino=17162 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_gsensor_fixed_file:s0 tclass=file permissive=0
<36>[ 359.429847] (2)[235:logd.auditd]type=1400 audit(1262304609.970:13198): avc: denied { search } for pid=998 comm="system_server" name="msensor" dev="sysfs" ino=11624 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_msensor_fixed_file:s0 tclass=dir permissive=0
<36>[ 359.434114] (0)[235:logd.auditd]type=1400 audit(1262304609.980:13199): avc: denied { read } for pid=998 comm="system_server" name="cpsdata" dev="sysfs" ino=17162 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_gsensor_fixed_file:s0 tclass=file permissive=0
<36>[ 359.434400] (0)[235:logd.auditd]type=1400 audit(1262304609.980:13200): avc: denied { search } for pid=998 comm="system_server" name="msensor" dev="sysfs" ino=11624 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_msensor_fixed_file:s0 tclass=dir permissive=0
2. 添加权限
修改alps\device\mediatek\common\sepolicy\system_server.te
allow system_server sysfs_gsensor_fixed_file:dir {search open read write create getattr setattr };
allow system_server sysfs_gsensor_fixed_file:file {open read write create getattr setattr };
allow system_server sysfs_msensor_fixed_file:dir {search open read write create getattr setattr };
allow system_server sysfs_msensor_fixed_file:file {open read write create getattr setattr };
修改alps\device\mediatek\common\sepolicy\msensord.te
allow msensord sysfs_gsensor_fixed_file:dir {search open read write create getattr setattr };
allow msensord sysfs_gsensor_fixed_file:file {open read write create getattr setattr };
allow msensord sysfs_msensor_fixed_file:dir {search open read write create getattr setattr };
allow msensord sysfs_msensor_fixed_file:file {open read write create getattr setattr };
3. 单独编译 打包生产boot.img
mmm external/sepolicy/; make bootimage
17. 权限添加-解决运行报错(te文件)
最新推荐文章于 2024-04-20 16:38:23 发布