[Buildroot] [git commit] package/openrc: enable selinux support when libselinux is enabled

Thomas Petazzoni thomas.petazzoni at bootlin.com
Fri Apr 17 20:09:05 UTC 2020


commit: https://git.buildroot.net/buildroot/commit/?id=1eff2c637e2812aca9cb7ead30959766c27b8270
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

OpenRC suports SELinux, so there is no reason to forcibly disable it.

Notice this only allows OpenRC to perform the initial policy load and
set the enforcing mode. In order really use SELinux it's also
necessary to select refpolicy, which provides a policy, and
policycoreutils, which provides restorecon and other SELinux
utilities.

Signed-off-by: Adam Duskett <Aduskett at gmail.com>
Signed-off-by: Carlos Santos <unixmania at gmail.com>
Tested-by: Carlos Santos <unixmania at gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 package/openrc/openrc.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/package/openrc/openrc.mk b/package/openrc/openrc.mk
index 6057451bfe..97536dad37 100644
--- a/package/openrc/openrc.mk
+++ b/package/openrc/openrc.mk
@@ -18,7 +18,6 @@ OPENRC_MAKE_OPTS = \
 	LIBNAME=lib \
 	LIBEXECDIR=/usr/libexec/rc \
 	MKPKGCONFIG=no \
-	MKSELINUX=no \
 	MKSYSVINIT=yes \
 	BRANDING="Buildroot $(BR2_VERSION_FULL)" \
 	CC=$(TARGET_CC)
@@ -29,6 +28,13 @@ else
 OPENRC_MAKE_OPTS += MKSTATICLIBS=yes
 endif
 
+ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
+OPENRC_MAKE_OPTS += MKSELINUX=yes
+OPENRC_DEPENDENCIES += libselinux
+else
+OPENRC_MAKE_OPTS += MKSELINUX=no
+endif
+
 define OPENRC_BUILD_CMDS
 	$(MAKE) $(OPENRC_MAKE_OPTS) -C $(@D)
 endef


More information about the buildroot mailing list