Skip to content

Commit

Permalink
xserver-nodm: run via systemd user session
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Díaz <[email protected]>
  • Loading branch information
mrchapp committed Feb 7, 2017
1 parent f7361ea commit d73c623
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ACTION=="add", SUBSYSTEM=="drm", KERNEL=="card0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="[email protected]"
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[Unit]
Description=Xserver startup with a display manager (on tty7)
RequiresMountsFor=/run
Conflicts[email protected] plymouth-quit.service
After=systemd-user-sessions.service [email protected] plymouth-quit-wait.service

[Service]
User=%i
PermissionsStartOnly=true

# Log us in via PAM so we get our XDG & co. environment and
# are treated as logged in so we can use the tty:
PAMName=login

# Grab tty7
UtmpIdentifier=tty7
TTYPath=/dev/tty7
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes

# stderr to journal so our logging doesn't get thrown into /dev/null
StandardOutput=tty
StandardInput=tty
StandardError=journal

EnvironmentFile=-/etc/default/xserver-nodm
ExecStart=/etc/X11/Xserver vt7 $OPTARGS

#[Install]
#Alias=display-manager.service
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ARGS="-logfile ${XDG_RUNTIME_DIR}/Xorg.log"
28 changes: 28 additions & 0 deletions recipes-graphics/xserver-nodm-init/xserver-nodm-init_2.%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
SRC_URI += "file://[email protected] \
file://71-xserver-drm.rules \
file://xserver-system \
"

do_install_append() {
install -D -p -m0644 ${WORKDIR}/xserver-system \
${D}${sysconfdir}/X11/xserver-system

# Remove upstream xserver-nodm.service
rm ${D}${systemd_unitdir}/system/xserver-nodm.service

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

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
FILES_${PN} += "${systemd_unitdir}/system/[email protected]"

SYSTEMD_SERVICE_${PN} = "xserver-nodm@%i.service"
SYSTEMD_AUTO_ENABLE = "disable"

0 comments on commit d73c623

Please sign in to comment.