在MTK Android 7.0 SELinux中给ublox串口加上读写权限

平台:MT6735 Android版本:7.0

u-blox.conf中定义串口为:

SERIAL_DEVICE                  /dev/ttyMT3

没有给串口加上权限前,出现以下log:

[212:logd.auditd]type=1400 audit(1420070619.170:645332): avc: denied { read write } for pid=1822 comm=67707320746872656164 name="ttyMT3" dev="tmpfs" ino=6437 scontext=u:r:system_server:s0 tcontext=u:object_r:ttyMT_device:s0 tclass=chr_file permissive=0

解决方法:

./system/sepolicy/file_contexts:146:/dev/ttyMT3 u:object_r:ublox_serial_device:s0

./system/sepolicy/device.te:105:type ublox_serial_device, dev_type;

./system/sepolicy/domain.te:147:allow domain ublox_serial_device:chr_file rw_file_perms;

./system/sepolicy/system_server.te:541:allow system_app ublox_serial_device:chr_file rw_file_perms;

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容