summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-09-09 09:27:04 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-10 13:48:27 +0100
commit31259e5913ddd4962c0086f70639a7bd4da961cc (patch)
treee09b222fd4568415d88925cc4c59a832d654ecc9 /meta
parent75e803a4d043d053f181f2683945e418b294dad2 (diff)
downloadpoky-31259e5913ddd4962c0086f70639a7bd4da961cc.tar.gz
weston-init: Redefine weston service and add socket activation option
Currently, weston when autolauched with systemd ends up with seat0 related errors because its launched before seat0 is assigned. Fixes [05:16:09.357] logind: failed to get session seat [05:16:09.358] logind: cannot setup systemd-logind helper (-61), using legacy fallback The above error results in ptest failures in parselogs, even though weston has started ok using fallback methods, these errors are still seen in logs Also fixes weston ptests RESULTS - weston.WestonTest.test_weston_can_initialize_new_wayland_compositor: PASSED (8.58s) (From OE-Core rev: c21fa5a291ab207a084285935ab73a0b4225c965) Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Marek Vasut <marex@denx.de> Cc: Henning Heinold <henning@itconsulting-heinold.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-graphics/wayland/weston-init.bb8
-rw-r--r--meta/recipes-graphics/wayland/weston-init/weston-autologin11
-rw-r--r--meta/recipes-graphics/wayland/weston-init/weston@.service69
-rw-r--r--meta/recipes-graphics/wayland/weston-init/weston@.socket10
4 files changed, 87 insertions, 11 deletions
diff --git a/meta/recipes-graphics/wayland/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb
index 40aa76295f..95d75556dc 100644
--- a/meta/recipes-graphics/wayland/weston-init.bb
+++ b/meta/recipes-graphics/wayland/weston-init.bb
@@ -8,7 +8,9 @@ SRC_URI = "file://init \
8 file://weston.env \ 8 file://weston.env \
9 file://weston.ini \ 9 file://weston.ini \
10 file://weston@.service \ 10 file://weston@.service \
11 file://weston@.socket \
11 file://71-weston-drm.rules \ 12 file://71-weston-drm.rules \
13 file://weston-autologin \
12 file://weston-start" 14 file://weston-start"
13 15
14S = "${WORKDIR}" 16S = "${WORKDIR}"
@@ -20,6 +22,10 @@ do_install() {
20 22
21 # Install Weston systemd service and accompanying udev rule 23 # Install Weston systemd service and accompanying udev rule
22 install -D -p -m0644 ${WORKDIR}/weston@.service ${D}${systemd_system_unitdir}/weston@.service 24 install -D -p -m0644 ${WORKDIR}/weston@.service ${D}${systemd_system_unitdir}/weston@.service
25 install -D -p -m0644 ${WORKDIR}/weston@.socket ${D}${systemd_system_unitdir}/weston@.socket
26 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
27 install -D -p -m0644 ${WORKDIR}/weston-autologin ${D}${sysconfdir}/pam.d/weston-autologin
28 fi
23 sed -i -e s:/etc:${sysconfdir}:g \ 29 sed -i -e s:/etc:${sysconfdir}:g \
24 -e s:/usr/bin:${bindir}:g \ 30 -e s:/usr/bin:${bindir}:g \
25 -e s:/var:${localstatedir}:g \ 31 -e s:/var:${localstatedir}:g \
@@ -50,7 +56,7 @@ RDEPENDS_${PN} = "weston kbd"
50INITSCRIPT_NAME = "weston" 56INITSCRIPT_NAME = "weston"
51INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ." 57INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
52 58
53FILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${systemd_system_unitdir}/weston@.service ${sysconfdir}/default/weston" 59FILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${systemd_system_unitdir}/weston@.service ${systemd_system_unitdir}/weston@.socket ${sysconfdir}/default/weston ${sysconfdir}/pam.d/"
54 60
55CONFFILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston" 61CONFFILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston"
56 62
diff --git a/meta/recipes-graphics/wayland/weston-init/weston-autologin b/meta/recipes-graphics/wayland/weston-init/weston-autologin
new file mode 100644
index 0000000000..f6e6d106de
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/weston-autologin
@@ -0,0 +1,11 @@
1auth required pam_nologin.so
2auth required pam_unix.so try_first_pass nullok
3
4account required pam_nologin.so
5account required pam_unix.so
6
7session required pam_env.so
8session required pam_unix.so
9-session optional pam_systemd.so type=wayland class=user desktop=weston
10-session optional pam_loginuid.so
11
diff --git a/meta/recipes-graphics/wayland/weston-init/weston@.service b/meta/recipes-graphics/wayland/weston-init/weston@.service
index 39e193014a..0a1df15bdf 100644
--- a/meta/recipes-graphics/wayland/weston-init/weston@.service
+++ b/meta/recipes-graphics/wayland/weston-init/weston@.service
@@ -1,15 +1,64 @@
1# This is a system unit for launching Weston with auto-login as the
2# user configured here.
3#
4# Weston must be built with systemd support, and your weston.ini must load
5# the plugin systemd-notify.so.
1[Unit] 6[Unit]
2Description=Weston Wayland Compositor 7Description=Weston, a Wayland compositor, as a system service
3RequiresMountsFor=/run 8Documentation=man:weston(1) man:weston.ini(5)
4Conflicts=plymouth-quit.service 9Documentation=http://wayland.freedesktop.org/
5After=systemd-user-sessions.service plymouth-quit-wait.service 10
11# Make sure we are started after logins are permitted.
12After=systemd-user-sessions.service
13
14# If Plymouth is used, we want to start when it is on its way out.
15After=plymouth-quit-wait.service
16
17# D-Bus is necessary for contacting logind. Logind is required.
18Wants=dbus.socket
19After=dbus.socket
20
21# Since we are part of the graphical session, make sure we are started before
22# it is complete.
23Before=graphical.target
24
25# Prevent starting on systems without virtual consoles, Weston requires one
26# for now.
27ConditionPathExists=/dev/tty0
6 28
7[Service] 29[Service]
8User=%i 30# Requires systemd-notify.so Weston plugin.
9PAMName=login 31Type=notify
10EnvironmentFile=-/etc/default/weston 32ExecStart=/usr/bin/weston --modules=systemd-notify.so
33
34# Optional watchdog setup
35TimeoutStartSec=60
36WatchdogSec=20
37
38# The user to run Weston as.
39User=%I
40
41# Make sure working directory is users home directory
42WorkingDirectory=/home/%i
43
44# Set up a full user session for the user, required by Weston.
45PAMName=weston-autologin
46
47# A virtual terminal is needed.
48TTYPath=/dev/tty7
49TTYReset=yes
50TTYVHangup=yes
51TTYVTDisallocate=yes
52
53# Fail to start if not controlling the tty.
54StandardInput=tty-fail
55StandardOutput=journal
11StandardError=journal 56StandardError=journal
12PermissionsStartOnly=true
13IgnoreSIGPIPE=no
14 57
15ExecStart=/usr/bin/weston-start -v -e -- $OPTARGS 58# Log this user with utmp, letting it show up with commands 'w' and 'who'.
59UtmpIdentifier=tty7
60UtmpMode=user
61
62[Install]
63WantedBy=graphical.target
64DefaultInstance=tty7
diff --git a/meta/recipes-graphics/wayland/weston-init/weston@.socket b/meta/recipes-graphics/wayland/weston-init/weston@.socket
new file mode 100644
index 0000000000..f1790d74a8
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/weston@.socket
@@ -0,0 +1,10 @@
1[Unit]
2Description=Weston Wayland socket
3After=user-runtime-dir@1000.service
4
5[Socket]
6ListenStream=/run/user/1000/wayland-%I
7
8[Install]
9WantedBy=sockets.target
10