summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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