All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-selinux][PATCH] Enable SELinux support in native packages
@ 2026-02-13 15:42 Uwe Kleine-König
  2026-03-09 12:23 ` [yocto-patches] " Yi Zhao
  0 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2026-02-13 15:42 UTC (permalink / raw)
  To: yocto-patches

With SELinux enabled for the target it makes sense to have SELinux
support enabled for the native tools, too.

Note that for native packages DISTRO_FEATURES is filtered, thus up to now
it never contained "selinux". Append to DISTRO_FEATURES_FILTER_NATIVE to
make "selinux" propagate also to DISTRO_FEATURES for native packages.
---
Hello,

I use this on scarthgap, but the patch applies fine to master, too.

During a debug session it took me quite a while to find out why

	ls -lZ "${IMAGE_ROOTFS}

at the end of selinux_set_labels() didn't show the labels added by
setfiles.

Best regards
Uwe

 classes/enable-selinux.bbclass | 2 +-
 conf/layer.conf                | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/classes/enable-selinux.bbclass b/classes/enable-selinux.bbclass
index 3dc61d6931ff..0c9f52e74cec 100644
--- a/classes/enable-selinux.bbclass
+++ b/classes/enable-selinux.bbclass
@@ -1,3 +1,3 @@
 inherit selinux
 
-PACKAGECONFIG:append = " ${@target_selinux(d, 'selinux')}"
+PACKAGECONFIG:append = " ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}"
diff --git a/conf/layer.conf b/conf/layer.conf
index 4e04e5cc7e6a..ca981db57019 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -25,3 +25,7 @@ LAYERDEPENDS_selinux = " \
 "
 
 PREFERRED_PROVIDER_virtual/refpolicy ??= "refpolicy-targeted"
+
+# With target support for SELinux it is very helpful during debug when the
+# native tools support SELinux, too.
+DISTRO_FEATURES_FILTER_NATIVE:append = " selinux"

base-commit: 536df5a4fbce3c9fd63f51580f43d248a0d1b0ef
-- 
2.47.3



^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-03-27 16:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-13 15:42 [meta-selinux][PATCH] Enable SELinux support in native packages Uwe Kleine-König
2026-03-09 12:23 ` [yocto-patches] " Yi Zhao
2026-03-09 14:21   ` Richard Purdie
2026-03-17 17:40     ` Hiago De Franco
2026-03-17 18:23       ` Yoann Congal
2026-03-17 20:19         ` Hiago De Franco
2026-03-18  7:50         ` Uwe Kleine-König
2026-03-18  9:12           ` Richard Purdie
2026-03-18 11:13             ` Uwe Kleine-König
2026-03-18 12:37               ` Richard Purdie
2026-03-18 14:22                 ` Uwe Kleine-König
2026-03-25 12:28                   ` Hiago De Franco
2026-03-27 16:33                     ` Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.