本文介绍了在Android 5.0.1中禁用SELinux的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试识别SELinux在Android Framework中设置为Enforcing模式的配置文件.

I am trying to identify the configuration file where SELinux is set to Enforcing mode in Android Framework.

请不要仅回答

adb shell su 0 setenforce permissive

我需要系统以宽松模式启动,或者在启动时完全禁用SELinux.

I need the system to boot in permissive mode or have SELinux completely disabled at boot time.

谢谢

推荐答案

设置强制模式有两种方法.在用户构建中,它将始终处于强制执行状态.在eng或userdebug上,您可以对其进行控制.您可以按照标准的selinux方式进行控制,方法是如Dan Walsh的博客中所述,在内核命令行上设置enforcing = 1/0:

There are two ways that enforcing mode is set. On user builds, it will always be in enforcing. On eng or userdebug, you can control it. You can control it in the standard selinux way, by setting enforcing=1/0 on the kernel command line as outlined in Dan Walsh's blog:

http://danwalsh.livejournal.com/10972.html

以Android为中心的方法是将内核命令行设置为androidboot.selinux = permissive

The Android centric way is to set the kernel command line to androidboot.selinux=permissive

您可以通过编辑BoardConfig.mk并添加以下内容来控制内核命令行:

You can control the kernel command line by editing your BoardConfig.mk and adding this:

BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive

以Android为中心的方式由init强制执行,如果您查看system/core/init/init.cpp,请查看从main()调用的selinux_initialize()例程.

The Android centric way is enforced by init, if you look in system/core/init/init.cpp look at the selinux_initialize() routine that is called from main().

这篇关于在Android 5.0.1中禁用SELinux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 05:50