summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRandolph Sapp <rs@ti.com>2023-06-14 10:33:31 -0500
committerSteve Sakoman <steve@sakoman.com>2023-07-04 05:32:29 -1000
commit810b3457f3dd492baa86d4f635858e0165826023 (patch)
tree4f32ff7ee2389d0843d3a4be176b1b68e6baf278 /meta
parent9008062ae84c4f331fda1c445fc71ae7aabfbf1a (diff)
downloadpoky-810b3457f3dd492baa86d4f635858e0165826023.tar.gz
weston-init: add profile to point users to global socket
Add profile script to point users capable of interacting with the global socket to it by default. (From OE-Core rev: 1600f38d72818cda78a4731354dbecc144f664c9) Signed-off-by: Randolph Sapp <rs@ti.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2818cbc73093996f8ecb93a4f0df8a31fd4692d3) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-graphics/wayland/weston-init.bb3
-rwxr-xr-xmeta/recipes-graphics/wayland/weston-init/weston-socket.sh20
2 files changed, 23 insertions, 0 deletions
diff --git a/meta/recipes-graphics/wayland/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb
index be6aef07af..99b99f72f1 100644
--- a/meta/recipes-graphics/wayland/weston-init.bb
+++ b/meta/recipes-graphics/wayland/weston-init.bb
@@ -9,6 +9,7 @@ SRC_URI = "file://init \
9 file://weston.ini \ 9 file://weston.ini \
10 file://weston.service \ 10 file://weston.service \
11 file://weston.socket \ 11 file://weston.socket \
12 file://weston-socket.sh \
12 file://weston-autologin \ 13 file://weston-autologin \
13 file://weston-start" 14 file://weston-start"
14 15
@@ -38,6 +39,7 @@ do_install() {
38 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then 39 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
39 install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service 40 install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service
40 install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_system_unitdir}/weston.socket 41 install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_system_unitdir}/weston.socket
42 install -D -p -m0644 ${WORKDIR}/weston-socket.sh ${D}${sysconfdir}/profile.d/weston-socket.sh
41 sed -i -e s:/etc:${sysconfdir}:g \ 43 sed -i -e s:/etc:${sysconfdir}:g \
42 -e s:/usr/bin:${bindir}:g \ 44 -e s:/usr/bin:${bindir}:g \
43 -e s:/var:${localstatedir}:g \ 45 -e s:/var:${localstatedir}:g \
@@ -87,6 +89,7 @@ INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
87 89
88FILES:${PN} += "\ 90FILES:${PN} += "\
89 ${sysconfdir}/xdg/weston/weston.ini \ 91 ${sysconfdir}/xdg/weston/weston.ini \
92 ${sysconfdir}/profile.d/weston-socket.sh \
90 ${systemd_system_unitdir}/weston.service \ 93 ${systemd_system_unitdir}/weston.service \
91 ${systemd_system_unitdir}/weston.socket \ 94 ${systemd_system_unitdir}/weston.socket \
92 ${sysconfdir}/default/weston \ 95 ${sysconfdir}/default/weston \
diff --git a/meta/recipes-graphics/wayland/weston-init/weston-socket.sh b/meta/recipes-graphics/wayland/weston-init/weston-socket.sh
new file mode 100755
index 0000000000..86389d63a3
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/weston-socket.sh
@@ -0,0 +1,20 @@
1#!/bin/sh
2
3# set weston variables for use with global weston socket
4global_socket="/run/wayland-0"
5if [ -e "$global_socket" ]; then
6 weston_group=$(stat -c "%G" "$global_socket")
7 if [ "$(id -u)" = "0" ]; then
8 export WAYLAND_DISPLAY="$global_socket"
9 else
10 case "$(groups "$USER")" in
11 *"$weston_group"*)
12 export WAYLAND_DISPLAY="$global_socket"
13 ;;
14 *)
15 ;;
16 esac
17 fi
18 unset weston_group
19fi
20unset global_socket