diff mbox series

busybox: Enable SELinux support if DISTRO_FEATURES contains 'selinux'

Message ID 20260216164527.864396-1-u.kleine-koenig@baylibre.com
State Under Review
Headers show
Series busybox: Enable SELinux support if DISTRO_FEATURES contains 'selinux' | expand

Commit Message

Uwe Kleine-König Feb. 16, 2026, 4:45 p.m. UTC
If selinux is contained in DISTRO_FEATURES, enable CONFIG_SELINUX which
needs a dependency on libselinux.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
Hello,

this targets oe-core master, but it would be great if it could be
backported to scarthgap which is what I'm currently using.

Best regards
Uwe

 meta/recipes-core/busybox/busybox.inc | 2 ++
 1 file changed, 2 insertions(+)


base-commit: 2c20c05b324e5d6564c8554381019170839509bb
diff mbox series

Patch

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index c85117efc80f..355c01973848 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -4,6 +4,7 @@  HOMEPAGE = "https://www.busybox.net"
 BUGTRACKER = "https://bugs.busybox.net/"
 
 DEPENDS += "kern-tools-native virtual/crypt"
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'libselinux', '', d)}"
 
 # bzip2 applet in busybox is based on lightly-modified bzip2-1.0.4 source
 # the GPL is version 2 only
@@ -86,6 +87,7 @@  def features_to_busybox_settings(d):
     busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv4', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
     busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
     busybox_cfg(bb.utils.contains_any('DISTRO_FEATURES', 'bluetooth wifi', True, False, d), 'CONFIG_RFKILL', cnf, rem)
+    busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d), 'CONFIG_SELINUX', cnf, rem)
     return "\n".join(cnf), "\n".join(rem)
 
 # X, Y = ${@features_to_busybox_settings(d)}