Backport /dev/tty0 fix to server-21.1-branch
Several users have complained recently about not being able to run Xorg in a container because it fails to open /dev/tty0. Commit b8c12aac fixes the problem, so I think it makes sense to backport to server-21.1-branch.
Tested by creating a minimal chroot with
pacstrap, launching it with
sudo systemd-nspawn -b -M xorg-devel -D chroot --bind=/dev/nvidia0 --bind=/dev/nvidiactl --bind=/dev/nvidia-modeset and then running Xorg with the NVIDIA driver inside the container. I verified that without this fix, Xorg fails to open /dev/tty0 and with it, it successfully starts a headless X server.
(cherry picked from commit b8c12aac)