Search code examples
androidselinuxqualcomm

How can we disable/remove SELinux during complie on Qualcomm platform?


I'm Qualcomm platform developer;

How can we disable/remove SELinux feature from software image during compiling? In a word,I need remove the SELinux feature from android

BTW:

set setenforce 0 or set getenforce works well;


Solution

  • Rebuild the kernel with CONFIG_SECURITY_SELINUX=n. This is found in the kernel defconfig for your platform.

    For example, to completely disable SELinux in the hammerhead (Nexus 5) kernel, change arch/arm/configs/hammerhead_defconfig per above and rebuild the kernel. Include this new kernel in your boot image and the result will be a device without any SELinux support at all. getenforce will return Disabled.