pulseaudio: fix service/socket unit installation 97/9497/5
authorScott Murray <scott.murray@konsulko.com>
Tue, 23 May 2017 20:33:02 +0000 (16:33 -0400)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Thu, 25 May 2017 12:53:20 +0000 (12:53 +0000)
It's not obvious how the base pulseaudio package was being pulled
in before to pick up the pulseaudio.{service,socket} symlinks in
/home/root/.config, but it's definitely not being installed now,
breaking PulseAudio usage in all applications.  Move the symlinks to
the pulseaudio-server package which is definitely always installed,
and also contains the target files for the symlinks.  Additionally,
move the symlinks to /usr/lib/systemd/user to prepare for the eventual
running of all applications as non-root and be compliant with
SPEC-505.

Bug-AGL: SPEC-612

Change-Id: Ic8e283e6ee32e3b532e93344445b239ed8d3e896
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/9497
Reviewed-by: Matt Porter <mporter@konsulko.com>
Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com>
Tested-by: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org>
ci-image-build: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org>
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend

index 541fe42..a54ec60 100644 (file)
@@ -10,19 +10,19 @@ do_install_append() {
 
               # 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}/home/root/.config/systemd/user/sockets.target.wants/
-              ln -sf ${systemd_user_unitdir}/pulseaudio.socket ${D}/home/root/.config/systemd/user/sockets.target.wants/pulseaudio.socket
+              install -d ${D}${systemd_user_unitdir}/sockets.target.wants/
+              ln -sf ${systemd_user_unitdir}/pulseaudio.socket ${D}${systemd_user_unitdir}/sockets.target.wants/
 
-              mkdir -p ${D}/home/root/.config/systemd/user/default.target.wants/
-              ln -sf ${systemd_user_unitdir}/pulseaudio.service ${D}/home/root/.config/systemd/user/default.target.wants/pulseaudio.service
+              install -d ${D}${systemd_user_unitdir}/default.target.wants/
+              ln -sf ${systemd_user_unitdir}/pulseaudio.service ${D}${systemd_user_unitdir}/default.target.wants/
        fi
        mkdir -p ${D}/${bindir}
        install -m 755 -p -D ${WORKDIR}/build/src/.libs/pacat ${D}/${bindir}/
 }
 
-FILES_${PN} += " \
+FILES_${PN}-server += " \
     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/pulseaudio.socket', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '/home/root/.config/systemd/user/sockets.target.wants/pulseaudio.socket', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/sockets.target.wants/pulseaudio.socket', '', d)} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/pulseaudio.service', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '/home/root/.config/systemd/user/default.target.wants/pulseaudio.service', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/default.target.wants/pulseaudio.service', '', d)} \
 "