summaryrefslogtreecommitdiffstats
path: root/recipes-core/dbus
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core/dbus')
-rw-r--r--recipes-core/dbus/dbus/dbus.service10
-rw-r--r--recipes-core/dbus/dbus/dbus.socket9
-rw-r--r--recipes-core/dbus/dbus/dbus_env.conf5
-rw-r--r--recipes-core/dbus/dbus_%.bbappend1
-rw-r--r--recipes-core/dbus/dbus_agldemo.inc28
5 files changed, 53 insertions, 0 deletions
diff --git a/recipes-core/dbus/dbus/dbus.service b/recipes-core/dbus/dbus/dbus.service
new file mode 100644
index 00000000..dee6ad74
--- /dev/null
+++ b/recipes-core/dbus/dbus/dbus.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=D-Bus User Message Bus
+Documentation=man:dbus-daemon(1)
+Requires=dbus.socket
+
+[Service]
+ExecStart=/usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation
+ExecReload=/usr/bin/dbus-send --print-reply --session --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
+Restart=always
+RestartSec=1
diff --git a/recipes-core/dbus/dbus/dbus.socket b/recipes-core/dbus/dbus/dbus.socket
new file mode 100644
index 00000000..af76b2f1
--- /dev/null
+++ b/recipes-core/dbus/dbus/dbus.socket
@@ -0,0 +1,9 @@
+[Unit]
+Description=D-Bus User Message Bus Socket
+Before=sockets.target
+
+[Socket]
+ListenStream=%t/bus
+
+[Install]
+WantedBy=default.target
diff --git a/recipes-core/dbus/dbus/dbus_env.conf b/recipes-core/dbus/dbus/dbus_env.conf
new file mode 100644
index 00000000..f8f02669
--- /dev/null
+++ b/recipes-core/dbus/dbus/dbus_env.conf
@@ -0,0 +1,5 @@
+[Unit]
+Wants=dbus.service
+
+[Service]
+Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/bus
diff --git a/recipes-core/dbus/dbus_%.bbappend b/recipes-core/dbus/dbus_%.bbappend
new file mode 100644
index 00000000..8abed712
--- /dev/null
+++ b/recipes-core/dbus/dbus_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'agldemo', 'dbus_agldemo.inc', '', d)}
diff --git a/recipes-core/dbus/dbus_agldemo.inc b/recipes-core/dbus/dbus_agldemo.inc
new file mode 100644
index 00000000..826584c0
--- /dev/null
+++ b/recipes-core/dbus/dbus_agldemo.inc
@@ -0,0 +1,28 @@
+FILESEXTRAPATHS:append := ":${THISDIR}/dbus"
+
+SRC_URI += "file://dbus.service \
+ file://dbus.socket \
+ file://dbus_env.conf \
+ "
+
+inherit systemd
+
+do_install:append() {
+ if [ "${PN}" != "nativesdk-dbus" ]; then
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -m 644 -p -D ${WORKDIR}/dbus.service ${D}${systemd_user_unitdir}/dbus.service
+ install -m 644 -p -D ${WORKDIR}/dbus.socket ${D}${systemd_user_unitdir}/dbus.socket
+ install -m 644 -p -D ${WORKDIR}/dbus_env.conf ${D}${systemd_system_unitdir}/user@.service.d/dbus_env.conf
+
+ # Execute these manually on behalf of systemctl script (from systemd-systemctl-native.bb)
+ # because it does not support systemd's user mode.
+ install -d ${D}${sysconfdir}/systemd/user/default.target.wants/
+ ln -sf ${systemd_user_unitdir}/dbus.socket ${D}${sysconfdir}/systemd/user/default.target.wants/dbus.socket
+ fi
+ fi
+}
+
+FILES:${PN} += " \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/dbus.*', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_system_unitdir}/user@.service.d/dbus_env.conf', '', d)} \
+ "