public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Alexander Kanavin" <alex.kanavin@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Alexander Kanavin <alex.kanavin@gmail.com>
Subject: [RFC PATCH 08/12] weston-init: correctly start under systemd
Date: Mon,  9 Nov 2020 09:31:29 +0100	[thread overview]
Message-ID: <20201109083133.16503-8-alex.kanavin@gmail.com> (raw)
In-Reply-To: <20201109083133.16503-1-alex.kanavin@gmail.com>

Several issues are addressed:
1. weston requires pam when starting under systemd
2. systemd was attempting to launch weston twice (from
sysvinit script and from systemd unit file) which caused confusion
and errors.
3. runtime test should stop/start weston via systemd only if systemd
actually controls system startup, not merely when systemd is present.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
 meta/lib/oeqa/runtime/cases/weston.py        | 4 ++--
 meta/recipes-graphics/wayland/weston-init.bb | 9 +++++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oeqa/runtime/cases/weston.py b/meta/lib/oeqa/runtime/cases/weston.py
index 36b4f9e375..d3fbf8ba92 100644
--- a/meta/lib/oeqa/runtime/cases/weston.py
+++ b/meta/lib/oeqa/runtime/cases/weston.py
@@ -34,7 +34,7 @@ class WestonTest(OERuntimeTestCase):
         return 'export XDG_RUNTIME_DIR=/run/user/0; export WAYLAND_DISPLAY=wayland-0; %s' % cmd
 
     def run_weston_init(self):
-        if 'systemd' in self.tc.td['DISTRO_FEATURES']:
+        if 'systemd' in self.tc.td['VIRTUAL-RUNTIME_init_manager']:
             self.target.run('systemd-run --collect --unit=weston-ptest.service --uid=0 -p PAMName=login -p TTYPath=/dev/tty6 -E XDG_RUNTIME_DIR=/tmp -E WAYLAND_DISPLAY=wayland-0 /usr/bin/weston --socket=wayland-1 --log=%s' % self.weston_log_file)
         else:
             self.target.run(self.get_weston_command('openvt -- weston --socket=wayland-1 --log=%s' % self.weston_log_file))
@@ -66,7 +66,7 @@ class WestonTest(OERuntimeTestCase):
         new_wl_processes, try_cnt = self.get_new_wayland_processes(existing_wl_processes)
         existing_and_new_weston_processes = self.get_processes_of('weston', 'existing and new')
         new_weston_processes = [x for x in existing_and_new_weston_processes if x not in existing_weston_processes]
-        if 'systemd' in self.tc.td['DISTRO_FEATURES']:
+        if 'systemd' in self.tc.td['VIRTUAL-RUNTIME_init_manager']:
             self.target.run('systemctl stop weston-ptest.service')
         else:
             for w in new_weston_processes:
diff --git a/meta/recipes-graphics/wayland/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb
index b7a99be646..4b2a6ca983 100644
--- a/meta/recipes-graphics/wayland/weston-init.bb
+++ b/meta/recipes-graphics/wayland/weston-init.bb
@@ -26,7 +26,9 @@ DEFAULTBACKEND_qemux86 = "drm"
 DEFAULTBACKEND_qemux86-64 = "drm"
 
 do_install() {
-	install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
+        if [ "${VIRTUAL-RUNTIME_init_manager}" != "systemd" ]; then
+		install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
+        fi
 	install -D -p -m0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini
 	install -Dm644 ${WORKDIR}/weston.env ${D}${sysconfdir}/default/weston
 
@@ -55,10 +57,13 @@ do_install() {
 	fi
 }
 
+INHIBIT_UPDATERCD_BBCLASS = "${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', '1', '', d)}"
+
 inherit update-rc.d features_check systemd
 
 # rdepends on weston which depends on virtual/egl
-REQUIRED_DISTRO_FEATURES = "opengl"
+# requires pam enabled if started via systemd
+REQUIRED_DISTRO_FEATURES = "opengl ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'pam', '', d)}"
 
 RDEPENDS_${PN} = "weston kbd"
 
-- 
2.29.1


  parent reply	other threads:[~2020-11-09  8:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09  8:31 [RFC PATCH 01/12] core-image-weston: add sdk/ptest images Alexander Kanavin
2020-11-09  8:31 ` [RFC PATCH 02/12] oeqa/buildperf: use weston image instead of sato Alexander Kanavin
2020-11-09 17:16   ` [OE-core] " Richard Purdie
2020-11-09  8:31 ` [RFC PATCH 03/12] oeqa/core/tests/test_data.py: " Alexander Kanavin
2020-11-09  8:31 ` [RFC PATCH 04/12] oeqa/selftest: transition to weston images Alexander Kanavin
2020-11-09  8:31 ` [RFC PATCH 05/12] core-image-multilib-example: base on weston, and not sato Alexander Kanavin
2020-11-09  8:31 ` [RFC PATCH 06/12] default-distrovars.inc: add wayland/opengl to default distro features Alexander Kanavin
2020-11-09  8:31 ` [RFC PATCH 07/12] conf-notes.txt: mention more important images than just sato Alexander Kanavin
2020-11-09  8:31 ` Alexander Kanavin [this message]
2020-11-14  8:46   ` [OE-core] [RFC PATCH 08/12] weston-init: correctly start under systemd Martin Jansa
2020-11-09  8:31 ` [RFC PATCH 09/12] weston-init: fall back to fbdev under x32 Alexander Kanavin
2020-11-09  8:31 ` [RFC PATCH 10/12] wayland-utils: introduce a recipe Alexander Kanavin
2020-11-09  8:31 ` [RFC PATCH 11/12] poky/conf-notes.txt: mention more important images than just sato Alexander Kanavin
2020-11-09  8:31 ` [RFC PATCH 12/12] poky.conf: remove wayland/opengl from distro features, as it is now oe-core default Alexander Kanavin

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=20201109083133.16503-8-alex.kanavin@gmail.com \
    --to=alex.kanavin@gmail.com \
    --cc=openembedded-core@lists.openembedded.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox