diff --git a/DEVELOPERS b/DEVELOPERS index 50a295a743..6944d3129c 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2202,6 +2202,7 @@ F: package/tpm-tools/ F: package/trousers/ N: Norbert Lange +F: package/dbus-broker/ F: package/systemd/ F: package/tcf-agent/ @@ -3015,6 +3016,7 @@ F: package/asterisk/ F: package/cegui/ F: package/dahdi-linux/ F: package/dahdi-tools/ +F: package/dbus-broker/ F: package/dtc/ F: package/dtv-scan-tables/ F: package/dvb-apps/ diff --git a/package/Config.in b/package/Config.in index 174cfde73e..8ecf2295d3 100644 --- a/package/Config.in +++ b/package/Config.in @@ -468,6 +468,7 @@ endmenu source "package/dahdi-tools/Config.in" source "package/davinci-bootcount/Config.in" source "package/dbus/Config.in" + source "package/dbus-broker/Config.in" source "package/dbus-cpp/Config.in" source "package/dbus-cxx/Config.in" source "package/dbus-glib/Config.in" diff --git a/package/dbus-broker/Config.in b/package/dbus-broker/Config.in new file mode 100644 index 0000000000..c7206232da --- /dev/null +++ b/package/dbus-broker/Config.in @@ -0,0 +1,23 @@ +config BR2_PACKAGE_DBUS_BROKER + bool "dbus-broker" + depends on BR2_USE_MMU + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17 + depends on BR2_PACKAGE_SYSTEMD + select BR2_PACKAGE_EXPAT + 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 systemd and a toolchain w/ threads" + depends on BR2_USE_MMU + depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_PACKAGE_SYSTEMD diff --git a/package/dbus-broker/dbus-broker.hash b/package/dbus-broker/dbus-broker.hash new file mode 100644 index 0000000000..26ebab7ac1 --- /dev/null +++ b/package/dbus-broker/dbus-broker.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 4eca425db52b7ab1027153e93fea9b3f11759db9e93ffbf88759b73ddfb8026a dbus-broker-29.tar.xz +sha256 3cda3630283eda0eab825abe5ac84d191248c6b3fe1c232a118124959b96c6a4 LICENSE diff --git a/package/dbus-broker/dbus-broker.mk b/package/dbus-broker/dbus-broker.mk new file mode 100644 index 0000000000..22c5e8d8b7 --- /dev/null +++ b/package/dbus-broker/dbus-broker.mk @@ -0,0 +1,67 @@ +################################################################################ +# +# dbus-broker +# +################################################################################ + +DBUS_BROKER_VERSION = 29 +DBUS_BROKER_SOURCE = dbus-broker-$(DBUS_BROKER_VERSION).tar.xz +DBUS_BROKER_SITE = https://github.com/bus1/dbus-broker/releases/download/v$(DBUS_BROKER_VERSION) + +DBUS_BROKER_LICENSE = \ + Apache-2.0, \ + Apache-2.0 and/or LGPL-2.1+ (c-dvar, c-ini, c-list, c-rbtree, c-shquote, c-stdaux, c-utf8) +# For the third-party code, the licensing legal-info is inconsistent between +# the AUTHORS and README, so keep both +DBUS_BROKER_LICENSE_FILES = \ + LICENSE \ + subprojects/c-dvar/AUTHORS subprojects/c-dvar/README.md \ + subprojects/c-ini/AUTHORS subprojects/c-ini/README.md \ + subprojects/c-list/AUTHORS subprojects/c-list/README.md \ + subprojects/c-rbtree/AUTHORS subprojects/c-rbtree/README.md \ + subprojects/c-shquote/AUTHORS subprojects/c-shquote/README.md \ + subprojects/c-stdaux/AUTHORS subprojects/c-stdaux/README.md \ + subprojects/c-utf8/AUTHORS subprojects/c-utf8/README.md + +DBUS_BROKER_DEPENDENCIES = expat systemd +DBUS_BROKER_CONF_OPTS = -Dlauncher=true + +ifeq ($(BR2_PACKAGE_AUDIT),y) +DBUS_BROKER_DEPENDENCIES += audit +DBUS_BROKER_CONF_OPTS += -Daudit=true +else +DBUS_BROKER_CONF_OPTS += -Daudit=false +endif + +ifeq ($(BR2_PACKAGE_LIBSELINUX),y) +DBUS_BROKER_DEPENDENCIES += libselinux +DBUS_BROKER_CONF_OPTS += -Dselinux=true +else +DBUS_BROKER_CONF_OPTS += -Dselinux=false +endif + +# We must be using the same user as the original dbus, so we can share +# the home directory and create a socket there. As a consequence, the +# username and groupname must be dbus:dbus, and they both need to have +# the same home. +define DBUS_BROKER_USERS + dbus -1 dbus -1 * /run/dbus - dbus DBus messagebus user +endef + +# We overwrite some files from dbus, so add a dependency. +ifeq ($(BR2_PACKAGE_DBUS),y) +DBUS_BROKER_DEPENDENCIES += dbus +endif + +define DBUS_BROKER_INSTALL_INIT_SYSTEMD + $(INSTALL) -D -m 0644 $(DBUS_BROKER_PKGDIR)/session.conf \ + $(TARGET_DIR)/usr/share/dbus-1/session.conf + $(INSTALL) -D -m 0644 $(DBUS_BROKER_PKGDIR)/system.conf \ + $(TARGET_DIR)/usr/share/dbus-1/system.conf + $(INSTALL) -D -m 0644 $(DBUS_BROKER_PKGDIR)/dbus.socket \ + $(TARGET_DIR)/usr/lib/systemd/system/dbus.socket + $(HOST_MAKE_ENV) ln -sf ../dbus.socket \ + $(TARGET_DIR)/usr/lib/systemd/system/sockets.target.wants/dbus.socket +endef + +$(eval $(meson-package)) diff --git a/package/dbus-broker/dbus.socket b/package/dbus-broker/dbus.socket new file mode 100644 index 0000000000..5c373cf450 --- /dev/null +++ b/package/dbus-broker/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/dbus-broker/session.conf b/package/dbus-broker/session.conf new file mode 100644 index 0000000000..e4758fa218 --- /dev/null +++ b/package/dbus-broker/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/dbus-broker/system.conf b/package/dbus-broker/system.conf new file mode 100644 index 0000000000..4b17fbd90e --- /dev/null +++ b/package/dbus-broker/system.conf @@ -0,0 +1,123 @@ + + + + + + + + + system + + + + + + dbus + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + system.d + + /etc/dbus-1/system.d + + + /etc/dbus-1/system-local.conf + + contexts/dbus_contexts + + diff --git a/package/dbus/dbus.mk b/package/dbus/dbus.mk index de447d8680..a3a21c1bcc 100644 --- a/package/dbus/dbus.mk +++ b/package/dbus/dbus.mk @@ -4,6 +4,8 @@ # ################################################################################ +# When updating dbus, check if there are changes in session.conf and +# system.conf, and update the versions in the dbus-broker package accordingly. DBUS_VERSION = 1.12.22 DBUS_SITE = https://dbus.freedesktop.org/releases/dbus DBUS_LICENSE = AFL-2.1 or GPL-2.0+ (library, tools), GPL-2.0+ (tools) @@ -97,6 +99,20 @@ define DBUS_INSTALL_INIT_SYSV ln -sf /tmp/dbus $(TARGET_DIR)/var/lib/dbus endef +# If dbus-broker is installed, don't install the activation links for +# dbus itself, not the configuration files. They will be overwritten +# by dbus-broker +ifeq ($(BR2_PACKAGE_DBUS_BROKER),y) +define DBUS_REMOVE_SYSTEMD_ACTIVATION_LINKS + rm -f $(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants/dbus.service + rm -f $(TARGET_DIR)/usr/lib/systemd/system/sockets.target.wants/dbus.socket + rm -f $(TARGET_DIR)/usr/lib/systemd/system/dbus.socket + rm -f $(TARGET_DIR)/usr/share/dbus-1/session.conf + rm -f $(TARGET_DIR)/usr/share/dbus-1/system.conf +endef +DBUS_POST_INSTALL_TARGET_HOOKS += DBUS_REMOVE_SYSTEMD_ACTIVATION_LINKS +endif + define DBUS_INSTALL_INIT_SYSTEMD mkdir -p $(TARGET_DIR)/var/lib/dbus ln -sf /etc/machine-id $(TARGET_DIR)/var/lib/dbus/machine-id