Skip to content

Commit

Permalink
weston-init: run in user session
Browse files Browse the repository at this point in the history
Run Weston as user linaro within a systemd --user session.

Signed-off-by: Daniel Díaz <[email protected]>
  • Loading branch information
mrchapp authored and fboudra committed Feb 7, 2017
1 parent ba8b071 commit f7361ea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
14 changes: 9 additions & 5 deletions recipes-graphics/wayland/weston-init.bbappend
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
inherit systemd

SRC_URI += "file://weston.ini \
file://weston.service \
file://weston@.service \
file://71-weston-drm.rules \
"

do_install_append() {
install -D -p -m0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini

# Remove upstream weston.service
rm ${D}${systemd_unitdir}/system/weston.service

# Install Weston systemd service and accompanying udev rule
install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_unitdir}/system/weston.service
install -D -p -m0644 ${WORKDIR}/weston@.service ${D}${systemd_unitdir}/system/weston@.service
sed -i -e s:/etc:${sysconfdir}:g \
-e s:/usr/bin:${bindir}:g \
-e s:/var:${localstatedir}:g \
${D}${systemd_unitdir}/system/weston.service
${D}${systemd_unitdir}/system/weston@.service
install -D -p -m0644 ${WORKDIR}/71-weston-drm.rules \
${D}${sysconfdir}/udev/rules.d/71-weston-drm.rules
}

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
FILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini"
FILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${systemd_unitdir}/system/[email protected]"

CONFFILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini"

SYSTEMD_SERVICE_${PN} = "weston.service"
SYSTEMD_SERVICE_${PN} = "weston@%i.service"
SYSTEMD_AUTO_ENABLE = "disable"
2 changes: 1 addition & 1 deletion recipes-graphics/wayland/weston-init/71-weston-drm.rules
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ACTION=="add", SUBSYSTEM=="drm", KERNEL=="card0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="weston.service"
ACTION=="add", SUBSYSTEM=="drm", KERNEL=="card0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="weston@linaro.service"
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ [email protected] plymouth-quit.service
After=systemd-user-sessions.service [email protected] plymouth-quit-wait.service

[Service]
User=root
User=%i
PermissionsStartOnly=true

# Log us in via PAM so we get our XDG & co. environment and
Expand All @@ -29,7 +29,7 @@ EnvironmentFile=-/etc/default/weston
# Weston does not successfully change VT, nor does systemd place us on
# the VT it just activated for us. Switch manually:
ExecStartPre=/usr/bin/chvt 7
ExecStart=/usr/bin/weston --log=/var/log/weston.log $OPTARGS
ExecStart=/usr/bin/weston --log=${XDG_RUNTIME_DIR}/weston.log $OPTARGS

IgnoreSIGPIPE=no

Expand Down

0 comments on commit f7361ea

Please sign in to comment.