summaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-core/recipes-core/dbus
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl-profile-core/recipes-core/dbus')
-rw-r--r--meta-agl-profile-core/recipes-core/dbus/.appends.core0
l---------meta-agl-profile-core/recipes-core/dbus/dbus-cynara_%.bbappend1
-rw-r--r--meta-agl-profile-core/recipes-core/dbus/dbus/dbus.service10
-rw-r--r--meta-agl-profile-core/recipes-core/dbus/dbus/dbus.socket9
-rw-r--r--meta-agl-profile-core/recipes-core/dbus/dbus/dbus_env.conf5
-rw-r--r--meta-agl-profile-core/recipes-core/dbus/dbus_%.bbappend28
6 files changed, 53 insertions, 0 deletions
diff --git a/meta-agl-profile-core/recipes-core/dbus/.appends.core b/meta-agl-profile-core/recipes-core/dbus/.appends.core
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/meta-agl-profile-core/recipes-core/dbus/.appends.core
diff --git a/meta-agl-profile-core/recipes-core/dbus/dbus-cynara_%.bbappend b/meta-agl-profile-core/recipes-core/dbus/dbus-cynara_%.bbappend
new file mode 120000
index 000000000..fcdfb1783
--- /dev/null
+++ b/meta-agl-profile-core/recipes-core/dbus/dbus-cynara_%.bbappend
@@ -0,0 +1 @@
+dbus_%.bbappend \ No newline at end of file
diff --git a/meta-agl-profile-core/recipes-core/dbus/dbus/dbus.service b/meta-agl-profile-core/recipes-core/dbus/dbus/dbus.service
new file mode 100644
index 000000000..dee6ad741
--- /dev/null
+++ b/meta-agl-profile-core/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/meta-agl-profile-core/recipes-core/dbus/dbus/dbus.socket b/meta-agl-profile-core/recipes-core/dbus/dbus/dbus.socket
new file mode 100644
index 000000000..af76b2f12
--- /dev/null
+++ b/meta-agl-profile-core/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/meta-agl-profile-core/recipes-core/dbus/dbus/dbus_env.conf b/meta-agl-profile-core/recipes-core/dbus/dbus/dbus_env.conf
new file mode 100644
index 000000000..f8f02669b
--- /dev/null
+++ b/meta-agl-profile-core/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/meta-agl-profile-core/recipes-core/dbus/dbus_%.bbappend b/meta-agl-profile-core/recipes-core/dbus/dbus_%.bbappend
new file mode 100644
index 000000000..e63ea0f28
--- /dev/null
+++ b/meta-agl-profile-core/recipes-core/dbus/dbus_%.bbappend
@@ -0,0 +1,28 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/dbus"
+
+SRC_URI_append = "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.
+ mkdir -p ${D}/etc/systemd/user/default.target.wants/
+ ln -sf ${systemd_user_unitdir}/dbus.socket ${D}/etc/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)} \
+ "