mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 00:49:33 +02:00
weston-init: Allow weston user to be specified
Adds variables to set the name of the weston user (defaulting to "weston") and the home directory (defaulting to "/home/weston"). This allows users to easily change which user the compositor runs as. (From OE-Core rev: 079cf188adae1c7de3971a64df8cb04d5f47be4e) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
12e142d5e6
commit
ee905ad60b
@@ -25,6 +25,8 @@ PACKAGECONFIG[use-pixman] = ",,"
|
|||||||
|
|
||||||
DEFAULTBACKEND ??= ""
|
DEFAULTBACKEND ??= ""
|
||||||
DEFAULTBACKEND:qemuall ?= "drm"
|
DEFAULTBACKEND:qemuall ?= "drm"
|
||||||
|
WESTON_USER ??= "weston"
|
||||||
|
WESTON_USER_HOME ??= "/home/${WESTON_USER}"
|
||||||
|
|
||||||
do_install() {
|
do_install() {
|
||||||
# Install weston-start script
|
# Install weston-start script
|
||||||
@@ -41,10 +43,15 @@ do_install() {
|
|||||||
install -D -p -m0644 ${S}/weston.service ${D}${systemd_system_unitdir}/weston.service
|
install -D -p -m0644 ${S}/weston.service ${D}${systemd_system_unitdir}/weston.service
|
||||||
install -D -p -m0644 ${S}/weston.socket ${D}${systemd_system_unitdir}/weston.socket
|
install -D -p -m0644 ${S}/weston.socket ${D}${systemd_system_unitdir}/weston.socket
|
||||||
install -D -p -m0644 ${S}/weston-socket.sh ${D}${sysconfdir}/profile.d/weston-socket.sh
|
install -D -p -m0644 ${S}/weston-socket.sh ${D}${sysconfdir}/profile.d/weston-socket.sh
|
||||||
sed -i -e s:/etc:${sysconfdir}:g \
|
sed -i -e s:@sysconfdir@:${sysconfdir}:g \
|
||||||
-e s:/usr/bin:${bindir}:g \
|
-e s:@bindir@:${bindir}:g \
|
||||||
-e s:/var:${localstatedir}:g \
|
-e s:@localstatedir@:${localstatedir}:g \
|
||||||
${D}${systemd_system_unitdir}/weston.service
|
-e s:@runtimedir@:${runtimedir}:g \
|
||||||
|
-e s:@WESTON_USER@:${WESTON_USER}:g \
|
||||||
|
-e s:@WESTON_USER_HOME@:${WESTON_USER_HOME}:g \
|
||||||
|
${D}${systemd_system_unitdir}/weston.service \
|
||||||
|
${D}${systemd_system_unitdir}/weston.socket \
|
||||||
|
${D}${sysconfdir}/profile.d/weston-socket.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
|
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
|
||||||
@@ -70,7 +77,7 @@ do_install() {
|
|||||||
sed -i -e "/^\[core\]/a use-pixman=true" ${D}${sysconfdir}/xdg/weston/weston.ini
|
sed -i -e "/^\[core\]/a use-pixman=true" ${D}${sysconfdir}/xdg/weston/weston.ini
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install -dm 755 -o weston -g weston ${D}/home/weston
|
install -dm 755 -o ${WESTON_USER} -g ${WESTON_USER} ${D}/${WESTON_USER_HOME}
|
||||||
}
|
}
|
||||||
|
|
||||||
INHIBIT_UPDATERCD_BBCLASS = "${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', '1', '', d)}"
|
INHIBIT_UPDATERCD_BBCLASS = "${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', '1', '', d)}"
|
||||||
@@ -95,11 +102,11 @@ FILES:${PN} += "\
|
|||||||
${systemd_system_unitdir}/weston.socket \
|
${systemd_system_unitdir}/weston.socket \
|
||||||
${sysconfdir}/default/weston \
|
${sysconfdir}/default/weston \
|
||||||
${sysconfdir}/pam.d/ \
|
${sysconfdir}/pam.d/ \
|
||||||
/home/weston \
|
${WESTON_USER_HOME} \
|
||||||
"
|
"
|
||||||
|
|
||||||
CONFFILES:${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston"
|
CONFFILES:${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston"
|
||||||
|
|
||||||
SYSTEMD_SERVICE:${PN} = "weston.service weston.socket"
|
SYSTEMD_SERVICE:${PN} = "weston.service weston.socket"
|
||||||
USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input,render,seat,wayland weston"
|
USERADD_PARAM:${PN} = "--home ${WESTON_USER_HOME} --shell /bin/sh --user-group -G video,input,render,seat,wayland ${WESTON_USER}"
|
||||||
GROUPADD_PARAM:${PN} = "-r wayland; -r render; -r seat"
|
GROUPADD_PARAM:${PN} = "-r wayland; -r render; -r seat"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# set weston variables for use with global weston socket
|
# set weston variables for use with global weston socket
|
||||||
global_socket="/run/wayland-0"
|
global_socket="@runtimedir@/wayland-0"
|
||||||
if [ -e "$global_socket" ]; then
|
if [ -e "$global_socket" ]; then
|
||||||
weston_group=$(stat -c "%G" "$global_socket")
|
weston_group=$(stat -c "%G" "$global_socket")
|
||||||
if [ "$(id -u)" = "0" ]; then
|
if [ "$(id -u)" = "0" ]; then
|
||||||
|
|||||||
@@ -33,19 +33,19 @@ ConditionPathExists=/dev/tty0
|
|||||||
[Service]
|
[Service]
|
||||||
# Requires systemd-notify.so Weston plugin.
|
# Requires systemd-notify.so Weston plugin.
|
||||||
Type=notify
|
Type=notify
|
||||||
EnvironmentFile=/etc/default/weston
|
EnvironmentFile=@sysconfdir@/default/weston
|
||||||
ExecStart=/usr/bin/weston --modules=systemd-notify.so
|
ExecStart=@bindir@/weston --modules=systemd-notify.so
|
||||||
|
|
||||||
# Optional watchdog setup
|
# Optional watchdog setup
|
||||||
#TimeoutStartSec=60
|
#TimeoutStartSec=60
|
||||||
#WatchdogSec=20
|
#WatchdogSec=20
|
||||||
|
|
||||||
# The user to run Weston as.
|
# The user to run Weston as.
|
||||||
User=weston
|
User=@WESTON_USER@
|
||||||
Group=weston
|
Group=@WESTON_USER@
|
||||||
|
|
||||||
# Make sure the working directory is the users home directory
|
# Make sure the working directory is the users home directory
|
||||||
WorkingDirectory=/home/weston
|
WorkingDirectory=@WESTON_USER_HOME@
|
||||||
|
|
||||||
# Set up a full user session for the user, required by Weston.
|
# Set up a full user session for the user, required by Weston.
|
||||||
PAMName=weston-autologin
|
PAMName=weston-autologin
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Weston socket
|
Description=Weston socket
|
||||||
RequiresMountsFor=/run
|
RequiresMountsFor=@runtimedir@
|
||||||
|
|
||||||
[Socket]
|
[Socket]
|
||||||
ListenStream=/run/wayland-0
|
ListenStream=@runtimedir@/wayland-0
|
||||||
SocketMode=0775
|
SocketMode=0775
|
||||||
SocketUser=weston
|
SocketUser=@WESTON_USER@
|
||||||
SocketGroup=wayland
|
SocketGroup=wayland
|
||||||
RemoveOnStop=yes
|
RemoveOnStop=yes
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user