summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRandolph Sapp <rs@ti.com>2023-06-14 10:33:31 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-06-15 08:00:41 +0100
commit8f4b90c0430a47ca01fc9205db4b5d16d8bccdaf (patch)
tree0bdbe44bddd584585f2e80203996c63593d746f1
parent3cd202d7df753547959ecd18d1fa9d07a7566e08 (diff)
downloadpoky-8f4b90c0430a47ca01fc9205db4b5d16d8bccdaf.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: 2818cbc73093996f8ecb93a4f0df8a31fd4692d3) Signed-off-by: Randolph Sapp <rs@ti.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 9d892d58f2..1884b5d440 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
@@ -39,6 +40,7 @@ do_install() {
39 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then 40 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
40 install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service 41 install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service
41 install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_system_unitdir}/weston.socket 42 install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_system_unitdir}/weston.socket
43 install -D -p -m0644 ${WORKDIR}/weston-socket.sh ${D}${sysconfdir}/profile.d/weston-socket.sh
42 sed -i -e s:/etc:${sysconfdir}:g \ 44 sed -i -e s:/etc:${sysconfdir}:g \
43 -e s:/usr/bin:${bindir}:g \ 45 -e s:/usr/bin:${bindir}:g \
44 -e s:/var:${localstatedir}:g \ 46 -e s:/var:${localstatedir}:g \
@@ -88,6 +90,7 @@ INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
88 90
89FILES:${PN} += "\ 91FILES:${PN} += "\
90 ${sysconfdir}/xdg/weston/weston.ini \ 92 ${sysconfdir}/xdg/weston/weston.ini \
93 ${sysconfdir}/profile.d/weston-socket.sh \
91 ${systemd_system_unitdir}/weston.service \ 94 ${systemd_system_unitdir}/weston.service \
92 ${systemd_system_unitdir}/weston.socket \ 95 ${systemd_system_unitdir}/weston.socket \
93 ${sysconfdir}/default/weston \ 96 ${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