mctp: split mctp tools and mctpd into separate recipes
PATCH v3 1/2 mctp: split mctp tools and mctpd into separate recipes
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. This will allow the mctpd daemon to be installed without the mctp utilities and allow the utilities to be installed without the daemon in distros without systemd. It will also let us express the useradd rules only when they're needed for the mctpd installation in the upcoming version bump.
The mctp/mctpd split cannot be done with different packages within the same recipe. It would require the systemd and useradd classes be added to inherit_defer only when mctpd is to be built, and the library functions cannot be used to detect which packages are built.
--- meta-networking/recipes-support/mctp/mctp.inc | 11 +++++ .../recipes-support/mctp/mctp_2.5.bb | 46 ++----------------- .../recipes-support/mctp/mctpd_2.5.bb | 29 ++++++++++++ 3 files changed, 43 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
meta-networking/recipes-support/mctp/mctp.inc new file +11 -0
@@ -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=https;tag=v${PV}" +SRCREV = "07c7a5d526f686da89bc9ae9cad917e46652b272" + +inherit meson pkgconfig + +EXTRA_OEMESON = "-Dtests=false"
meta-networking/recipes-support/mctp/mctp_2.5.bb +3 -43
48 lines not on this page · raw message
meta-networking/recipes-support/mctp/mctpd_2.5.bb new file +29 -0
@@ -0,0 +1,29 @@ +require mctp.inc + +SUMMARY = "Management Component Transport Protocol (MCTP) control protocol daemon" + +inherit systemd features_check + +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" +REQUIRED_DISTRO_FEATURES = "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} +}
Signature · 1 line
2.47.3
PATCH v3 2/2 mctp: upgrade 2.5 -> 2.6
Bumped mctp and mctp-daemon version to 2.6, and added the new system user to own mctpd's service.
---
meta-networking/recipes-support/mctp/mctp.inc | 2 +-
.../recipes-support/mctp/{mctp_2.5.bb => mctp_2.6.bb} | 0
.../recipes-support/mctp/{mctpd_2.5.bb => mctpd_2.6.bb} | 5 ++++-
3 files changed, 5 insertions(+), 2 deletions(-)
rename meta-networking/recipes-support/mctp/{mctp_2.5.bb => mctp_2.6.bb} (100%)
rename meta-networking/recipes-support/mctp/{mctpd_2.5.bb => mctpd_2.6.bb} (88%)meta-networking/recipes-support/mctp/mctp.inc +1 -1
@@ -4,7 +4,7 @@ LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://LICENSE;md5=4cc91856b08b094b4f406a29dc61db21" SRC_URI = "git://github.com/CodeConstruct/mctp;branch=main;protocol=https;tag=v${PV}" -SRCREV = "07c7a5d526f686da89bc9ae9cad917e46652b272" +SRCREV = "31ac0e86b0e23d32abf34d191653a87a47f3c9a7" inherit meson pkgconfig
meta-networking/recipes-support/mctp/mctp_2.6.bb renamed from meta-networking/recipes-support/mctp/mctp_2.5.bb +0 -0
meta-networking/recipes-support/mctp/mctpd_2.6.bb renamed from meta-networking/recipes-support/mctp/mctpd_2.5.bb +4 -1
@@ -2,7 +2,7 @@ require mctp.inc SUMMARY = "Management Component Transport Protocol (MCTP) control protocol daemon" -inherit systemd features_check +inherit systemd features_check useradd do_install:append () { install -d ${D}${systemd_system_unitdir}
@@ -17,6 +17,9 @@ do_install:append () { SYSTEMD_SERVICE:${PN} = "mctpd.service mctp.target mctp-local.target" +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "-r -U -s /bin/false mctpd" + DEPENDS += "systemd" REQUIRED_DISTRO_FEATURES = "systemd"
Signature · 1 line
2.47.3