From 5258c525f9aa40bec05d5e8d9ba4c20cfe6d4f19 Mon Sep 17 00:00:00 2001
From: Andrei Gherzan <andrei.gherzan@huawei.com>
Date: Tue, 9 Mar 2021 11:18:34 +0000
Subject: [PATCH] weston-init: Override the systemd service by a notify-based
 one

Using systemd notify, a service dependency would be more robust. This
allows, for example, another service to depend on weston-init without
having to hack a sleep (or similar).

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
---
 .../wayland/weston-init.bbappend                |  2 ++
 .../wayland/weston-init/weston@.service         | 17 +++++++++++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 meta-ohos-core/recipes-graphics/wayland/weston-init/weston@.service

diff --git a/meta-ohos-core/recipes-graphics/wayland/weston-init.bbappend b/meta-ohos-core/recipes-graphics/wayland/weston-init.bbappend
index c98e752c..6c16444c 100644
--- a/meta-ohos-core/recipes-graphics/wayland/weston-init.bbappend
+++ b/meta-ohos-core/recipes-graphics/wayland/weston-init.bbappend
@@ -1,3 +1,5 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
 WESTON_DYNAMIC_INI ?= "0"
 WESTON_INI_PATH ?= "etc/xdg/weston/weston.ini"
 
diff --git a/meta-ohos-core/recipes-graphics/wayland/weston-init/weston@.service b/meta-ohos-core/recipes-graphics/wayland/weston-init/weston@.service
new file mode 100644
index 00000000..bb40cc6b
--- /dev/null
+++ b/meta-ohos-core/recipes-graphics/wayland/weston-init/weston@.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Weston Wayland Compositor
+RequiresMountsFor=/run
+Conflicts=plymouth-quit.service
+After=systemd-user-sessions.service plymouth-quit-wait.service
+
+[Service]
+Type=notify
+NotifyAccess=all
+User=%i
+PAMName=login
+EnvironmentFile=-/etc/default/weston
+StandardError=journal
+PermissionsStartOnly=true
+IgnoreSIGPIPE=no
+
+ExecStart=/usr/bin/weston-start -v -e -- $OPTARGS --modules=systemd-notify.so
-- 
GitLab