summaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-core/recipes-support/udisks
diff options
context:
space:
mode:
authorJan-Simon Möller <jsmoeller@linuxfoundation.org>2018-04-24 15:13:18 +0200
committerJan-Simon Möller <jsmoeller@linuxfoundation.org>2018-04-28 00:28:55 +0200
commit4ac99c3a1447119363935fb986f5d9c05f032362 (patch)
treed4fdce1f65606af5111e6e4d5d21b198de9f2bf2 /meta-agl-profile-core/recipes-support/udisks
parentbb0882c5dad030f676e424265ebcd869bb3ff899 (diff)
2nd part of the layer/profile rework [1/2]
Main goal of this is to move the agl-service-* bindings into the core and to unify common recipes like wayland/weston into meta-agl-profile-graphical. As a placeholder for recipes is meta-agl-profile-demo which are being reshuffled. TLDR: agl-service move to meta-agl-profile-core. wayland/weston moves to meta-agl-profile-graphical. This patchset needs the 2nd patchset of the series to build (meta-agl-demo). Bug-AGL: SPEC-145 , SPEC-876 , SPEC-877 v2: rebase including udiscs patches from meta-agl-demo Change-Id: I5e33f72d01707fa8b826d382bccaca3addcbbc47 Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'meta-agl-profile-core/recipes-support/udisks')
-rw-r--r--meta-agl-profile-core/recipes-support/udisks/files/automount.service9
-rwxr-xr-xmeta-agl-profile-core/recipes-support/udisks/files/automount.sh19
-rw-r--r--meta-agl-profile-core/recipes-support/udisks/files/org.freedesktop.UDisks.conf32
-rw-r--r--meta-agl-profile-core/recipes-support/udisks/files/udisks.service11
-rw-r--r--meta-agl-profile-core/recipes-support/udisks/udisks_1.0.5.bbappend28
5 files changed, 99 insertions, 0 deletions
diff --git a/meta-agl-profile-core/recipes-support/udisks/files/automount.service b/meta-agl-profile-core/recipes-support/udisks/files/automount.service
new file mode 100644
index 000000000..64c36e76b
--- /dev/null
+++ b/meta-agl-profile-core/recipes-support/udisks/files/automount.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Automount Disk Manager
+After=udisks.service
+
+[Service]
+ExecStart=/usr/libexec/automount.sh
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-agl-profile-core/recipes-support/udisks/files/automount.sh b/meta-agl-profile-core/recipes-support/udisks/files/automount.sh
new file mode 100755
index 000000000..bb0b1ae91
--- /dev/null
+++ b/meta-agl-profile-core/recipes-support/udisks/files/automount.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+pathtoname() {
+ udevadm info -p /sys/"$1" | awk -v FS== '/DEVNAME/ {print $2}'
+}
+
+MOUNT_OPTIONS="ro,flush"
+
+rmdir /media/* &> /dev/null || true
+for DEVNAME in $(udisks --enumerate-device-files|grep -e sd[a-z]); do
+ udisks --mount-options $MOUNT_OPTIONS --mount $DEVNAME
+done
+
+stdbuf -oL -- udevadm monitor --udev -s block | while read -r -- _ _ event devpath _; do
+ if [ "$event" = add ]; then
+ DEVNAME=$(pathtoname "$devpath")
+ udisks --mount-options $MOUNT_OPTIONS --mount $DEVNAME
+ fi
+done
diff --git a/meta-agl-profile-core/recipes-support/udisks/files/org.freedesktop.UDisks.conf b/meta-agl-profile-core/recipes-support/udisks/files/org.freedesktop.UDisks.conf
new file mode 100644
index 000000000..0098b94e1
--- /dev/null
+++ b/meta-agl-profile-core/recipes-support/udisks/files/org.freedesktop.UDisks.conf
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->
+
+<!DOCTYPE busconfig PUBLIC
+ "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+ <!-- Only root can own the service -->
+ <policy user="root">
+ <allow own="org.freedesktop.UDisks"/>
+ </policy>
+
+ <policy context="default">
+ <allow send_destination="org.freedesktop.UDisks"/>
+
+ <allow send_destination="org.freedesktop.UDisks"
+ send_interface="org.freedesktop.DBus.Properties"/>
+ <allow send_destination="org.freedesktop.UDisks"
+ send_interface="org.freedesktop.DBus.Introspectable"/>
+ <allow send_destination="org.freedesktop.UDisks"
+ send_interface="org.freedesktop.UDisks"/>
+ <allow send_destination="org.freedesktop.UDisks"
+ send_interface="org.freedesktop.UDisks.Device"/>
+ <allow send_destination="org.freedesktop.UDisks"
+ send_interface="org.freedesktop.UDisks.Adapter"/>
+ <allow send_destination="org.freedesktop.UDisks"
+ send_interface="org.freedesktop.UDisks.Expander"/>
+ <allow send_destination="org.freedesktop.UDisks"
+ send_interface="org.freedesktop.UDisks.Port"/>
+ <allow receive_sender="org.freedesktop.UDisks" receive_type="signal"
+ receive_interface="org.freedesktop.UDisks"/>
+ </policy>
+</busconfig>
diff --git a/meta-agl-profile-core/recipes-support/udisks/files/udisks.service b/meta-agl-profile-core/recipes-support/udisks/files/udisks.service
new file mode 100644
index 000000000..4bd558449
--- /dev/null
+++ b/meta-agl-profile-core/recipes-support/udisks/files/udisks.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Disk Manager (legacy version)
+Documentation=man:udisks(7)
+
+[Service]
+Type=dbus
+BusName=org.freedesktop.UDisks
+ExecStart=/usr/libexec/udisks-daemon --no-debug
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-agl-profile-core/recipes-support/udisks/udisks_1.0.5.bbappend b/meta-agl-profile-core/recipes-support/udisks/udisks_1.0.5.bbappend
new file mode 100644
index 000000000..d55a167a6
--- /dev/null
+++ b/meta-agl-profile-core/recipes-support/udisks/udisks_1.0.5.bbappend
@@ -0,0 +1,28 @@
+SRC_URI += "file://org.freedesktop.UDisks.conf \
+ file://udisks.service \
+ file://automount.service \
+ file://automount.sh \
+ "
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+FILES_${PN} += "${base_libdir}/systemd/system/automount.service \
+ ${base_libdir}/systemd/system/udisks.service \
+ ${libexecdir}/automount.sh \
+ "
+
+SYSTEMD_AUTO_ENABLE = "enable"
+SYSTEMD_SERVICE_${PN} = "udisks.service automount.service"
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/dbus-1/system.d
+ install -m 644 ${WORKDIR}/org.freedesktop.UDisks.conf ${D}${sysconfdir}/dbus-1/system.d/
+
+ install -d ${D}${base_libdir}/systemd/system
+ install -m 0644 ${WORKDIR}/udisks.service ${D}${base_libdir}/systemd/system
+
+ install -d ${D}${base_libdir}/systemd/system
+ install -m 0644 ${WORKDIR}/automount.service ${D}${base_libdir}/systemd/system
+
+ install -d ${D}${libexecdir}
+ install -m 0755 ${WORKDIR}/automount.sh ${D}${libexecdir}/automount.sh
+}