diff options
author | Tom Hochstein <tom.hochstein@nxp.com> | 2018-06-25 21:11:45 -0500 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2018-07-05 15:32:27 -0300 |
commit | 6c50f608063f673f8763d2baebf1c486cb5ed63a (patch) | |
tree | 5c452a28b6a849e6397c46a8e426a6c90cf6bd16 | |
parent | 3650dc2b1d17ea3d3c0388a890592f89c47d84de (diff) | |
download | meta-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>
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 @@ | |||
1 | FILESEXTRAPATHS_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 |
2 | IMX_REQUIRED_DISTRO_FEATURES_REMOVE = "" | 4 | IMX_REQUIRED_DISTRO_FEATURES_REMOVE = "" |
3 | IMX_REQUIRED_DISTRO_FEATURES_REMOVE_imxgpu2d = "opengl" | 5 | IMX_REQUIRED_DISTRO_FEATURES_REMOVE_imxgpu2d = "opengl" |
4 | IMX_REQUIRED_DISTRO_FEATURES_REMOVE_imxgpu3d = "" | 6 | IMX_REQUIRED_DISTRO_FEATURES_REMOVE_imxgpu3d = "" |
5 | REQUIRED_DISTRO_FEATURES_remove = "${IMX_REQUIRED_DISTRO_FEATURES_REMOVE}" | 7 | REQUIRED_DISTRO_FEATURES_remove = "${IMX_REQUIRED_DISTRO_FEATURES_REMOVE}" |
8 | |||
9 | SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd wayland x11', 'file://weston.config', '', d)}" | ||
10 | |||
11 | HAS_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}" | ||
12 | HAS_XWAYLAND = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland x11', 'true', 'false', d)}" | ||
13 | |||
14 | do_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 | ||
2 | OPTARGS="--xwayland" | ||
3 | DESKTOP_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 | ||
2 | OPTARGS="--xwayland --use-g2d=1" | ||
3 | DESKTOP_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 | ||
2 | OPTARGS="--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] | ||
2 | Description=Weston Wayland Compositor (on tty7) | ||
3 | RequiresMountsFor=/run | ||
4 | Conflicts=getty@tty7.service plymouth-quit.service | ||
5 | After=systemd-user-sessions.service getty@tty7.service plymouth-quit-wait.service | ||
6 | |||
7 | [Service] | ||
8 | User=root | ||
9 | PermissionsStartOnly=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: | ||
13 | PAMName=login | ||
14 | |||
15 | # Grab tty7 | ||
16 | UtmpIdentifier=tty7 | ||
17 | TTYPath=/dev/tty7 | ||
18 | TTYReset=yes | ||
19 | TTYVHangup=yes | ||
20 | TTYVTDisallocate=yes | ||
21 | |||
22 | # stderr to journal so our logging doesn't get thrown into /dev/null | ||
23 | StandardOutput=tty | ||
24 | StandardInput=tty | ||
25 | StandardError=journal | ||
26 | |||
27 | EnvironmentFile=-/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: | ||
31 | ExecStartPre=/usr/bin/chvt 7 | ||
32 | ExecStart=/usr/bin/weston-launch -- --log=/var/log/weston.log $OPTARGS | ||
33 | |||
34 | IgnoreSIGPIPE=no | ||
35 | |||
36 | [Install] | ||
37 | WantedBy=multi-user.target | ||
38 | |||