summaryrefslogtreecommitdiffstats
path: root/recipes-graphics
diff options
context:
space:
mode:
authorTom Hochstein <tom.hochstein@nxp.com>2018-06-25 21:11:45 -0500
committerOtavio Salvador <otavio@ossystems.com.br>2018-07-05 15:32:27 -0300
commit6c50f608063f673f8763d2baebf1c486cb5ed63a (patch)
tree5c452a28b6a849e6397c46a8e426a6c90cf6bd16 /recipes-graphics
parent3650dc2b1d17ea3d3c0388a890592f89c47d84de (diff)
downloadmeta-freescale-6c50f608063f673f8763d2baebf1c486cb5ed63a.tar.gz
weston-init: Fix inoperable Weston desktop
For an image configured with pam and systemd, Weston apps would fail to run. For example: $ weston-terminal failed to connect to Wayland display: No such file or directory failed to create display: No such file or directory This fix is based on a proposal by Daniel Diaz to OE-core. The main part of the fix is the use of a new, manually created tty. The original proposal called weston directly, but that didn't seem to work where weston-launch did. Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'recipes-graphics')
-rw-r--r--recipes-graphics/wayland/weston-init.bbappend20
-rw-r--r--recipes-graphics/wayland/weston-init/imxdrm/weston.config3
-rw-r--r--recipes-graphics/wayland/weston-init/mx8mm/weston.config3
-rw-r--r--recipes-graphics/wayland/weston-init/weston.config2
-rw-r--r--recipes-graphics/wayland/weston-init/weston.service38
5 files changed, 66 insertions, 0 deletions
diff --git a/recipes-graphics/wayland/weston-init.bbappend b/recipes-graphics/wayland/weston-init.bbappend
index ce1482d9..76aadf94 100644
--- a/recipes-graphics/wayland/weston-init.bbappend
+++ b/recipes-graphics/wayland/weston-init.bbappend
@@ -1,5 +1,25 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2
1# OpenGL is not required for parts with GPU support for 2D but not 3D 3# OpenGL is not required for parts with GPU support for 2D but not 3D
2IMX_REQUIRED_DISTRO_FEATURES_REMOVE = "" 4IMX_REQUIRED_DISTRO_FEATURES_REMOVE = ""
3IMX_REQUIRED_DISTRO_FEATURES_REMOVE_imxgpu2d = "opengl" 5IMX_REQUIRED_DISTRO_FEATURES_REMOVE_imxgpu2d = "opengl"
4IMX_REQUIRED_DISTRO_FEATURES_REMOVE_imxgpu3d = "" 6IMX_REQUIRED_DISTRO_FEATURES_REMOVE_imxgpu3d = ""
5REQUIRED_DISTRO_FEATURES_remove = "${IMX_REQUIRED_DISTRO_FEATURES_REMOVE}" 7REQUIRED_DISTRO_FEATURES_remove = "${IMX_REQUIRED_DISTRO_FEATURES_REMOVE}"
8
9SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd wayland x11', 'file://weston.config', '', d)}"
10
11HAS_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"
12HAS_XWAYLAND = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland x11', 'true', 'false', d)}"
13
14do_install_append() {
15 if ${HAS_SYSTEMD}; then
16 sed -i \
17 -e 's,/usr/bin,${bindir},g' \
18 -e 's,/etc,${sysconfdir},g' \
19 -e 's,/var,${localstatedir},g' \
20 ${D}${systemd_system_unitdir}/weston.service
21 if ${HAS_XWAYLAND}; then
22 install -Dm0755 ${WORKDIR}/weston.config ${D}${sysconfdir}/default/weston
23 fi
24 fi
25}
diff --git a/recipes-graphics/wayland/weston-init/imxdrm/weston.config b/recipes-graphics/wayland/weston-init/imxdrm/weston.config
new file mode 100644
index 00000000..5693d6cb
--- /dev/null
+++ b/recipes-graphics/wayland/weston-init/imxdrm/weston.config
@@ -0,0 +1,3 @@
1#!/bin/sh
2OPTARGS="--xwayland"
3DESKTOP_SHELL_WINDOW=1920x1080
diff --git a/recipes-graphics/wayland/weston-init/mx8mm/weston.config b/recipes-graphics/wayland/weston-init/mx8mm/weston.config
new file mode 100644
index 00000000..eb990e40
--- /dev/null
+++ b/recipes-graphics/wayland/weston-init/mx8mm/weston.config
@@ -0,0 +1,3 @@
1#!/bin/sh
2OPTARGS="--xwayland --use-g2d=1"
3DESKTOP_SHELL_WINDOW=1920x1080
diff --git a/recipes-graphics/wayland/weston-init/weston.config b/recipes-graphics/wayland/weston-init/weston.config
new file mode 100644
index 00000000..7c92cf11
--- /dev/null
+++ b/recipes-graphics/wayland/weston-init/weston.config
@@ -0,0 +1,2 @@
1#!/bin/sh
2OPTARGS="--xwayland"
diff --git a/recipes-graphics/wayland/weston-init/weston.service b/recipes-graphics/wayland/weston-init/weston.service
new file mode 100644
index 00000000..44c5a82f
--- /dev/null
+++ b/recipes-graphics/wayland/weston-init/weston.service
@@ -0,0 +1,38 @@
1[Unit]
2Description=Weston Wayland Compositor (on tty7)
3RequiresMountsFor=/run
4Conflicts=getty@tty7.service plymouth-quit.service
5After=systemd-user-sessions.service getty@tty7.service plymouth-quit-wait.service
6
7[Service]
8User=root
9PermissionsStartOnly=true
10
11# Log us in via PAM so we get our XDG & co. environment and
12# are treated as logged in so we can use the tty:
13PAMName=login
14
15# Grab tty7
16UtmpIdentifier=tty7
17TTYPath=/dev/tty7
18TTYReset=yes
19TTYVHangup=yes
20TTYVTDisallocate=yes
21
22# stderr to journal so our logging doesn't get thrown into /dev/null
23StandardOutput=tty
24StandardInput=tty
25StandardError=journal
26
27EnvironmentFile=-/etc/default/weston
28
29# Weston does not successfully change VT, nor does systemd place us on
30# the VT it just activated for us. Switch manually:
31ExecStartPre=/usr/bin/chvt 7
32ExecStart=/usr/bin/weston-launch -- --log=/var/log/weston.log $OPTARGS
33
34IgnoreSIGPIPE=no
35
36[Install]
37WantedBy=multi-user.target
38