From: James Lee <james@codeconstruct.com.au>
To: Khem Raj <raj.khem@gmail.com>
Cc: openembedded-devel@lists.openembedded.org,
andrew@codeconstruct.com.au, jk@codeconstruct.com.au
Subject: Re: [oe] [meta-networking] [PATCH v2 1/2] mctp: split mctp tools and mctpd into separate recipes
Date: Fri, 14 Aug 2026 13:22:07 +0800 [thread overview]
Message-ID: <1fad84121fc6874e9ee1374bd87d8f35b5da5ee7.camel@codeconstruct.com.au> (raw)
In-Reply-To: <CAMKF1srfUdNC=gxPzeEKZmRK9msT3wEUKJpJfFi8o4i7B5GqSg@mail.gmail.com>
On Thu, 2026-08-13 at 22:15 -0700, Khem Raj wrote:
>
>
> On Thu, Aug 13, 2026 at 9:53 PM James Lee
> <james@codeconstruct.com.au> wrote:
> > On Thu, 2026-08-13 at 21:45 -0700, Khem Raj wrote:
> > >
> > >
> > > On Thu, Aug 13, 2026 at 9:14 PM James Lee
> > > <james@codeconstruct.com.au> wrote:
> > > > I believe that would work, but think it's important to have a
> > > > clear
> > > > split at this point.
> > > >
> > > > 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.
> > > >
> > >
> > >
> > > The output can be packaged to be more granular such that daemon
> > > goes
> > > into
> > > package of its own, would that work ?
> > >
> >
> > I believe that would break the inherit_defer approach?
> >
>
>
> Cant be sure. Looking forward to you experiment with it :)
>
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.
> >
> > > >
> > > > On Thu, 2026-08-13 at 06:53 -0700, Khem Raj wrote:
> > > > > Can we do something like
> > > > > inherit_defer ${@bb.utils.contains('DISTRO_FEATURES',
> > > > > 'systemd',
> > > > > 'useradd', '', d)}
> > > > >
> > > > > On Tue, Aug 11, 2026 at 12:25 AM James Lee via
> > > > > lists.openembedded.org
> > > > > <james=codeconstruct.com.au@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.
> > > > > >
> > > > > > 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.
> > > > > >
> > > > > > 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".
> > > > > >
> > > > > > 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.
> > > > > >
> > > > > > Signed-off-by: James Lee james@codeconstruct.com.au
> > > > > > ---
> > > > > > meta-networking/recipes-support/mctp/mctp.inc | 11 +++++
> > > > > > .../recipes-support/mctp/mctp_2.5.bb | 46 ++-----
> > > > > > ----
> > > > > > ----
> > > > > > ----
> > > > > > .../recipes-support/mctp/mctpd_2.5.bb | 28
> > > > > > +++++++++++
> > > > > > 3 files changed, 42 insertions(+), 43 deletions(-)
> > > > > > create mode 100644 meta-networking/recipes-
> > > > > > support/mctp/mctp.inc
> > > > > > create mode 100644 meta-networking/recipes-
> > > > > > support/mctp/mctpd_2.5.bb
> > > > > >
> > > > > > 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 = "http://www.github.com/CodeConstruct/mctp"
> > > > > > +SECTION = "net"
> > > > > > +LICENSE = "GPL-2.0-only"
> > > > > > +LIC_FILES_CHKSUM =
> > > > > > "file://LICENSE;md5=4cc91856b08b094b4f406a29dc61db21"
> > > > > > +
> > > > > > +SRC_URI =
> > > > > > "git://github.com/CodeConstruct/mctp;branch=main;protocol=h
> > > > > > ttps
> > > > > > ;tag
> > > > > > =v${PV}"
> > > > > > +SRCREV = "07c7a5d526f686da89bc9ae9cad917e46652b272"
> > > > > > +
> > > > > > +inherit meson pkgconfig
> > > > > > +
> > > > > > +EXTRA_OEMESON = "-Dtests=false"
> > > > > > 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 = "Management Component Control Protocol
> > > > > > utilities"
> > > > > > -HOMEPAGE = "http://www.github.com/CodeConstruct/mctp"
> > > > > > -SECTION = "net"
> > > > > > -LICENSE = "GPL-2.0-only"
> > > > > > +require mctp.inc
> > > > > >
> > > > > > -LIC_FILES_CHKSUM =
> > > > > > "file://LICENSE;md5=4cc91856b08b094b4f406a29dc61db21"
> > > > > > +SUMMARY = "Management Component Transport Protocol (MCTP)
> > > > > > utilities"
> > > > > >
> > > > > > -SRCREV = "07c7a5d526f686da89bc9ae9cad917e46652b272"
> > > > > > -
> > > > > > -SRC_URI =
> > > > > > "git://github.com/CodeConstruct/mctp;branch=main;protocol=h
> > > > > > ttps
> > > > > > ;tag
> > > > > > =v${PV}"
> > > > > > -
> > > > > > -
> > > > > > -inherit meson pkgconfig systemd
> > > > > > -
> > > > > > -EXTRA_OEMESON = " \
> > > > > > - -Dtests=false \
> > > > > > -"
> > > > > > -
> > > > > > -PACKAGECONFIG ??= " \
> > > > > > - ${@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] = ",,systemd,libsystemd"
> > > > > > -SYSTEMD_SERVICE:${PN} = "mctpd.service mctp.target mctp-
> > > > > > local.target"
> > > > > > -SYSTEMD_AUTO_ENABLE:${PN} = "enable"
> > > > > > -
> > > > > > -do_install:append () {
> > > > > > - if ${@bb.utils.contains('PACKAGECONFIG', 'systemd',
> > > > > > 'true',
> > > > > > 'false', d)}; then
> > > > > > - install -d ${D}${systemd_system_unitdir}
> > > > > > - install -m 0644 ${S}/conf/mctpd.service \
> > > > > > -
> > > > > > ${D}${systemd_system_unitdir}/mctpd.service
> > > > > > - install -m 0644 ${S}/conf/*.target \
> > > > > > - ${D}${systemd_system_unitdir}/
> > > > > > - install -d ${D}${datadir}/dbus-1/system.d
> > > > > > - install -m 0644 ${S}/conf/mctpd-dbus.conf \
> > > > > > - ${D}${datadir}/dbus-1/system.d/mctpd.conf
> > > > > > - fi
> > > > > > -}
> > > > > > -
> > > > > > -FILES:${PN} += " \
> > > > > > - ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', \
> > > > > > - '${datadir}/dbus-1/system.d/mctpd.conf', '',
> > > > > > d)} \
> > > > > > -"
> > > > > > +MESON_TARGET = "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 = "Management Component Transport Protocol (MCTP)
> > > > > > control
> > > > > > protocol daemon"
> > > > > > +
> > > > > > +inherit systemd
> > > > > > +
> > > > > > +do_install:append () {
> > > > > > + install -d ${D}${systemd_system_unitdir}
> > > > > > + install -m 0644 ${S}/conf/mctpd.service \
> > > > > > + ${D}${systemd_system_unitdir}/mctpd.service
> > > > > > + install -m 0644 ${S}/conf/*.target \
> > > > > > + ${D}${systemd_system_unitdir}/
> > > > > > + install -d ${D}${datadir}/dbus-1/system.d
> > > > > > + install -m 0644 ${S}/conf/mctpd-dbus.conf \
> > > > > > + ${D}${datadir}/dbus-1/system.d/mctpd.conf
> > > > > > +}
> > > > > > +
> > > > > > +SYSTEMD_SERVICE:${PN} = "mctpd.service mctp.target mctp-
> > > > > > local.target"
> > > > > > +
> > > > > > +DEPENDS += "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} = "${datadir}/dbus-1/system.d/mctpd.conf
> > > > > > ${sbindir}/mctpd"
> > > > > > +
> > > > > > +do_install:append () {
> > > > > > + rm -r ${D}${bindir}
> > > > > > +}
next prev parent reply other threads:[~2026-08-14 5:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 7:25 [oe] [meta-networking] [PATCH v2 1/2] mctp: split mctp tools and mctpd into separate recipes James Lee
2026-08-11 7:25 ` [oe] [meta-networking] [PATCH v2 2/2] mctp: upgrade 2.5 -> 2.6 James Lee
2026-08-13 13:56 ` Khem Raj
2026-08-13 13:53 ` [oe] [meta-networking] [PATCH v2 1/2] mctp: split mctp tools and mctpd into separate recipes Khem Raj
2026-08-14 4:14 ` James Lee
2026-08-14 4:45 ` Khem Raj
2026-08-14 4:53 ` James Lee
2026-08-14 5:15 ` Khem Raj
2026-08-14 5:22 ` James Lee [this message]
2026-08-14 5:42 ` Khem Raj
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=1fad84121fc6874e9ee1374bd87d8f35b5da5ee7.camel@codeconstruct.com.au \
--to=james@codeconstruct.com.au \
--cc=andrew@codeconstruct.com.au \
--cc=jk@codeconstruct.com.au \
--cc=openembedded-devel@lists.openembedded.org \
--cc=raj.khem@gmail.com \
/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.