diff options
3 files changed, 18 insertions, 0 deletions
diff --git a/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.rules b/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.rules new file mode 100644 index 000000000..86c39e463 --- /dev/null +++ b/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.rules @@ -0,0 +1,2 @@ +SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/lightmediascanner.sh" +SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/lightmediascanner.sh" diff --git a/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.sh b/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.sh new file mode 100644 index 000000000..8aa397eee --- /dev/null +++ b/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# +# Call from udev +# +# Attempt to scan any new inserted media + +name="`basename "$DEVNAME"`" + +/usr/bin/lightmediascannerctl scan audio:/run/media/$(basename "$DEVNAME") diff --git a/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend b/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend index 231b3e665..4ad8abbbb 100644 --- a/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend +++ b/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend @@ -5,6 +5,8 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:" SRC_URI += "file://lightmediascanner.service \ file://plugin-ogg-fix-chucksize-issue.patch \ + file://lightmediascanner.rules \ + file://lightmediascanner.sh \ " inherit systemd @@ -20,6 +22,11 @@ do_install_append() { ln -sf ${systemd_user_unitdir}/lightmediascanner.service ${D}/etc/systemd/user/dbus-org.lightmediascanner.service ln -sf ${systemd_user_unitdir}/lightmediascanner.service ${D}/etc/systemd/user/default.target.wants/lightmediascanner.service fi + + if ${@bb.utils.contains('DISTRO_FEATURES', 'automount', 'true', 'false', d)}; then + install -m 644 -p -D ${WORKDIR}/lightmediascanner.rules ${D}/etc/udev/rules.d/lightmediascanner.rules + install -m 755 -p -D ${WORKDIR}/lightmediascanner.sh ${D}/etc/udev/scripts/lightmediascanner.sh + fi } FILES_${PN} += " \ |