All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Hochstein <tom.hochstein@nxp.com>
To: meta-freescale@yoctoproject.org
Subject: [PATCH v4 8/8] weston-init: Fix weston 2.0 startup for pam, systemd case
Date: Thu,  7 Dec 2017 11:31:02 -0600	[thread overview]
Message-ID: <1512667862-15931-9-git-send-email-tom.hochstein@nxp.com> (raw)
In-Reply-To: <1512667862-15931-1-git-send-email-tom.hochstein@nxp.com>

The weston-start script for starting Weston does not work
well for Weston 2.0.

Daniel Diaz's proposal [1] for the systemd case with pam
seems to work, except that starting an xterm under XWayland
causes the desktop to crash. Using weston-launch instead of
weston works better.

[1] http://lists.openembedded.org/pipermail/openembedded-core/2016-December/129986.html

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
---
 recipes-graphics/wayland/weston-init.bbappend      | 23 ++++++++++++++
 recipes-graphics/wayland/weston-init/weston.config |  2 ++
 .../wayland/weston-init/weston.service             | 37 ++++++++++++++++++++++
 3 files changed, 62 insertions(+)
 create mode 100644 recipes-graphics/wayland/weston-init.bbappend
 create mode 100644 recipes-graphics/wayland/weston-init/weston.config
 create mode 100644 recipes-graphics/wayland/weston-init/weston.service

diff --git a/recipes-graphics/wayland/weston-init.bbappend b/recipes-graphics/wayland/weston-init.bbappend
new file mode 100644
index 0000000..8a5d9a8
--- /dev/null
+++ b/recipes-graphics/wayland/weston-init.bbappend
@@ -0,0 +1,23 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+REQUIRED_DISTRO_FEATURES_REMOVE_IMXGPU          = ""
+REQUIRED_DISTRO_FEATURES_REMOVE_IMXGPU_imxgpu2d = "opengl"
+REQUIRED_DISTRO_FEATURES_REMOVE_IMXGPU_imxgpu3d = ""
+REQUIRED_DISTRO_FEATURES_remove = "${REQUIRED_DISTRO_FEATURES_REMOVE_IMXGPU}"
+
+SRC_URI_append = \
+    "${@bb.utils.contains('DISTRO_FEATURES', 'wayland x11', \
+        ' file://weston.config', '', d)}"
+
+HAS_XWAYLAND = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland x11', 'true', 'false', d)}"
+
+do_install_append() {
+    sed -i \
+        -e 's,/usr/bin,${bindir},g' \
+        -e 's,/etc,${sysconfdir},g' \
+        -e 's,/var,${localstatedir},g' \
+        ${D}${systemd_system_unitdir}/weston.service
+    if ${HAS_XWAYLAND}; then
+        install -Dm0755 ${WORKDIR}/weston.config ${D}${sysconfdir}/default/weston
+    fi
+}
diff --git a/recipes-graphics/wayland/weston-init/weston.config b/recipes-graphics/wayland/weston-init/weston.config
new file mode 100644
index 0000000..7c92cf1
--- /dev/null
+++ b/recipes-graphics/wayland/weston-init/weston.config
@@ -0,0 +1,2 @@
+#!/bin/sh
+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 0000000..e3938c9
--- /dev/null
+++ b/recipes-graphics/wayland/weston-init/weston.service
@@ -0,0 +1,37 @@
+[Unit]
+Description=Weston Wayland Compositor (on tty7)
+RequiresMountsFor=/run
+Conflicts=getty@tty7.service plymouth-quit.service
+After=systemd-user-sessions.service getty@tty7.service plymouth-quit-wait.service
+
+[Service]
+User=root
+PermissionsStartOnly=true
+
+# Log us in via PAM so we get our XDG & co. environment and
+# are treated as logged in so we can use the tty:
+PAMName=login
+
+# Grab tty7
+UtmpIdentifier=tty7
+TTYPath=/dev/tty7
+TTYReset=yes
+TTYVHangup=yes
+TTYVTDisallocate=yes
+
+# stderr to journal so our logging doesn't get thrown into /dev/null
+StandardOutput=tty
+StandardInput=tty
+StandardError=journal
+
+EnvironmentFile=-/etc/default/weston
+
+# Weston does not successfully change VT, nor does systemd place us on
+# the VT it just activated for us. Switch manually:
+ExecStartPre=/usr/bin/chvt 7
+ExecStart=/usr/bin/weston-launch -- --log=/var/log/weston.log $OPTARGS
+
+IgnoreSIGPIPE=no
+
+[Install]
+WantedBy=multi-user.target
-- 
1.9.1



  parent reply	other threads:[~2017-12-07 19:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 17:30 [PATCH v4 0/8] Graphics updates for L4.9.11-1.0.0 BSP Release plus Weston 2.0 Tom Hochstein
2017-12-07 17:30 ` [PATCH v4 1/8] imx-gpu-apitrace: Move apitrace out of imx-gpu-viv v6 Tom Hochstein
2017-12-07 17:30 ` [PATCH v4 2/8] imx-gpu-g2d: Move imx-gpu-g2d " Tom Hochstein
2017-12-07 17:30 ` [PATCH v4 3/8] imx-gpu-viv: Upgrade to 6.2.2.p0 Tom Hochstein
2017-12-07 17:30 ` [PATCH v4 4/8] mesa: Remove parts provided by imx-gpu-viv v6 Tom Hochstein
2017-12-07 17:30 ` [PATCH v4 5/8] xf86-video-imxfb-vivante: Upgrade to 6.2.2.p0 Tom Hochstein
2017-12-07 17:31 ` [PATCH v4 6/8] gtk+3: Use egl pkgconfig for build setup Tom Hochstein
2017-12-07 17:31 ` [PATCH v4 7/8] weston: Switch to 2.0 with i.MX fork Tom Hochstein
2017-12-07 17:31 ` Tom Hochstein [this message]
2017-12-13 22:41 ` [PATCH v4 0/8] Graphics updates for L4.9.11-1.0.0 BSP Release plus Weston 2.0 Stefan Agner
2017-12-13 23:22   ` Tom Hochstein
2018-03-05 16:36     ` Johannes Pointner
2018-03-05 22:21       ` Otavio Salvador
2018-03-06  6:29         ` Johannes Pointner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1512667862-15931-9-git-send-email-tom.hochstein@nxp.com \
    --to=tom.hochstein@nxp.com \
    --cc=meta-freescale@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.