Hello Bartosz! Thanks lot for your massive efforts!
Just few questions below... On Wed, 2024-10-23 at 11:43 +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski <[email protected]> > > This is a big update for libgpiod bringing in the D-Bus daemon and its > command-line client. This is why the patch is pretty hefty. The majority > of the line count comes from the removed patch that is now upstream but > the v2.2 recipe also now contains a lot of bits and pieces that make the > D-Bus daemon work both with system as well as sysvinit. > > The project now packages the systemd service and udev rules that allow > the manager to run under its own user in a well sandboxed environment > but the sysvsinit script is carried in the recipe as I don't want to > put support for legacy systems in libgpiod repo. > > The patch also updates the ptests for libgpiod to run three new > test-suites: one for GLib bindings, one for the command-line D-Bus > client and finally one testing some daemon corner-cases not supported by > the client. > > Build tested with various config options with systemd and sysvinit (the > latter with glibc and musl) on 32- and 64-bit architectures. > > The complete changelog since v2.1 (taken verbatim from the NEWS file) is > below: > > libgpiod v2.2 > ============= > > New features: > - add GObject bindings with introspection > - add a D-Bus interface to libgpiod together with a daemon implementing it and > a command-line client > - split out the common shell test code for gpio-tools into a reusable test > harness for GPIO command-line tools > - add minutes as a new supported time unit for tools and allow longer periods > for timeouts, line holding, etc. > - add a script for generating sdist and wheels for python bindings > - migrate C++ tests to using Catch2 v3 [] > diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb > b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb > new file mode 100644 > index 000000000..5f627ce28 > --- /dev/null > +++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb > @@ -0,0 +1,98 @@ > +require libgpiod.inc > + > +inherit systemd update-rc.d useradd gobject-introspection > + > +LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & CC-BY-SA-4.0" > +LIC_FILES_CHKSUM = " \ > + > file://LICENSES/GPL-2.0-or-later.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ > + > file://LICENSES/LGPL-2.1-or-later.txt;md5=4b54a1fd55a448865a0b32d41598759d \ > + file://LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \ > +" > + > +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-2.x:" > + > +SRC_URI += "file://gpio-manager.init" > + > +SRC_URI[sha256sum] = > "ee29735890eb1cc0e4b494001da5163d1a9c4735343201d22485db313601ca07" > + > +S = "${UNPACKDIR}/${PN}-2.2" > + > +# Enable all project features for ptest > +PACKAGECONFIG[tests] = " \ > + --enable-tests --enable-tools --enable-bindings-cxx > --enable-bindings-glib --enable-gpioset-interactive --enable-dbus, \ > + --disable-tests, \ > + kmod util-linux glib-2.0 catch2 libedit glib-2.0-native libgudev, \ ^ Would it make sense to append " dbus" above? > + bash glib-2.0-utils libgpiod-manager shunit2 \ > +" > +PACKAGECONFIG[gpioset-interactive] = > "--enable-gpioset-interactive,--disable-gpioset-interactive,libedit" > +PACKAGECONFIG[glib] = > "--enable-bindings-glib,--disable-bindings-glib,glib-2.0 glib-2.0-native" > +PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,glib-2.0 glib-2.0-native > libgudev" ^ Would it make sense to append " dbus" above? > + > +PACKAGES =+ "${PN}-ptest-dev ${PN}-glib ${PN}-manager ${PN}-cli" > +FILES:${PN}-tools += "${bindir}/gpionotify" > +FILES:${PN}-ptest += "${libdir}/libgpiosim.so.*" > +FILES:${PN}-ptest-dev += "${includedir}/gpiosim.h" > +FILES:${PN}-glib += "${libdir}/libgpiod-glib.so.*" > +FILES:${PN}-manager += " \ > + ${bindir}/gpio-manager \ > + ${sysconfdir}/dbus-1/system.d/io.gpiod1.conf \ > + ${datadir}/dbus-1/interfaces/io.gpiod1.xml \ > + ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', > '${systemd_system_unitdir}/gpio-manager.service', '', d)} \ > + ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', > '${sysconfdir}/init.d/gpio-manager', '', d)} \ > +" > +FILES:${PN}-cli += "${bindir}/gpiocli" > + > +RDEPENDS:${PN}-manager += "dbus" Would it make sense to add RDEPENDS:${PN}-cli += "${PN}-manager" ? Or is gpiocli still functional in some way without gpio-manager? > + > +SYSTEMD_PACKAGES = "${PN}-manager" > + > +python __anonymous() { > + distro_features = d.getVar("DISTRO_FEATURES").split() > + packageconfig = d.getVar("PACKAGECONFIG").split() > + pn = d.getVar("PN") > + > + if "systemd" in distro_features and "dbus" in packageconfig: > + d.appendVar("EXTRA_OECONF", " --enable-systemd") Will it make sense to add d.appendVar("DEPENDS", " systemd") build-time dependency? > + # We need to set it conditionally or else the systemd class will look > + # for the file that we don't install with systemd support disabled. > + d.setVar("SYSTEMD_SERVICE:{}-manager".format(pn), > "gpio-manager.service") > + else: > + d.appendVar("EXTRA_OECONF", " --disable-systemd") > +} > + > +UPDATERCPN = "${PN}-manager" > +INITSCRIPT_NAME = "gpio-manager" > +INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 20 0 1 6 ." > + > +USERADD_PACKAGES = "${PN}-manager" > +GROUPADD_PARAM:${PN}-manager = "--system gpio" > +USERADD_PARAM:${PN}-manager = "--system -M -s /bin/nologin -g gpio > gpio-manager" > + > +RDEPENDS:${PN}-ptest += " \ > + ${@bb.utils.contains('PTEST_ENABLED', '1', 'shunit2 bash', '', d)} \ > +" > +RRECOMMENDS:${PN}-ptest += "kernel-module-gpio-sim kernel-module-configfs" > +INSANE_SKIP:${PN}-ptest += "buildpaths" > + > +do_compile:prepend() { > + export GIR_EXTRA_LIBS_PATH="${B}/lib/.libs" > +} > + > +do_install:append() { > + if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', > d)}; then > + install -d ${D}${sysconfdir}/init.d > + install -m 0755 ${UNPACKDIR}/gpio-manager.init > ${D}${sysconfdir}/init.d/gpio-manager > + fi > +} > + > +do_install_ptest:append() { > + install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test > ${D}${PTEST_PATH}/tests/ > + install -m 0755 ${S}/tools/gpio-tools-test.bash ${D}${PTEST_PATH}/tests/ > + install -m 0644 ${S}/tests/scripts/gpiod-bash-test-helper.inc > ${D}${PTEST_PATH}/tests/ > + install -m 0644 ${S}/tests/gpiosim/gpiosim.h ${D}${includedir}/gpiosim.h > + install -m 0755 ${B}/bindings/glib/tests/.libs/gpiod-glib-test > ${D}${PTEST_PATH}/tests/ > + install -m 0755 ${B}/dbus/tests/.libs/gpiodbus-test > ${D}${PTEST_PATH}/tests/ > + install -m 0755 ${S}/dbus/client/gpiocli-test.bash > ${D}${PTEST_PATH}/tests/ > + install -m 0755 ${B}/dbus/manager/.libs/gpio-manager > ${D}${PTEST_PATH}/tests/ > + install -m 0755 ${B}/dbus/client/.libs/gpiocli ${D}${PTEST_PATH}/tests/ > +} -- Alexander Sverdlin Siemens AG www.siemens.com
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#113155): https://lists.openembedded.org/g/openembedded-devel/message/113155 Mute This Topic: https://lists.openembedded.org/mt/109167552/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
