gnome-base/gdm: wait for graphics DRM master with systemd
authorMart Raudsepp <leio@gentoo.org>
Wed, 27 Mar 2019 08:37:19 +0000 (10:37 +0200)
committerMart Raudsepp <leio@gentoo.org>
Wed, 27 Mar 2019 10:11:03 +0000 (12:11 +0200)
commit85ea6bed8c994eae9891af1a2fba0e99aa1c3031
treef0382dcf4eba025b3b8e11adeea0a6a218e3609b
parent2e44db8d62bee1108fd116ab3854b09446d25c66
gnome-base/gdm: wait for graphics DRM master with systemd

gdm currently lacks code to properly wait for the CanGraphical property
on a logind seat to switch to "Yes" before gnome-shell is started for the
login VT. This is a problem, especially with wayland enabled, when the
graphics system isn't fully initialized by the time gdm is started in
parallel, because gnome-shell will fail to start graphics and gdm will
retry with a X session, which likely succeeds at that point. This
unexpectedly ends up in a gdm Xorg session, instead of a gdm Wayland
session, which won't be able to start Wayland sessions, or reap itself
for memory savings once logged in, etc.
For systemd we can grab a workaround used by Ubuntu, which adds an
ExecStartPre command to the gdm service, that waits for the DRM master
to appear (with a 10 seconds safety fallback) before letting gdm itself
start up.
For OpenRC this is not effective, but combined with usually slower startup
of the system with OpenRC, and xdm service usually starting at the very end
(compared to rather early in parallel with systemd) due to various service
rules, it should be much more unlikely to be a problem for OpenRC systems,
or even impossible if something in init deps ends up waiting for udev to
settle.
Eventually, in a future release, there should be upstream gdm full
CanGraphical waiting on its own, which should solve any OpenRC issues as
well, provided that in-use elogind handles CanGraphical correctly (there
have been issues in systemd code too).

Bug: https://bugs.gentoo.org/613222
Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Mart Raudsepp <leio@gentoo.org>
gnome-base/gdm/files/gdm-CanGraphical-wait.patch [new file with mode: 0644]
gnome-base/gdm/gdm-3.30.3-r2.ebuild [new file with mode: 0644]