1. 遇到的问题有些应用会提示AVC denied的报错,这个是由于 selinux的权限问题
解决办法: 通过命令 getenforce 查看状态
msm8952_64:/ # getenforce
Enforcing
Enforcing selinux 生效了
su
setenforce 0 //关闭 selinux
msm8952_64:/ # getenforce
Permissive //这个状态则表明关闭了
2.在高通 8976上发现 关机不能正常关机,会重新启动发现,跟这个权限有关系,关掉就可以了。
3.要 永久关闭,可以更改kernel的代码。
static ssize_t sel_write_enforce(struct file *file, const char __user *buf,
141 size_t count, loff_t *ppos)
142
143 {
144 char *page = NULL;
145 ssize_t length;
146 int new_value;
147
148 length = -ENOMEM;
149 if (count >= PAGE_SIZE)
150 goto out;
151
152 /* No partial writes. */
153 length = -EINVAL;
154 if (*ppos != 0)
155 goto out;
156
157 length = -ENOMEM;
158 page = (char *)get_zeroed_page(GFP_KERNEL);
159 if (!page)
160 goto out;
161
162 length = -EFAULT;
163 if (copy_from_user(page, buf, count))
164 goto out;
165
166 length = -EINVAL;
167 if (sscanf(page, "%d", &new_value) != 1)
168 goto out;
169
170 if (new_value != selinux_enforcing) {
171 length = task_has_security(current, SECURITY__SETENFORCE);
172 if (length)
173 goto out;
174 audit_log(current->audit_context, GFP_KERNEL, AUDIT_MAC_STATUS,
175 "enforcing=%d old_enforcing=%d auid=%u ses=%u",
176 new_value, selinux_enforcing,
177 from_kuid(&init_user_ns, audit_get_loginuid(current)),
178 audit_get_sessionid(current));
179 selinux_enforcing = new_value;
180 if (selinux_enforcing)
181 avc_ss_reset(0);
182 selinux_enforcing =0; //设置为 关闭
4. 也可以在init.qcom.rc 中添加命令
setenforce 0
但是不知道为什么添加后一直没有成功,没有找到原因,有可能是添加位置不对。