package/openrc: enable selinux support when libselinux is enabled
authorAdam Duskett <Aduskett@gmail.com>
Thu, 16 Apr 2020 03:21:37 +0000 (00:21 -0300)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Fri, 17 Apr 2020 20:09:05 +0000 (22:09 +0200)
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@gmail.com>
Signed-off-by: Carlos Santos <unixmania@gmail.com>
Tested-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/openrc/openrc.mk

index 6057451bfe3c2106d0f6007ac0d262220f9d76b7..97536dad37e6e633818ed503acfea80f0d5e59d4 100644 (file)
@@ -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