aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service10
-rw-r--r--meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend17
2 files changed, 27 insertions, 0 deletions
diff --git a/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service b/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service
new file mode 100644
index 000000000..00bbf8d27
--- /dev/null
+++ b/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Lightmediascanner (LMS)
+
+[Service]
+Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/dbus/user_bus_socket
+User=root
+ExecStart=/usr/bin/dbus-launch --auto-syntax /usr/bin/lightmediascannerd --startup-scan --directory=/usr/share/media
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend b/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend
index 7e6381113..d2b790e81 100644
--- a/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend
+++ b/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend
@@ -1,2 +1,19 @@
# Disable everything but the roygalty-free formats
PACKAGECONFIG = "ogg flac wave m3u pls jpeg png"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI += "file://lightmediascanner.service"
+
+inherit systemd
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = ""
+SYSTEMD_SERVICE_${PN} += "lightmediascanner.service"
+
+do_install_append() {
+ # Install LMS systemd service
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -p -D ${WORKDIR}/lightmediascanner.service ${D}${systemd_unitdir}/system/lightmediascanner.service
+ fi
+}