From: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
To: Yoann Congal <yoann.congal@smile.fr>
Cc: yocto-patches@lists.yoctoproject.org,
Richard Purdie <richard.purdie@linuxfoundation.org>,
Yi Zhao <yi.zhao@windriver.com>
Subject: Re: [yocto-patches] [meta-selinux][PATCH] Enable SELinux support in native packages
Date: Wed, 18 Mar 2026 08:50:25 +0100 [thread overview]
Message-ID: <abpXXjX8C23hL8RO@monoceros> (raw)
In-Reply-To: <DH59MQQ8LHWC.25HPETRJUAGLI@smile.fr>
[-- Attachment #1: Type: text/plain, Size: 3644 bytes --]
On Tue, Mar 17, 2026 at 07:23:35PM +0100, Yoann Congal wrote:
> On Tue Mar 17, 2026 at 6:40 PM CET, Hiago De Franco via lists.yoctoproject.org wrote:
> > Hi Richard,
> >
> > On Mon, Mar 09, 2026 at 02:21:51PM +0000, Richard Purdie wrote:
> >> On Mon, 2026-03-09 at 20:23 +0800, Yi Zhao via lists.yoctoproject.org wrote:
> >> >
> >> > On 2/13/26 23:42, "Uwe Kleine-König wrote:
> >> > > 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"
> >> >
> >> > Can we add this to the doc (e.g. README) instead of enabling it directly
> >> > in layer.conf? Since we haven't directly enabled DISTRO_FEATURES =
> >> > "selinux" in layer.conf either.
> >>
> >> I just wanted to add that putting that directly in layer.conf will mean
> >> the layer isn't Yocto Project Compatible too.
> >
> > I am going to send a v2 and take over this work, already asked Uwe about
> > that.
> >
> > But before doing it, I was wondering why changing layer.conf will make
> > the layer not compatible with Yocto Project anymore. Can you explain to
> > us the reason?
>
> I'd guess it is from this criteria of the Yocto Compatible layer[0]:
> > Inclusion of any layer in the submission does not change the
> > behavior/configuration of the overall system without the user
> > explicitly opting into those changes
>
> By putting a 'DISTRO_FEATURES += "selinux"' in layer.conf, the
> configuration changes globally without explicit opt-in of the user.
Note that the patch didn't change DISTRO_FEATURES, it appended "selinux"
to DISTRO_FEATURES_FILTER_NATIVE. If DISTRO_FEATURES doesn't already
contain "selinux", this is a noop. So I don't see how this violates the
quoted critera.
What am I missing?
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2026-03-18 7:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=abpXXjX8C23hL8RO@monoceros \
--to=u.kleine-koenig@baylibre.com \
--cc=richard.purdie@linuxfoundation.org \
--cc=yi.zhao@windriver.com \
--cc=yoann.congal@smile.fr \
--cc=yocto-patches@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.