From cdde5386d6b947710819d4b21462746646b88bc5 Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Tue, 7 Dec 2021 18:31:45 +0100 Subject: meta-app-framework: start agl-compositor in a systemd user session `weston-init` installs a system service for starting the compositor. As we want it to run as a user service, this patch replaces this package with `agl-compositor-init`. This involves: - resetting RDEPENDS from `weston-ini-conf` so it doesn't pull in `weston-init` anymore - making `agl-compositor-init` RCONFLICT with `weston-init` as it's still a RRECOMMENDS to `weston` `agl-compositor-init` installs a systemd user service and socket, and ensures agl-compositor is automatically started with the user session, so the compositor is automatically started on boot. It also adds a config fragment for the `agl-session@agl-driver` service (instance of `agl-session` for user `agl-driver`) for properly configuring the TTY to use for display. Bug-AGL: SPEC-4161 Signed-off-by: Arnaud Ferraris Change-Id: Ifb10a206cfa97c147283bc78c46f7f09209a9591 Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/26975 Tested-by: Jenkins Job builder account ci-image-build: Jenkins Job builder account Reviewed-by: Scott Murray Reviewed-by: Jan-Simon Moeller ci-image-boot-test: Jenkins Job builder account --- .../wayland/agl-compositor-init_agl-app-fw.inc | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc (limited to 'meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc') diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc new file mode 100644 index 000000000..eef88a60c --- /dev/null +++ b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc @@ -0,0 +1,46 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/agl-compositor-init:" + +SRC_URI = " \ + file://agl-compositor.conf \ + file://agl-compositor.service.in \ + file://agl-compositor.socket \ + " + +# Reset systemd services list +SYSTEMD_SERVICE:${PN} = "" + +do_install() { + # Process ".in" files + files=agl-compositor.service.in + for f in ${files}; do + g=${f%.in} + if [ "${f}" != "${g}" ]; then + sed -e "s,@AGL_COMPOSITOR_ARGS@,${AGL_COMPOSITOR_ARGS},g" \ + ${WORKDIR}/${f} > ${WORKDIR}/${g} + fi + done + + install -d ${D}${systemd_system_unitdir}/agl-session@agl-driver.service.d + install -m 0644 ${WORKDIR}/agl-compositor.conf \ + ${D}${systemd_system_unitdir}/agl-session@agl-driver.service.d/agl-compositor.conf + + install -D -p -m0644 ${WORKDIR}/agl-compositor.service ${D}${systemd_user_unitdir}/agl-compositor.service + install -D -p -m0644 ${WORKDIR}/agl-compositor.socket ${D}${systemd_user_unitdir}/agl-compositor.socket + + # Enable the compositor as part of the user session + install -d ${D}${systemd_user_unitdir}/agl-session.target.wants + ln -s ../agl-compositor.service ${D}${systemd_user_unitdir}/agl-session.target.wants/agl-compositor.service +} + +FILES:${PN} = "\ + ${systemd_system_unitdir} \ + ${systemd_user_unitdir} \ +" + +RDEPENDS:${PN} = " \ + agl-compositor \ + agl-session \ + weston-ini-conf \ +" + +RCONFLICTS:${PN} = "weston-init" -- cgit 1.2.3-korg