]> code.ossystems Code Review - openembedded-core.git/commitdiff
weston-init: correctly start under systemd
authorAlexander Kanavin <alex.kanavin@gmail.com>
Mon, 9 Nov 2020 08:31:29 +0000 (09:31 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 11 Nov 2020 10:08:07 +0000 (10:08 +0000)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runtime/cases/weston.py
meta/recipes-graphics/wayland/weston-init.bb

index 36b4f9e375ecbe9a5d1c45cfe616b29e3b8c1579..d3fbf8ba92c5d1528baf707f13a38f7e9c9a6626 100644 (file)
@@ -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:
index b7a99be6461fa283f5131d29d35bab19ab16c12b..4b2a6ca983b1545949bb832d69e225d3e156b0ad 100644 (file)
@@ -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"