在mt6737 M0上添加一个I2C驱动的全套流程(3)------android 5.1之后如何修改设备节点权限

android 5.1之后设备节点权限需要修改如下7个文件,才能让上层的apk应用读到底层的设备节点:

//更改te文件里面的设备名:eg:rt5651xctx

cljcc@szhxc:~/satellite6737/trunk$ grep -rn "rt5651xctx_device"  
1.device/mediatek/common/sepolicy/app.te:21:allow appdomain rt5651xctx_device:file rw_file_perms;
2 device/mediatek/common/sepolicy/device.te:197:type rt5651xctx_device, dev_type;
3 device/mediatek/common/sepolicy/system_app.te:167:allow system_app rt5651xctx_device:chr_file { read write getattr ioctl open };
4 device/mediatek/common/sepolicy/system_server.te:270:allow system_server rt5651xctx_device:file rw_file_perms;

5 device/mediatek/common/sepolicy/file_contexts:350:/dev/xctxmotor       u:object_r:rt5651xctx_device:s0

6 \device\mediatek\common\sepolicy\untrusted_app.te     //allow untrusted_app rt5651xctx_device:chr_file rw_file_perms;

 7.device\joya\joya6737m_65_m0\init.project.rc    // 添加 chmod 0777 /dev/xctxmotor

以上适合出货版本的修改;

若只是内部测试设备节点的权限,可以是如下3个文件修改,但本人并没有验证,待以后考证:

1.L:\trunk\vendor\mediatek\proprietary\bootable\bootloader\lk\platform\mt6735\rules.mk

# choose one of following value ->  2: permissive /3: enforcing

SELINUX_STATUS := 2  //要改成2 即permissive

2.相关的L:\trunk\kernel-3.18\arch\arm64\configs\joya6737m_65_m0_defconfig  的selinux要修改;

3.L:\trunk\kernel-3.18\arch\arm64\configs\joya6737m_65_m0_debug_defconfig 的selinux要修改;

你可能感兴趣的:(驱动管理)