From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73C86C5CFC1 for ; Fri, 14 Aug 2026 05:22:16 +0000 (UTC) Received: from codeconstruct.com.au (codeconstruct.com.au [203.29.241.158]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.6824.1786684929710389905 for ; Thu, 13 Aug 2026 22:22:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@codeconstruct.com.au header.s=2022a header.b=bU8b2tVZ; spf=pass (domain: codeconstruct.com.au, ip: 203.29.241.158, mailfrom: james@codeconstruct.com.au) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeconstruct.com.au; s=2022a; t=1786684927; bh=kBacIYFzRaCMO0lHff8JmTVZeAQYFRm1queqg3RYkdE=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=bU8b2tVZzkqq5mhgKUZMCOIfWneMWGd+HmLYyF4Tuee7HDKVbOjc5M8E7XBdPCxsY dsArU15Z53x5eb922lxVPpsDZM/gNuzMEJrGH+BtfcqVi2RkZyTeAUEExz1ndRyeLL bSt3EGOcwPf4YWYw5cOjLqSlB+iKo0myRA06BhUr7BQkqwfkJJlmbdrdxSZDxbcPpe 1WFxcnpv1SGcgKdFLXztEFCF64oWPu538tGX5nbuhCry9WGwM9/cO3d/kmTQNh5UR0 CBUlULJ0INAPO8caKYfSdDnlmA7U55Zy8mhgH+zpHsggwtaTarpkn6hOYL2ByhZkJ/ ZEW4TcoxiUcWw== Received: from [192.168.72.170] (210-10-213-150.per.static-ipl.aapt.com.au [210.10.213.150]) by mail.codeconstruct.com.au (Postfix) with ESMTPSA id 7EB8766FAE; Fri, 14 Aug 2026 13:22:07 +0800 (AWST) Message-ID: <1fad84121fc6874e9ee1374bd87d8f35b5da5ee7.camel@codeconstruct.com.au> Subject: Re: [oe] [meta-networking] [PATCH v2 1/2] mctp: split mctp tools and mctpd into separate recipes From: James Lee To: Khem Raj Cc: openembedded-devel@lists.openembedded.org, andrew@codeconstruct.com.au, jk@codeconstruct.com.au Date: Fri, 14 Aug 2026 13:22:07 +0800 In-Reply-To: References: <20260811072523.3463118-1-james@codeconstruct.com.au> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2-0+deb13u1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 14 Aug 2026 05:22:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/129035 On Thu, 2026-08-13 at 22:15 -0700, Khem Raj wrote: >=20 >=20 > On Thu, Aug 13, 2026 at 9:53=E2=80=AFPM James Lee > wrote: > > On Thu, 2026-08-13 at 21:45 -0700, Khem Raj wrote: > > >=20 > > >=20 > > > On Thu, Aug 13, 2026 at 9:14=E2=80=AFPM James Lee > > > wrote: > > > > I believe that would work, but think it's important to have a > > > > clear > > > > split at this point. > > > >=20 > > > > The mctp utilities and mctpd daemon have different use-cases > > > > and > > > > dependencies, and do not depend on each other. The split allows > > > > users > > > > to install the mctp utilities on systemd distros without > > > > automatically > > > > adding the daemon. It also makes it clear that the mctp package > > > > does > > > > not depend on systemd or useradd. > > > >=20 > > >=20 > > >=20 > > > The output can be packaged to be more granular such that daemon > > > goes > > > into > > > package of its own, would that work ? > > > =C2=A0 > >=20 > > I believe that would break the inherit_defer approach? > >=20 >=20 >=20 > Cant be sure. Looking forward to you experiment with it :) > =C2=A0 To be clear, I have experimented with this approach and didn't find a way to detect which packages are being installed with the library functions. Splitting into two recipes was the fallback option. If you know of any way it could be done, the help would be appreciated. > >=20 > > > >=20 > > > > On Thu, 2026-08-13 at 06:53 -0700, Khem Raj wrote: > > > > > Can we do something like=C2=A0 > > > > > inherit_defer ${@bb.utils.contains('DISTRO_FEATURES', > > > > > 'systemd', > > > > > 'useradd', '', d)} > > > > >=20 > > > > > On Tue, Aug 11, 2026 at 12:25=E2=80=AFAM James Lee via > > > > > lists.openembedded.org > > > > > wrote: > > > > > > The current mctp recipe relies on the upstream's > > > > > > conditional > > > > > > build > > > > > > and > > > > > > install of the mctpd binary if systemd is present, only > > > > > > building > > > > > > the > > > > > > mctp utility otherwise. Future upstream changes allowing > > > > > > running as > > > > > > non-root require more control over the build process. We > > > > > > will > > > > > > need > > > > > > to > > > > > > add a new system user when mctpd is built. > > > > > >=20 > > > > > > Adding a user requires inheriting useradd, which assumes at > > > > > > least > > > > > > one > > > > > > user will be created, failing the recipe otherwise. > > > > > > Building > > > > > > without > > > > > > mctpd would then cause the recipe to fail as conditionally > > > > > > inheriting > > > > > > useradd seems infeasible. > > > > > >=20 > > > > > > To make useradd available for the new upstream release, > > > > > > split > > > > > > the > > > > > > recipe > > > > > > into "mctp" for the utilities and "mctpd" for the daemon, > > > > > > isolating > > > > > > the > > > > > > systemd dependency to "mctpd". > > > > > >=20 > > > > > > This makes the two parts of the source explicitly > > > > > > selectable > > > > > > from > > > > > > user > > > > > > choice, rather than auto-detecting based on the presence of > > > > > > systemd. It > > > > > > will also let us express the useradd rules only when > > > > > > they're > > > > > > needed > > > > > > for > > > > > > the mctpd installation in the upcoming version bump. > > > > > >=20 > > > > > > Signed-off-by: James Lee james@codeconstruct.com.au > > > > > > --- > > > > > > =C2=A0meta-networking/recipes-support/mctp/mctp.inc | 11 +++++ > > > > > > =C2=A0.../recipes-support/mctp/mctp_2.5.bb=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 | 46 ++----- > > > > > > ---- > > > > > > ---- > > > > > > ---- > > > > > > =C2=A0.../recipes-support/mctp/mctpd_2.5.bb=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0| 28 > > > > > > +++++++++++ > > > > > > =C2=A03 files changed, 42 insertions(+), 43 deletions(-) > > > > > > =C2=A0create mode 100644 meta-networking/recipes- > > > > > > support/mctp/mctp.inc > > > > > > =C2=A0create mode 100644 meta-networking/recipes- > > > > > > support/mctp/mctpd_2.5.bb > > > > > >=20 > > > > > > diff --git a/meta-networking/recipes-support/mctp/mctp.inc > > > > > > b/meta- > > > > > > networking/recipes-support/mctp/mctp.inc > > > > > > new file mode 100644 > > > > > > index 0000000000..98225cffea > > > > > > --- /dev/null > > > > > > +++ b/meta-networking/recipes-support/mctp/mctp.inc > > > > > > @@ -0,0 +1,11 @@ > > > > > > +HOMEPAGE =3D "http://www.github.com/CodeConstruct/mctp" > > > > > > +SECTION =3D "net" > > > > > > +LICENSE =3D "GPL-2.0-only" > > > > > > +LIC_FILES_CHKSUM =3D > > > > > > "file://LICENSE;md5=3D4cc91856b08b094b4f406a29dc61db21" > > > > > > + > > > > > > +SRC_URI =3D > > > > > > "git://github.com/CodeConstruct/mctp;branch=3Dmain;protocol=3Dh > > > > > > ttps > > > > > > ;tag > > > > > > =3Dv${PV}" > > > > > > +SRCREV =3D "07c7a5d526f686da89bc9ae9cad917e46652b272" > > > > > > + > > > > > > +inherit meson pkgconfig > > > > > > + > > > > > > +EXTRA_OEMESON =3D "-Dtests=3Dfalse" > > > > > > diff --git a/meta-networking/recipes- > > > > > > support/mctp/mctp_2.5.bb > > > > > > b/meta-networking/recipes-support/mctp/mctp_2.5.bb > > > > > > index a8787d3f2b..5811495c66 100644 > > > > > > --- a/meta-networking/recipes-support/mctp/mctp_2.5.bb > > > > > > +++ b/meta-networking/recipes-support/mctp/mctp_2.5.bb > > > > > > @@ -1,45 +1,5 @@ > > > > > > -SUMMARY =3D "Management Component Control Protocol > > > > > > utilities" > > > > > > -HOMEPAGE =3D "http://www.github.com/CodeConstruct/mctp" > > > > > > -SECTION =3D "net" > > > > > > -LICENSE =3D "GPL-2.0-only" > > > > > > +require mctp.inc > > > > > >=20 > > > > > > -LIC_FILES_CHKSUM =3D > > > > > > "file://LICENSE;md5=3D4cc91856b08b094b4f406a29dc61db21" > > > > > > +SUMMARY =3D "Management Component Transport Protocol (MCTP) > > > > > > utilities" > > > > > >=20 > > > > > > -SRCREV =3D "07c7a5d526f686da89bc9ae9cad917e46652b272" > > > > > > - > > > > > > -SRC_URI =3D > > > > > > "git://github.com/CodeConstruct/mctp;branch=3Dmain;protocol=3Dh > > > > > > ttps > > > > > > ;tag > > > > > > =3Dv${PV}" > > > > > > - > > > > > > - > > > > > > -inherit meson pkgconfig systemd > > > > > > - > > > > > > -EXTRA_OEMESON =3D " \ > > > > > > -=C2=A0 =C2=A0 -Dtests=3Dfalse \ > > > > > > -" > > > > > > - > > > > > > -PACKAGECONFIG ??=3D " \ > > > > > > -=C2=A0 =C2=A0 ${@bb.utils.filter('DISTRO_FEATURES', 'systemd',= d)} \ > > > > > > -" > > > > > > - > > > > > > -# mctpd will only be built if pkg-config detects > > > > > > libsystemd; > > > > > > in > > > > > > which case > > > > > > -# we'll want to declare the dep and install the service. > > > > > > -PACKAGECONFIG[systemd] =3D ",,systemd,libsystemd" > > > > > > -SYSTEMD_SERVICE:${PN} =3D "mctpd.service mctp.target mctp- > > > > > > local.target" > > > > > > -SYSTEMD_AUTO_ENABLE:${PN} =3D "enable" > > > > > > - > > > > > > -do_install:append () { > > > > > > -=C2=A0 =C2=A0 if ${@bb.utils.contains('PACKAGECONFIG', 'system= d', > > > > > > 'true', > > > > > > 'false', d)}; then > > > > > > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 install -d ${D}${systemd_system_un= itdir} > > > > > > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 install -m 0644 ${S}/conf/mctpd.se= rvice \ > > > > > > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > > > > > > ${D}${systemd_system_unitdir}/mctpd.service > > > > > > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 install -m 0644 ${S}/conf/*.target= \ > > > > > > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ${D}${= systemd_system_unitdir}/ > > > > > > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 install -d ${D}${datadir}/dbus-1/s= ystem.d > > > > > > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 install -m 0644 ${S}/conf/mctpd-db= us.conf \ > > > > > > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ${D}${= datadir}/dbus-1/system.d/mctpd.conf > > > > > > -=C2=A0 =C2=A0 fi > > > > > > -} > > > > > > - > > > > > > -FILES:${PN} +=3D " \ > > > > > > -=C2=A0 =C2=A0 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd= ', \ > > > > > > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 '${datadir}/dbus-1/s= ystem.d/mctpd.conf', '', > > > > > > d)} \ > > > > > > -" > > > > > > +MESON_TARGET =3D "mctp mctp-client" > > > > > > diff --git a/meta-networking/recipes- > > > > > > support/mctp/mctpd_2.5.bb > > > > > > b/meta-networking/recipes-support/mctp/mctpd_2.5.bb > > > > > > new file mode 100644 > > > > > > index 0000000000..f049be646b > > > > > > --- /dev/null > > > > > > +++ b/meta-networking/recipes-support/mctp/mctpd_2.5.bb > > > > > > @@ -0,0 +1,28 @@ > > > > > > +require mctp.inc > > > > > > + > > > > > > +SUMMARY =3D "Management Component Transport Protocol (MCTP) > > > > > > control > > > > > > protocol daemon" > > > > > > + > > > > > > +inherit systemd > > > > > > + > > > > > > +do_install:append () { > > > > > > +=C2=A0 =C2=A0 install -d ${D}${systemd_system_unitdir} > > > > > > +=C2=A0 =C2=A0 install -m 0644 ${S}/conf/mctpd.service \ > > > > > > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ${D}${systemd_system= _unitdir}/mctpd.service > > > > > > +=C2=A0 =C2=A0 install -m 0644 ${S}/conf/*.target \ > > > > > > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ${D}${systemd_system= _unitdir}/ > > > > > > +=C2=A0 =C2=A0 install -d ${D}${datadir}/dbus-1/system.d > > > > > > +=C2=A0 =C2=A0 install -m 0644 ${S}/conf/mctpd-dbus.conf \ > > > > > > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ${D}${datadir}/dbus-= 1/system.d/mctpd.conf > > > > > > +} > > > > > > + > > > > > > +SYSTEMD_SERVICE:${PN} =3D "mctpd.service mctp.target mctp- > > > > > > local.target" > > > > > > + > > > > > > +DEPENDS +=3D "systemd" > > > > > > + > > > > > > +# Meson adds mctp utility binaries to FILES and > > > > > > do_install(), > > > > > > which cannot be > > > > > > +# overriden by MESON_TARGET. Override FILES and remove > > > > > > binaries to > > > > > > correct. > > > > > > +FILES:${PN} =3D "${datadir}/dbus-1/system.d/mctpd.conf > > > > > > ${sbindir}/mctpd" > > > > > > + > > > > > > +do_install:append () { > > > > > > +=C2=A0 =C2=A0 rm -r ${D}${bindir} > > > > > > +}