mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
3cd202d7df
commit
8f4b90c043
@@ -9,6 +9,7 @@ SRC_URI = "file://init \
|
|||||||
file://weston.ini \
|
file://weston.ini \
|
||||||
file://weston.service \
|
file://weston.service \
|
||||||
file://weston.socket \
|
file://weston.socket \
|
||||||
|
file://weston-socket.sh \
|
||||||
file://weston-autologin \
|
file://weston-autologin \
|
||||||
file://weston-start"
|
file://weston-start"
|
||||||
|
|
||||||
@@ -39,6 +40,7 @@ do_install() {
|
|||||||
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
|
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
|
||||||
install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service
|
install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service
|
||||||
install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_system_unitdir}/weston.socket
|
install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_system_unitdir}/weston.socket
|
||||||
|
install -D -p -m0644 ${WORKDIR}/weston-socket.sh ${D}${sysconfdir}/profile.d/weston-socket.sh
|
||||||
sed -i -e s:/etc:${sysconfdir}:g \
|
sed -i -e s:/etc:${sysconfdir}:g \
|
||||||
-e s:/usr/bin:${bindir}:g \
|
-e s:/usr/bin:${bindir}:g \
|
||||||
-e s:/var:${localstatedir}:g \
|
-e s:/var:${localstatedir}:g \
|
||||||
@@ -88,6 +90,7 @@ INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
|
|||||||
|
|
||||||
FILES:${PN} += "\
|
FILES:${PN} += "\
|
||||||
${sysconfdir}/xdg/weston/weston.ini \
|
${sysconfdir}/xdg/weston/weston.ini \
|
||||||
|
${sysconfdir}/profile.d/weston-socket.sh \
|
||||||
${systemd_system_unitdir}/weston.service \
|
${systemd_system_unitdir}/weston.service \
|
||||||
${systemd_system_unitdir}/weston.socket \
|
${systemd_system_unitdir}/weston.socket \
|
||||||
${sysconfdir}/default/weston \
|
${sysconfdir}/default/weston \
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# set weston variables for use with global weston socket
|
||||||
|
global_socket="/run/wayland-0"
|
||||||
|
if [ -e "$global_socket" ]; then
|
||||||
|
weston_group=$(stat -c "%G" "$global_socket")
|
||||||
|
if [ "$(id -u)" = "0" ]; then
|
||||||
|
export WAYLAND_DISPLAY="$global_socket"
|
||||||
|
else
|
||||||
|
case "$(groups "$USER")" in
|
||||||
|
*"$weston_group"*)
|
||||||
|
export WAYLAND_DISPLAY="$global_socket"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
unset weston_group
|
||||||
|
fi
|
||||||
|
unset global_socket
|
||||||
Reference in New Issue
Block a user