From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 17 Jan 2025 17:36:59 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tYpL8-0015At-1z for lore@lore.pengutronix.de; Fri, 17 Jan 2025 17:36:59 +0100 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1tYpL8-0001oL-VR; Fri, 17 Jan 2025 17:36:58 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tYpKx-0001o7-Ib; Fri, 17 Jan 2025 17:36:47 +0100 Received: from dude05.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::54]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tYpKx-000SUI-1G; Fri, 17 Jan 2025 17:36:47 +0100 Received: from mol by dude05.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1tYpKx-0062Lj-17; Fri, 17 Jan 2025 17:36:47 +0100 Date: Fri, 17 Jan 2025 17:36:47 +0100 From: Michael Olbrich To: Robert Schwebel Message-ID: References: <20241218080159.2909891-1-r.schwebel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241218080159.2909891-1-r.schwebel@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain Subject: Re: [ptxdist] [PATCH] dbus-broker: replacement dbus daemon X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false On Wed, Dec 18, 2024 at 09:01:59AM +0100, Robert Schwebel wrote: > From: Michael Olbrich > > dbus-broker has meanwhile evolved as an alternative to the standard dbus > daemon. Since its beginning, it has for example been long used in > Fedora, and Debian has it as an alternative implementation. So let's try > it in ptxdist as well. > > Signed-off-by: Michael Olbrich > [various version bumps, added sysroot mechanics for newer versions] > Signed-off-by: Robert Schwebel > --- > .../usr/lib/systemd/system/dbus.socket | 5 + > projectroot/usr/share/dbus-1/system.conf | 140 ++++++++++++++++++ Hmm, I'm pretty sure, that these files will be used by the dbus package as well. And they are just copies, because the dbus-broker does not provide its own versions, right? We need a better solution for this. > rules/dbus-broker.in | 17 +++ > rules/dbus-broker.make | 86 +++++++++++ > rules/dbus.in | 10 ++ > rules/dbus.make | 6 +- > 6 files changed, 262 insertions(+), 2 deletions(-) > create mode 100644 projectroot/usr/lib/systemd/system/dbus.socket > create mode 100644 projectroot/usr/share/dbus-1/system.conf > create mode 100644 rules/dbus-broker.in > create mode 100644 rules/dbus-broker.make > > diff --git a/projectroot/usr/lib/systemd/system/dbus.socket b/projectroot/usr/lib/systemd/system/dbus.socket > new file mode 100644 > index 000000000..0303bfbde > --- /dev/null > +++ b/projectroot/usr/lib/systemd/system/dbus.socket > @@ -0,0 +1,5 @@ > +[Unit] > +Description=D-Bus System Message Bus Socket > + > +[Socket] > +ListenStream=/var/run/dbus/system_bus_socket > diff --git a/projectroot/usr/share/dbus-1/system.conf b/projectroot/usr/share/dbus-1/system.conf > new file mode 100644 > index 000000000..fb1526a4b > --- /dev/null > +++ b/projectroot/usr/share/dbus-1/system.conf > @@ -0,0 +1,140 @@ > + > + > + > + > + + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> > + > + > + > + system > + > + > + messagebus > + > + > + > + > + > + > + > + > + /usr/libexec/dbus-daemon-launch-helper > + > + > + /run/dbus/pid > + > + > + > + > + > + EXTERNAL > + > + > + unix:path=/run/dbus/system_bus_socket > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + + send_interface="org.freedesktop.DBus" /> > + + send_interface="org.freedesktop.DBus.Introspectable"/> > + + send_interface="org.freedesktop.DBus.Properties"/> > + > + + send_interface="org.freedesktop.DBus" > + send_member="UpdateActivationEnvironment"/> > + + send_interface="org.freedesktop.DBus.Debug.Stats"/> > + + send_interface="org.freedesktop.systemd1.Activator"/> > + > + > + > + > + + send_interface="org.freedesktop.systemd1.Activator"/> > + > + > + > + > + + send_interface="org.freedesktop.DBus.Monitoring"/> > + > + > + > + > + + send_interface="org.freedesktop.DBus.Debug.Stats"/> > + > + > + > + /etc/dbus-1/system.conf > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + system.d > + > + /etc/dbus-1/system.d > + > + > + /etc/dbus-1/system-local.conf > + > + contexts/dbus_contexts > + > + > diff --git a/rules/dbus-broker.in b/rules/dbus-broker.in > new file mode 100644 > index 000000000..839a99246 > --- /dev/null > +++ b/rules/dbus-broker.in > @@ -0,0 +1,17 @@ > +## SECTION=middleware > + > +config DBUS_BROKER > + tristate > + depends on INITMETHOD_SYSTEMD > + select HOST_MESON > + select EXPAT > + select SYSTEMD > + select DBUS_NO_DAEMON if DBUS > + prompt "dbus-broker" > + help > + The dbus-broker project is an implementation of a message bus as > + defined by the D-Bus specification. Its aim is to provide high > + performance and reliability, while keeping compatibility to the D-Bus > + reference implementation. It is exclusively written for linux systems, > + and makes use of many modern features provided by recent linux kernel > + releases. > diff --git a/rules/dbus-broker.make b/rules/dbus-broker.make > new file mode 100644 > index 000000000..ffb9a9e9c > --- /dev/null > +++ b/rules/dbus-broker.make > @@ -0,0 +1,86 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2018 by Michael Olbrich > +# > +# See CREDITS for details about who has contributed to this project. > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +# > +# We provide this package > +# > +PACKAGES-$(PTXCONF_DBUS_BROKER) += dbus-broker > + > +# > +# Paths and names > +# > +DBUS_BROKER_VERSION := 36 > +DBUS_BROKER_MD5 := 0398b41a250a6172e35750fc864ee33b > +DBUS_BROKER := dbus-broker-$(DBUS_BROKER_VERSION) > +DBUS_BROKER_SUFFIX := tar.xz > +DBUS_BROKER_URL := https://github.com/bus1/dbus-broker/releases/download/v$(DBUS_BROKER_VERSION)/$(DBUS_BROKER).$(DBUS_BROKER_SUFFIX) > +DBUS_BROKER_SOURCE := $(SRCDIR)/$(DBUS_BROKER).$(DBUS_BROKER_SUFFIX) > +DBUS_BROKER_DIR := $(BUILDDIR)/$(DBUS_BROKER) > +DBUS_BROKER_LICENSE := Apache-2.0 > + > +# ---------------------------------------------------------------------------- > +# Prepare > +# ---------------------------------------------------------------------------- > + > +# host path leaks in if not set explicitly > +DBUS_BROKER_CONF_ENV := \ > + $(CROSS_ENV) \ > + PTXDIST_PKG_CONFIG_VAR_NO_SYSROOT="systemdsystemunitdir systemduserunitdir catalogdir" > + > +# > +# meson > +# > +DBUS_BROKER_CONF_TOOL := meson > +DBUS_BROKER_CONF_OPT := \ > + $(CROSS_MESON_USR) \ > + -Daudit=false \ > + -Dc-shquote:reference-test=false \ > + -Ddocs=false \ > + -Dlauncher=true \ > + -Dreference-test=false \ > + -Dselinux=false \ > + -Dsystem-console-users="[]" > + > +# ---------------------------------------------------------------------------- > +# Target-Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/dbus-broker.targetinstall: > + @$(call targetinfo) > + > + @$(call install_init, dbus-broker) > + @$(call install_fixup, dbus-broker,PRIORITY,optional) > + @$(call install_fixup, dbus-broker,SECTION,base) > + @$(call install_fixup, dbus-broker,AUTHOR,"Michael Olbrich ") > + @$(call install_fixup, dbus-broker,DESCRIPTION,missing) > + > + @$(call install_copy, dbus-broker, 0, 0, 0755, -, \ > + /usr/bin/dbus-broker) > + @$(call install_copy, dbus-broker, 0, 0, 0755, -, \ > + /usr/bin/dbus-broker-launch) > + > + @$(call install_alternative, dbus-broker, 0, 0, 0644, \ > + /usr/share/dbus-1/system.conf) > + > + @$(call install_copy, dbus-broker, 0, 0, 0644, -, \ > + /usr/lib/systemd/system/dbus-broker.service) > + @$(call install_link, dbus-broker, dbus-broker.service, \ > + /usr/lib/systemd/system/dbus.service) > + > + @$(call install_alternative, dbus-broker, 0, 0, 0644, \ > + /usr/lib/systemd/system/dbus.socket) > + @$(call install_link, dbus-broker, ../dbus.socket, \ > + /usr/lib/systemd/system/sockets.target.wants/dbus.socket) > + > + @$(call install_finish, dbus-broker) > + > + @$(call touch) > + > +# vim: syntax=make > diff --git a/rules/dbus.in b/rules/dbus.in > index b205ee62f..c8b5f09be 100644 > --- a/rules/dbus.in > +++ b/rules/dbus.in > @@ -32,6 +32,14 @@ config DBUS_SELINUX > depends on BROKEN > bool > > +config DBUS_NO_DAEMON > + bool > + > +comment "D-Bus daemon is provided by dbus-broker" > + depends on DBUS_NO_DAEMON > + > +if !DBUS_NO_DAEMON > + > config DBUS_SYSTEMD > bool > default INITMETHOD_SYSTEMD > @@ -60,3 +68,5 @@ config DBUS_SYSTEMD_USER_UNIT > depends on SYSTEMD_UNITS_USER && DBUS_SYSTEMD_UNIT > > endif > + > +endif > diff --git a/rules/dbus.make b/rules/dbus.make > index f2bc7b552..dffa0ab6f 100644 > --- a/rules/dbus.make > +++ b/rules/dbus.make > @@ -89,6 +89,7 @@ $(STATEDIR)/dbus.targetinstall: > @$(call install_fixup, dbus,AUTHOR,"Roland Hostettler ") > @$(call install_fixup, dbus,DESCRIPTION,missing) > > +ifndef PTXCONF_DBUS_NO_DAEMON dbus has a -Dmessage_bus= option to disable the daemon. And we can probably disable tools as well. > @$(call install_copy, dbus, 0, 0, 0755, -, \ > /usr/bin/dbus-daemon) > @$(call install_copy, dbus, 0, 0, 0755, -, \ > @@ -105,14 +106,17 @@ $(STATEDIR)/dbus.targetinstall: > /usr/bin/dbus-uuidgen) > @$(call install_copy, dbus, 0, 104, 4754, -, \ > /usr/libexec/dbus-daemon-launch-helper) > +endif > > @$(call install_lib, dbus, 0, 0, 0644, libdbus-1) > > # # > # # install config files > # # > +ifndef PTXCONF_DBUS_NO_DAEMON > @$(call install_alternative, dbus, 0, 0, 0644, /usr/share/dbus-1/system.conf) > @$(call install_alternative, dbus, 0, 0, 0644, /usr/share/dbus-1/session.conf) > +endif > > # # > # # busybox init: start script > @@ -132,8 +136,6 @@ ifdef PTXCONF_DBUS_SYSTEMD_UNIT > /usr/lib/systemd/system/dbus.socket) > @$(call install_link, dbus, ../dbus.socket, \ > /usr/lib/systemd/system/sockets.target.wants/dbus.socket) > - @$(call install_link, dbus, ../dbus.socket, \ > - /usr/lib/systemd/system/dbus.target.wants/dbus.socket) This looks strange, why is this hunk here? Michael > > @$(call install_copy, dbus, 0, 0, 0644, -, \ > /usr/lib/systemd/system/dbus.service) > -- > 2.39.5 > > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |