Add auto-fallback hack for when KMS isn't available (#1952431)

epel9
Neal Gompa 4 years ago
parent 667b1e908e
commit 27d6022c46

@ -0,0 +1,2 @@
# disable Wayland if modesetting is disabled
IMPORT{cmdline}="nomodeset", RUN+="/usr/libexec/sddm-disable-plasmawayland"

@ -0,0 +1,35 @@
#!/bin/bash
# Copyright (C) 2021 Neal Gompa
#
# Fedora-License-Identifier: MIT
# SPDX-2.0-License-Identifier: MIT
# SPDX-3.0-License-Identifier: MIT
#
# This program is free software.
# For more information on free software, see
# <https://www.gnu.org/philosophy/free-sw.en.html>.
# This script rewrites SDDM configuration to switch from Wayland to X11 in the event
# Plasma Wayland session is not desired.
# Determine whether Plasma Wayland is the default session
WAYLAND_DEFAULT=1
X11_SESSION_NAME="plasmax11.desktop"
if [ -f "/usr/share/xsessions/plasma.desktop" ]; then
# We're in a world before Plasma Wayland is default
WAYLAND_DEFAULT=0
X11_SESSION_NAME="plasma.desktop"
fi
# If autologin is configured, force back to X11 session
if [ -f "/etc/sddm.conf" ]; then
sed -e "s|^Session=plasma.*|Session=${X11_SESSION_NAME}|" -i /etc/sddm.conf
fi
# If previous session was Wayland, set it to X11 now
if [ -f "/var/lib/sddm/state.conf" ]; then
sed -e "s|^Session=/usr/share/wayland-sessions/plasma.*|Session=/usr/share/xsessions/${X11_SESSION_NAME}|" -i /var/lib/sddm/state.conf
fi

@ -9,7 +9,7 @@
Name: sddm
Version: 0.19.0
Release: 10%{?dist}
Release: 11%{?dist}
License: GPLv2+
Summary: QML based X11 desktop manager
@ -58,6 +58,9 @@ Source14: sddm.conf
Source15: README.scripts
# sysconfig snippet
Source16: sddm.sysconfig
# udev rules for disabling plasma-wayland in broken scenarios
Source17: 61-sddm-plasmawayland.rules
Source18: sddm-disable-plasmawayland.sh
Provides: service(graphical-login) = sddm
@ -155,6 +158,9 @@ cp -a %{buildroot}%{_datadir}/sddm/scripts/* \
# we're using /etc/X11/xinit/Xsession (by default) instead
rm -fv %{buildroot}%{_sysconfdir}/sddm/Xsession
# Add auto-fallback hack for when modesetting isn't available (#1952431)
install -Dpm 644 %{SOURCE17} %{buildroot}%{_udevrulesdir}/61-sddm-plasmawayland.rules
install -Dpm 755 %{SOURCE18} %{buildroot}%{_libexecdir}/sddm-disable-plasmawayland
%pre
getent group sddm >/dev/null || groupadd -r sddm
@ -223,6 +229,8 @@ fi
%{_bindir}/sddm-greeter
%{_libexecdir}/sddm-helper
%{_tmpfilesdir}/sddm.conf
%{_udevrulesdir}/61-sddm-plasmawayland.rules
%{_libexecdir}/sddm-disable-plasmawayland
%attr(0711, root, sddm) %dir %{_localstatedir}/run/sddm
%attr(1770, sddm, sddm) %dir %{_localstatedir}/lib/sddm
%{_unitdir}/sddm.service
@ -246,6 +254,9 @@ fi
%changelog
* Thu Apr 22 2021 Neal Gompa <ngompa13@gmail.com> - 0.19.0-11
- Add auto-fallback hack for when KMS isn't available (#1952431)
* Tue Apr 13 2021 Adam Williamson <awilliam@redhat.com> - 0.19.0-10
- Backport part of PR #1371 to improve session switching (#1929643)

Loading…
Cancel
Save