diff options
author | Pavel Zhukov <pavel.zhukov@huawei.com> | 2021-10-06 13:19:13 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-23 23:14:16 +0100 |
commit | e0cb0077e266c6b15858b75b467d22d1c415a532 (patch) | |
tree | 79717cb36677829c7392cc11443ce556b80a564d /meta | |
parent | f21c479c3a685644b3cf5c50a8ab86248aa3b17a (diff) | |
download | poky-e0cb0077e266c6b15858b75b467d22d1c415a532.tar.gz |
weston: Use systemd notify,
Using systemd notify fixes the problem with dependency chain in case
if other services depend on running weston.
This change required more robust handling of weston modules arguments
due to custom argument parser impmentation in weston (only last
--modules argument is accepted) and fixes the bug in modules handling
in the weston-start script (only last argument is actually parsed by
weston). Master branch implements systemd-notify thus backport but
doesn't utilize modules anymore so this change is mostly dunfell
specific.
Upstream-status: Backport
(From OE-Core rev: 4efdcc10906945765aa28324ce1badc59cda2976)
Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com>
Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
5 files changed, 34 insertions, 2 deletions
diff --git a/meta/recipes-graphics/wayland/weston-init/weston-start b/meta/recipes-graphics/wayland/weston-init/weston-start index ccc7093425..97471df80d 100755 --- a/meta/recipes-graphics/wayland/weston-init/weston-start +++ b/meta/recipes-graphics/wayland/weston-init/weston-start | |||
@@ -23,6 +23,15 @@ add_openvt_argument() { | |||
23 | openvt_args="$openvt_args $1" | 23 | openvt_args="$openvt_args $1" |
24 | } | 24 | } |
25 | 25 | ||
26 | ## Add module to --modules argument | ||
27 | add_weston_module() { | ||
28 | if [ -z "${weston_modules}" ]; then | ||
29 | weston_modules="--modules " | ||
30 | fi; | ||
31 | weston_modules="${weston_modules}${1}," | ||
32 | } | ||
33 | |||
34 | |||
26 | if [ -n "$WAYLAND_DISPLAY" ]; then | 35 | if [ -n "$WAYLAND_DISPLAY" ]; then |
27 | echo "ERROR: A Wayland compositor is already running, nested Weston instance is not supported yet." | 36 | echo "ERROR: A Wayland compositor is already running, nested Weston instance is not supported yet." |
28 | exit 1 | 37 | exit 1 |
@@ -65,6 +74,9 @@ if [ -d "$modules_dir" ]; then | |||
65 | # process module | 74 | # process module |
66 | . $m | 75 | . $m |
67 | done | 76 | done |
77 | if [ -n "${weston_modules}" ]; then | ||
78 | add_weston_argument "${weston_modules} " | ||
79 | fi; | ||
68 | fi | 80 | fi |
69 | 81 | ||
70 | if test -z "$XDG_RUNTIME_DIR"; then | 82 | if test -z "$XDG_RUNTIME_DIR"; then |
diff --git a/meta/recipes-graphics/wayland/weston-init/weston@.service b/meta/recipes-graphics/wayland/weston-init/weston@.service index 39e193014a..70c706d75c 100644 --- a/meta/recipes-graphics/wayland/weston-init/weston@.service +++ b/meta/recipes-graphics/wayland/weston-init/weston@.service | |||
@@ -1,3 +1,7 @@ | |||
1 | # SPDX-FileCopyrightText: Huawei Inc. | ||
2 | # | ||
3 | # SPDX-License-Identifier: Apache-2.0 | ||
4 | |||
1 | [Unit] | 5 | [Unit] |
2 | Description=Weston Wayland Compositor | 6 | Description=Weston Wayland Compositor |
3 | RequiresMountsFor=/run | 7 | RequiresMountsFor=/run |
@@ -5,6 +9,8 @@ Conflicts=plymouth-quit.service | |||
5 | After=systemd-user-sessions.service plymouth-quit-wait.service | 9 | After=systemd-user-sessions.service plymouth-quit-wait.service |
6 | 10 | ||
7 | [Service] | 11 | [Service] |
12 | Type=notify | ||
13 | NotifyAccess=all | ||
8 | User=%i | 14 | User=%i |
9 | PAMName=login | 15 | PAMName=login |
10 | EnvironmentFile=-/etc/default/weston | 16 | EnvironmentFile=-/etc/default/weston |
diff --git a/meta/recipes-graphics/wayland/weston/systemd-notify.weston-start b/meta/recipes-graphics/wayland/weston/systemd-notify.weston-start new file mode 100644 index 0000000000..fdb48cb609 --- /dev/null +++ b/meta/recipes-graphics/wayland/weston/systemd-notify.weston-start | |||
@@ -0,0 +1,9 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # SPDX-FileCopyrightText: Huawei Inc. | ||
4 | # SPDX-License-Identifier: Apache-2.0 | ||
5 | |||
6 | |||
7 | if [[ -x "/usr/lib/weston/systemd-notify.so" ]]; then | ||
8 | add_weston_module "systemd-notify.so" | ||
9 | fi | ||
diff --git a/meta/recipes-graphics/wayland/weston/xwayland.weston-start b/meta/recipes-graphics/wayland/weston/xwayland.weston-start index b483c97cf1..22984f50a4 100644 --- a/meta/recipes-graphics/wayland/weston/xwayland.weston-start +++ b/meta/recipes-graphics/wayland/weston/xwayland.weston-start | |||
@@ -2,6 +2,5 @@ | |||
2 | 2 | ||
3 | if type Xwayland >/dev/null 2>/dev/null; then | 3 | if type Xwayland >/dev/null 2>/dev/null; then |
4 | mkdir -p /tmp/.X11-unix | 4 | mkdir -p /tmp/.X11-unix |
5 | 5 | add_weston_module "xwayland.so" | |
6 | add_weston_argument "--modules=xwayland.so" | ||
7 | fi | 6 | fi |
diff --git a/meta/recipes-graphics/wayland/weston_8.0.0.bb b/meta/recipes-graphics/wayland/weston_8.0.0.bb index 0b383f25f3..2b120d7404 100644 --- a/meta/recipes-graphics/wayland/weston_8.0.0.bb +++ b/meta/recipes-graphics/wayland/weston_8.0.0.bb | |||
@@ -5,9 +5,11 @@ LICENSE = "MIT" | |||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \ | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \ |
6 | file://libweston/compositor.c;endline=27;md5=6c53bbbd99273f4f7c4affa855c33c0a" | 6 | file://libweston/compositor.c;endline=27;md5=6c53bbbd99273f4f7c4affa855c33c0a" |
7 | 7 | ||
8 | |||
8 | SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ | 9 | SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ |
9 | file://weston.png \ | 10 | file://weston.png \ |
10 | file://weston.desktop \ | 11 | file://weston.desktop \ |
12 | file://systemd-notify.weston-start \ | ||
11 | file://xwayland.weston-start \ | 13 | file://xwayland.weston-start \ |
12 | file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \ | 14 | file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \ |
13 | " | 15 | " |
@@ -101,6 +103,10 @@ do_install_append() { | |||
101 | install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland | 103 | install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland |
102 | fi | 104 | fi |
103 | 105 | ||
106 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'yes', 'no', d)}" = "yes" ]; then | ||
107 | install -Dm 644 ${WORKDIR}/systemd-notify.weston-start ${D}${datadir}/weston-start/systemd-notify | ||
108 | fi | ||
109 | |||
104 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'launch', 'yes', 'no', d)}" = "yes" ]; then | 110 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'launch', 'yes', 'no', d)}" = "yes" ]; then |
105 | chmod u+s ${D}${bindir}/weston-launch | 111 | chmod u+s ${D}${bindir}/weston-launch |
106 | fi | 112 | fi |