diff options
Diffstat (limited to 'meta-agl-core/recipes-graphics/wayland/agl-compositor-init')
3 files changed, 89 insertions, 0 deletions
diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-autologin b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-autologin new file mode 100644 index 000000000..f6e6d106d --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-autologin @@ -0,0 +1,11 @@ +auth required pam_nologin.so +auth required pam_unix.so try_first_pass nullok + +account required pam_nologin.so +account required pam_unix.so + +session required pam_env.so +session required pam_unix.so +-session optional pam_systemd.so type=wayland class=user desktop=weston +-session optional pam_loginuid.so + diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service new file mode 100644 index 000000000..b064b1ef3 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service @@ -0,0 +1,68 @@ +# This is a system unit for launching AGL compositor with auto-login as the +# user configured here. +# +# AGL compositor and Weston must be built with systemd support, and your +# weston.ini must load the plugin systemd-notify.so. +[Unit] +Description=AGL compositor +Documentation=man:weston(1) man:weston.ini(5) +Documentation=http://wayland.freedesktop.org/ + +# Make sure we are started after logins are permitted. +Requires=systemd-user-sessions.service +After=systemd-user-sessions.service + +# D-Bus is necessary for contacting logind. Logind is required. +Wants=dbus.socket +After=dbus.socket + +# Ensure the socket is present +Requires=agl-compositor.socket + +# Since we are part of the graphical session, make sure we are started before +# it is complete. +Before=graphical.target + +# Prevent starting on systems without virtual consoles, Weston requires one +# for now. +ConditionPathExists=/dev/tty0 + +[Service] +# Requires systemd-notify.so Weston plugin. +Type=notify +EnvironmentFile=-/etc/default/agl-compositor +ExecStart=/usr/bin/agl-compositor --modules=systemd-notify.so + +# Watchdog setup +TimeoutStartSec=60 +WatchdogSec=20 + +# The user to run as. +User=agl-driver +Group=agl-driver + +# Make sure the working directory is the users home directory +WorkingDirectory=/home/agl-driver + +# Set up a full user session for the user +PAMName=agl-compositor-autologin + +# A virtual terminal is needed. +TTYPath=/dev/tty7 +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes + +# Fail to start if not controlling the tty. +StandardInput=tty-fail +StandardOutput=journal +StandardError=journal + +# Log this user with utmp, letting it show up with commands 'w' and 'who'. +UtmpIdentifier=tty7 +UtmpMode=user + +[Install] +# Note: If you only want weston to start on-demand, remove this line with a +# service drop file +WantedBy=graphical.target diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket new file mode 100644 index 000000000..ef9769ff7 --- /dev/null +++ b/meta-agl-core/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 |