From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 18 Dec 2024 09:02:25 +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 1tNp0i-009YTM-2S for lore@lore.pengutronix.de; Wed, 18 Dec 2024 09:02:25 +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 1tNp0i-0002BN-Pg; Wed, 18 Dec 2024 09:02:24 +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 1tNp0O-0002B4-U2; Wed, 18 Dec 2024 09:02:04 +0100 Received: from dude06.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::5c]) 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 1tNp0N-003zsp-39; Wed, 18 Dec 2024 09:02:04 +0100 Received: from rsc by dude06.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1tNp0O-00CD0m-2D; Wed, 18 Dec 2024 09:02:04 +0100 From: Robert Schwebel To: ptxdist@pengutronix.de Date: Wed, 18 Dec 2024 09:01:59 +0100 Message-Id: <20241218080159.2909891-1-r.schwebel@pengutronix.de> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [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: Michael Olbrich , Robert Schwebel 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 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 ++++++++++++++++++ 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 @@ + + + + + + + + + system + + + messagebus + + + + + + + + + /usr/libexec/dbus-daemon-launch-helper + + + /run/dbus/pid + + + + + + EXTERNAL + + + unix:path=/run/dbus/system_bus_socket + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /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 @$(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) @$(call install_copy, dbus, 0, 0, 0644, -, \ /usr/lib/systemd/system/dbus.service) -- 2.39.5