From: Norbert Lange Date: Thu, 6 Feb 2020 10:40:39 +0100 Subject: [Buildroot] [PATCH] package/dbusbroker: new package Message-ID: <20200206094040.251684-1-nolange79@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net Add dbus-broker, which is a drop-in replacement for the dbus-daemon. Its possible to use this package standalone (without the dbus package - if the dependency from systemd package is removed). This is sufficient to provides systemd's (d)bus functionality. For this usecase, the necessary config files are copied over from dbus. Signed-off-by: Norbert Lange --- DEVELOPERS | 1 + package/Config.in | 1 + package/dbusbroker/Config.in | 23 ++++++ package/dbusbroker/dbus.socket | 5 ++ package/dbusbroker/dbusbroker.hash | 3 + package/dbusbroker/dbusbroker.mk | 41 ++++++++++ package/dbusbroker/session.conf | 65 ++++++++++++++++ package/dbusbroker/system.conf | 120 +++++++++++++++++++++++++++++ 8 files changed, 259 insertions(+) create mode 100644 package/dbusbroker/Config.in create mode 100644 package/dbusbroker/dbus.socket create mode 100644 package/dbusbroker/dbusbroker.hash create mode 100644 package/dbusbroker/dbusbroker.mk create mode 100644 package/dbusbroker/session.conf create mode 100644 package/dbusbroker/system.conf diff --git a/DEVELOPERS b/DEVELOPERS index d8ea23e0b3..a4790aab3c 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1840,6 +1840,7 @@ F: package/tpm-tools/ F: package/trousers/ N: Norbert Lange +F: package/dbusbroker/ F: package/tcf-agent/ N: Nylon Chen diff --git a/package/Config.in b/package/Config.in index bad4f9cba6..f81fbab9fe 100644 --- a/package/Config.in +++ b/package/Config.in @@ -433,6 +433,7 @@ endmenu source "package/dbus-glib/Config.in" source "package/dbus-python/Config.in" source "package/dbus-triggerd/Config.in" + source "package/dbusbroker/Config.in" source "package/dfu-util/Config.in" source "package/dmidecode/Config.in" source "package/dmraid/Config.in" diff --git a/package/dbusbroker/Config.in b/package/dbusbroker/Config.in new file mode 100644 index 0000000000..aa628b4d5b --- /dev/null +++ b/package/dbusbroker/Config.in @@ -0,0 +1,23 @@ +config BR2_PACKAGE_DBUSBROKER + bool "dbusbroker" + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_USE_MMU + depends on BR2_INIT_SYSTEMD + select BR2_PACKAGE_EXPAT + select BR2_PACKAGE_SYSTEMD + help + Linux D-Bus Message Broker. + + 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. + + https://github.com/bus1/dbus-broker/wiki + +comment "dbusbroker needs a toolchain w/ threads" + depends on BR2_USE_MMU + depends on !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/dbusbroker/dbus.socket b/package/dbusbroker/dbus.socket new file mode 100644 index 0000000000..5c373cf450 --- /dev/null +++ b/package/dbusbroker/dbus.socket @@ -0,0 +1,5 @@ +[Unit] +Description=D-Bus System Message Bus Socket + +[Socket] +ListenStream=/run/dbus/system_bus_socket diff --git a/package/dbusbroker/dbusbroker.hash b/package/dbusbroker/dbusbroker.hash new file mode 100644 index 0000000000..e198cd119d --- /dev/null +++ b/package/dbusbroker/dbusbroker.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 6fff9a831a514659e2c7d704e76867ce31ebcf43e8d7a62e080c6656f64cd39e dbus-broker-21.tar.xz +sha256 3cda3630283eda0eab825abe5ac84d191248c6b3fe1c232a118124959b96c6a4 LICENSE diff --git a/package/dbusbroker/dbusbroker.mk b/package/dbusbroker/dbusbroker.mk new file mode 100644 index 0000000000..ee69b3ab65 --- /dev/null +++ b/package/dbusbroker/dbusbroker.mk @@ -0,0 +1,41 @@ +################################################################################ +# +# dbusbroker +# +# Launching services is delegated to systemd so there is very little else +# needed. No separate user is necessary and no helper for launching. +# +# Service + Config files were copied over from dbus, +# uneeded / unecessary entries removed for clarity. +# +################################################################################ + +DBUSBROKER_VERSION = 21 +DBUSBROKER_SOURCE = dbus-broker-$(DBUSBROKER_VERSION).tar.xz +DBUSBROKER_SITE = https://github.com/bus1/dbus-broker/releases/download/v$(DBUSBROKER_VERSION) + +DBUSBROKER_LICENSE = Apache-2.0 +DBUSBROKER_LICENSE_FILES = LICENSE +# Compatibility Launcher requires this +DBUSBROKER_DEPENDENCIES += expat systemd + +ifeq ($(BR2_PACKAGE_LIBSELINUX),y) +DBUSBROKER_DEPENDENCIES += libselinux +DBUSBROKER_CONF_OPTS += -Dselinux=true +else +DBUSBROKER_CONF_OPTS += -Dselinux=false +endif + +# Only install config and service files if dbus is not available +ifeq ($(BR2_PACKAGE_DBUS),) +define DBUSBROKER_INSTALL_TARGET_POST + $(INSTALL) -D -m644 $(DBUSBROKER_PKGDIR)/dbus.socket $(TARGET_DIR)/usr/lib/systemd/system/dbus.socket + ln -sf ../dbus.socket $(TARGET_DIR)/usr/lib/systemd/system/sockets.target.wants/dbus.socket + $(INSTALL) -D -m644 $(DBUSBROKER_PKGDIR)/session.conf $(TARGET_DIR)/usr/share/dbus-1/session.conf + $(INSTALL) -D -m644 $(DBUSBROKER_PKGDIR)/system.conf $(TARGET_DIR)/usr/share/dbus-1/system.conf +endef + +DBUSBROKER_POST_INSTALL_TARGET_HOOKS += DBUSBROKER_INSTALL_TARGET_POST +endif + +$(eval $(meson-package)) diff --git a/package/dbusbroker/session.conf b/package/dbusbroker/session.conf new file mode 100644 index 0000000000..e4758fa218 --- /dev/null +++ b/package/dbusbroker/session.conf @@ -0,0 +1,65 @@ + + + + + + session + + + + + + + + + + + + + + + + + session.d + + /etc/dbus-1/session.d + + + /etc/dbus-1/session-local.conf + + contexts/dbus_contexts + + + + + 1000000000 + 250000000 + 1000000000 + 250000000 + 1000000000 + + 120000 + 240000 + 150000 + 100000 + 10000 + 100000 + 10000 + 50000 + 50000 + 50000 + + diff --git a/package/dbusbroker/system.conf b/package/dbusbroker/system.conf new file mode 100644 index 0000000000..a1e8df7367 --- /dev/null +++ b/package/dbusbroker/system.conf @@ -0,0 +1,120 @@ + + + + + + + + + system + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + system.d + + /etc/dbus-1/system.d + + + /etc/dbus-1/system-local.conf + + contexts/dbus_contexts + + -- 2.24.1