systemd: enable selinux if libselinux is enabled
authorAdam Duskett <adamduskett@outlook.com>
Sat, 17 Dec 2016 05:29:42 +0000 (05:29 +0000)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 17 Dec 2016 13:19:05 +0000 (14:19 +0100)
systemd currently has selinux disabled unconditionally.  This prevents
/sys/fs/selinux from being mounted automatically at boot which causes
audit to no longer function. This patch fixes the problem by checking if
libselinux is enabled and enabling support for selinux in systemd if so.

Signed-off-by: Adam Duskett <Adamduskett@outlook.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/systemd/systemd.mk

index fa07bd05729fa5be90d85cd0c28a2e0f79f3203d..278c8e93cc17d95bb0643b41797283e4ac8c2ae1 100644 (file)
@@ -30,7 +30,6 @@ SYSTEMD_CONF_OPTS += \
        --enable-blkid \
        --enable-static=no \
        --disable-manpages \
-       --disable-selinux \
        --disable-pam \
        --disable-ima \
        --disable-libcryptsetup \
@@ -153,6 +152,13 @@ else
 SYSTEMD_CONF_OPTS += --disable-microhttpd --disable-qrencode
 endif
 
+ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
+SYSTEMD_DEPENDENCIES += libselinux
+SYSTEMD_CONF_OPTS += --enable-selinux
+else
+SYSTEMD_CONF_OPTS += --disable-selinux
+endif
+
 ifeq ($(BR2_PACKAGE_SYSTEMD_HWDB),y)
 SYSTEMD_CONF_OPTS += --enable-hwdb
 else