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 --- .../agl-compositor-init/agl-compositor.conf | 11 +++++++++ .../agl-compositor-init/agl-compositor.service.in | 28 ++++++++++++++++++++++ .../agl-compositor-init/agl-compositor.socket | 10 ++++++++ 3 files changed, 49 insertions(+) create mode 100644 meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf create mode 100644 meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service.in create mode 100644 meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket (limited to 'meta-app-framework/recipes-graphics/wayland/agl-compositor-init') diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf new file mode 100644 index 000000000..66778a91b --- /dev/null +++ b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf @@ -0,0 +1,11 @@ +[Unit] +ConditionPathExists=/dev/tty7 + +[Service] +Environment=XDG_SESSION_TYPE=wayland +TTYPath=/dev/tty7 +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +UtmpIdentifier=tty7 +UtmpMode=user diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service.in b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service.in new file mode 100644 index 000000000..2d0195184 --- /dev/null +++ b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service.in @@ -0,0 +1,28 @@ +# +# Weston must be built with systemd support, and your weston.ini must load +# the plugin systemd-notify.so. + +[Unit] +Description=agl-compositor, a Wayland compositor, as a systemd user service +Documentation=https://docs.automotivelinux.org/en/master/#5_Component_Documentation/1_agl-compositor/ + +# Activate using a systemd socket +Requires=agl-compositor.socket +After=agl-compositor.socket + +# Since we are part of the agl session, make sure we are started before +# it is complete. +Before=agl-session.target + +[Service] +Type=notify +ExecStart=/usr/bin/agl-compositor @AGL_COMPOSITOR_ARGS@ + +TimeoutStartSec=60 +WatchdogSec=20 + +StandardOutput=journal +StandardError=journal + +[Install] +WantedBy=agl-session.target diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket new file mode 100644 index 000000000..ef9769ff7 --- /dev/null +++ b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket @@ -0,0 +1,10 @@ +# +# Weston must be built with systemd support, and your weston.ini must load +# the plugin systemd-notify.so. + +[Unit] +Description=agl-compositor, a Wayland compositor, as a systemd user service +Documentation=https://docs.automotivelinux.org/en/master/#5_Component_Documentation/1_agl-compositor/ + +[Socket] +ListenStream=%t/wayland-0 -- cgit 1.2.3-korg