summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-09-17 05:36:42 +0000
committerCoprDistGit <infra@openeuler.org>2024-09-17 05:36:42 +0000
commitfde348faaf96a7eafad8da257147f04136be896f (patch)
tree26a2867791b801fd0e13ea581a1c3971390d1dcf
parente45543c25ec2b3282d0b570bf76a0c486ee56d07 (diff)
automatic import of sddmopeneuler24.03_LTS
-rw-r--r--.gitignore1
-rw-r--r--0001-Delay-for-logind-and-fallback-to-seat0.patch142
-rw-r--r--README.scripts2
-rw-r--r--sddm-0.18.0-environment_file.patch11
-rw-r--r--sddm-autologin.pam20
-rw-r--r--sddm-systemd-sysusers.conf1
-rw-r--r--sddm.conf122
-rw-r--r--sddm.pam23
-rw-r--r--sddm.spec179
-rw-r--r--sddm.sysconfig5
-rw-r--r--sources1
-rw-r--r--tmpfiles-sddm.conf2
12 files changed, 509 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..c3435a9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/sddm-0.20.0.tar.gz
diff --git a/0001-Delay-for-logind-and-fallback-to-seat0.patch b/0001-Delay-for-logind-and-fallback-to-seat0.patch
new file mode 100644
index 0000000..e6292da
--- /dev/null
+++ b/0001-Delay-for-logind-and-fallback-to-seat0.patch
@@ -0,0 +1,142 @@
+From 4d44531c8f624f5b479c3ff23e8fecc67eb848ab Mon Sep 17 00:00:00 2001
+From: Jeremy Linton <jeremy.linton@arm.com>
+Date: Fri, 22 Oct 2021 14:51:54 -0500
+Subject: [PATCH] Delay for logind, and fallback to seat0
+
+There is systemd/logind race with when restarting
+sddm that causes logind1 not to be available. Previously
+this meant the seat0 was immediately created regardless
+of the state of CanGraphical.
+
+Fixing this, though we still want seat0 to be started
+if none of the seats appear to be graphical. Presumably
+there are some graphics on the machine, otherwise
+why run sddm? Wait a bit, and create seat0 anyway. If
+this fails the output from Xorg should tell us why. This
+is generally a better strategy than what happens a good
+amount of time now, where sddm is started and silent about
+why the screen is blank.
+
+References:
+* https://bugzilla.redhat.com/2011991
+* https://bugzilla.redhat.com/2016310
+
+Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
+---
+ src/daemon/LogindDBusTypes.cpp | 31 +++++++++++++++++++++----------
+ src/daemon/SeatManager.cpp | 22 ++++++++++++++++++++++
+ src/daemon/SeatManager.h | 1 +
+ 3 files changed, 44 insertions(+), 10 deletions(-)
+
+diff --git a/src/daemon/LogindDBusTypes.cpp b/src/daemon/LogindDBusTypes.cpp
+index 011bb7f..6255c69 100644
+--- a/src/daemon/LogindDBusTypes.cpp
++++ b/src/daemon/LogindDBusTypes.cpp
+@@ -8,6 +8,8 @@
+
+ #include <QDebug>
+
++#include <unistd.h>
++
+ class LogindPathInternal {
+ public:
+ LogindPathInternal();
+@@ -46,17 +48,26 @@ LogindPathInternal::LogindPathInternal()
+ qRegisterMetaType<UserInfoList>("UserInfoList");
+ qDBusRegisterMetaType<UserInfoList>();
+
+- if (QDBusConnection::systemBus().interface()->isServiceRegistered(QStringLiteral("org.freedesktop.login1"))) {
+- qDebug() << "Logind interface found";
+- available = true;
+- serviceName = QStringLiteral("org.freedesktop.login1");
+- managerPath = QStringLiteral("/org/freedesktop/login1");
+- managerIfaceName = QStringLiteral("org.freedesktop.login1.Manager");
+- seatIfaceName = QStringLiteral("org.freedesktop.login1.Seat");
+- sessionIfaceName = QStringLiteral("org.freedesktop.login1.Session");
+- userIfaceName = QStringLiteral("org.freedesktop.login1.User");
+- return;
++#ifdef HAVE_SYSTEMD
++ // systemd-logind should be running, although because it takes a few moments to restart after
++ // systemctl isolate calls, it may not yet be running. Wait a few seconds for it, while blocking everything else.
++ int logind_wait_seconds = 50;
++ while (logind_wait_seconds--) {
++ if (QDBusConnection::systemBus().interface()->isServiceRegistered(QStringLiteral("org.freedesktop.login1"))) {
++ qDebug() << "Logind interface found";
++ available = true;
++ serviceName = QStringLiteral("org.freedesktop.login1");
++ managerPath = QStringLiteral("/org/freedesktop/login1");
++ managerIfaceName = QStringLiteral("org.freedesktop.login1.Manager");
++ seatIfaceName = QStringLiteral("org.freedesktop.login1.Seat");
++ sessionIfaceName = QStringLiteral("org.freedesktop.login1.Session");
++ userIfaceName = QStringLiteral("org.freedesktop.login1.User");
++ return;
++ }
++ qDebug() << "Sleeping for systemd-logind";
++ usleep(100000);
+ }
++#endif
+
+ if (QDBusConnection::systemBus().interface()->isServiceRegistered(QStringLiteral("org.freedesktop.ConsoleKit"))) {
+ qDebug() << "Console kit interface found";
+diff --git a/src/daemon/SeatManager.cpp b/src/daemon/SeatManager.cpp
+index bd207e6..39d8b85 100644
+--- a/src/daemon/SeatManager.cpp
++++ b/src/daemon/SeatManager.cpp
+@@ -26,6 +26,9 @@
+ #include <QDBusMessage>
+ #include <QDBusPendingReply>
+ #include <QDBusContext>
++#include <QDebug>
++#include <QFileInfo>
++#include <QTimer>
+
+ #include "LogindDBusTypes.h"
+
+@@ -115,6 +118,8 @@ namespace SDDM {
+
+ QDBusConnection::systemBus().connect(Logind::serviceName(), Logind::managerPath(), Logind::managerIfaceName(), QStringLiteral("SeatNew"), this, SLOT(logindSeatAdded(QString,QDBusObjectPath)));
+ QDBusConnection::systemBus().connect(Logind::serviceName(), Logind::managerPath(), Logind::managerIfaceName(), QStringLiteral("SeatRemoved"), this, SLOT(logindSeatRemoved(QString,QDBusObjectPath)));
++
++ QTimer::singleShot(5000, this, &SeatManager::checkSeat);
+ }
+
+ void SeatManager::createSeat(const QString &name) {
+@@ -152,6 +157,23 @@ namespace SDDM {
+ m_seats.value(name)->createDisplay(Display::defaultDisplayServerType());
+ }
+
++ // this is a bit hacky, but linux DRM drivers
++ // won't initially be available so there is a race
++ // between determing if a efifb/etc graphical object
++ // is the only graphics on the machine, or a DRM driver
++ // will take over the display. So we will hang out for a few
++ // seconds and if none of the seats are declared cangraphical
++ // its possible the only graphics on the machine don't have
++ // a drm driver.
++ void SeatManager::checkSeat(void) {
++ if (m_seats.isEmpty()) {
++ //if (QFileInfo::exists(QStringLiteral("/dev/fb0"))) {
++ qWarning() << "No graphical seats found, attempt to start one on the main console anyway...";
++ createSeat(QStringLiteral("seat0"));
++ //}
++ }
++ }
++
+ void SDDM::SeatManager::logindSeatAdded(const QString& name, const QDBusObjectPath& objectPath)
+ {
+ auto logindSeat = new LogindSeat(name, objectPath);
+diff --git a/src/daemon/SeatManager.h b/src/daemon/SeatManager.h
+index b2f9796..aa43047 100644
+--- a/src/daemon/SeatManager.h
++++ b/src/daemon/SeatManager.h
+@@ -49,6 +49,7 @@ namespace SDDM {
+ private:
+ QHash<QString, Seat *> m_seats; //these will exist only for graphical seats
+ QHash<QString, LogindSeat*> m_systemSeats; //these will exist for all seats
++ void checkSeat(void);
+ };
+ }
+
+--
+2.39.2
+
diff --git a/README.scripts b/README.scripts
new file mode 100644
index 0000000..70b5243
--- /dev/null
+++ b/README.scripts
@@ -0,0 +1,2 @@
+This scripts dir contains only samples, but are generally not used directly.
+In practice, sddm runtime uses items under /etc/sddm by default
diff --git a/sddm-0.18.0-environment_file.patch b/sddm-0.18.0-environment_file.patch
new file mode 100644
index 0000000..6f89c36
--- /dev/null
+++ b/sddm-0.18.0-environment_file.patch
@@ -0,0 +1,11 @@
+diff -up sddm-0.18.0/services/sddm.service.in.env sddm-0.18.0/services/sddm.service.in
+--- sddm-0.18.0/services/sddm.service.in.env 2018-07-18 05:31:40.000000000 -0500
++++ sddm-0.18.0/services/sddm.service.in 2019-03-14 08:23:22.095498405 -0500
+@@ -7,6 +7,7 @@ After=systemd-user-sessions.service gett
+ [Service]
+ ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/sddm
+ Restart=always
++EnvironmentFile=-/etc/sysconfig/sddm
+
+ [Install]
+ Alias=display-manager.service
diff --git a/sddm-autologin.pam b/sddm-autologin.pam
new file mode 100644
index 0000000..f62fad0
--- /dev/null
+++ b/sddm-autologin.pam
@@ -0,0 +1,20 @@
+ #%PAM-1.0
+auth required pam_env.so
+auth required pam_permit.so
+auth include postlogin
+
+account required pam_nologin.so
+account include system-auth
+
+password include system-auth
+
+session required pam_selinux.so close
+session required pam_loginuid.so
+session required pam_selinux.so open
+session optional pam_keyinit.so force revoke
+session required pam_namespace.so
+session include system-auth
+-session optional pam_gnome_keyring.so auto_start
+-session optional pam_kwallet5.so auto_start
+-session optional pam_kwallet.so auto_start
+session include postlogin
diff --git a/sddm-systemd-sysusers.conf b/sddm-systemd-sysusers.conf
new file mode 100644
index 0000000..a48f929
--- /dev/null
+++ b/sddm-systemd-sysusers.conf
@@ -0,0 +1 @@
+u sddm - "Simple Desktop Display Manager" /var/lib/sddm
diff --git a/sddm.conf b/sddm.conf
new file mode 100644
index 0000000..de667ab
--- /dev/null
+++ b/sddm.conf
@@ -0,0 +1,122 @@
+[Autologin]
+# Whether sddm should automatically log back into sessions when they exit
+#Relogin=false
+
+# Name of session file for autologin session
+#Session=
+
+# Username for autologin session
+#User=
+
+
+[General]
+# Enable Qt's automatic high-DPI scaling
+#EnableHiDPI=false
+
+# Halt command
+#HaltCommand=/usr/bin/systemctl poweroff
+
+# Initial NumLock state. Can be on, off or none.
+# If property is set to none, numlock won't be changed
+# NOTE: Currently ignored if autologin is enabled.
+#Numlock=none
+
+# Reboot command
+#RebootCommand=/usr/bin/systemctl reboot
+
+# Control x11/wayland startup
+# DisplayServer=x11
+
+[Theme]
+# Current theme name
+#Current=
+
+# Cursor theme used in the greeter
+#CursorTheme=
+
+# Number of users to use as threshold
+# above which avatars are disabled
+# unless explicitly enabled with EnableAvatars
+#DisableAvatarsThreshold=7
+
+# Enable display of custom user avatars
+#EnableAvatars=true
+
+# Global directory for user avatars
+# The files should be named <username>.face.icon
+#FacesDir=/usr/share/sddm/faces
+
+# Theme directory path
+#ThemeDir=/usr/share/sddm/themes
+
+
+[Users]
+# Default $PATH for logged in users
+#DefaultPath=/usr/local/bin:/usr/bin:/bin
+
+# Comma-separated list of shells.
+# Users with these shells as their default won't be listed
+#HideShells=
+
+# Comma-separated list of users that should not be listed
+#HideUsers=
+
+# Maximum user id for displayed users
+#MaximumUid=60000
+
+# Minimum user id for displayed users
+#MinimumUid=1000
+
+# Remember the session of the last successfully logged in user
+#RememberLastSession=true
+
+# Remember the last successfully logged in user
+#RememberLastUser=true
+
+
+[Wayland]
+# Path to a script to execute when starting the desktop session
+#SessionCommand=/etc/sddm/wayland-session
+
+# Directory containing available Wayland sessions
+#SessionDir=/usr/share/wayland-sessions
+
+# Path to the user session log file
+#SessionLogFile=.cache/wayland-errors
+
+
+[X11]
+# Path to a script to execute when starting the display server
+#DisplayCommand=/etc/sddm/Xsetup
+
+# Path to a script to execute when stopping the display server
+#DisplayStopCommand=/etc/sddm/Xstop
+
+# The lowest virtual terminal number that will be used.
+#MinimumVT=1
+
+# Arguments passed to the X server invocation
+#ServerArguments=-nolisten tcp
+
+# Path to X server binary
+#ServerPath=/usr/bin/X
+
+# Path to a script to execute when starting the desktop session
+#SessionCommand=/etc/X11/xinit/Xsession
+
+# Directory containing available X sessions
+#SessionDir=/usr/share/xsessions
+
+# Path to the user session log file
+#SessionLogFile=.cache/xsession-errors
+
+# Path to the Xauthority file
+#UserAuthFile=.Xauthority
+
+# Path to xauth binary
+#XauthPath=/usr/bin/xauth
+
+# Path to Xephyr binary
+#XephyrPath=/usr/bin/Xephyr
+
+
diff --git a/sddm.pam b/sddm.pam
new file mode 100644
index 0000000..34c0777
--- /dev/null
+++ b/sddm.pam
@@ -0,0 +1,23 @@
+auth [success=done ignore=ignore default=bad] pam_selinux_permit.so
+auth substack password-auth
+-auth optional pam_gnome_keyring.so
+-auth optional pam_kwallet5.so
+-auth optional pam_kwallet.so
+auth include postlogin
+
+account required pam_nologin.so
+account include password-auth
+
+password include password-auth
+
+session required pam_selinux.so close
+session required pam_loginuid.so
+-session optional pam_ck_connector.so
+session required pam_selinux.so open
+session optional pam_keyinit.so force revoke
+session required pam_namespace.so
+session include password-auth
+-session optional pam_gnome_keyring.so auto_start
+-session optional pam_kwallet5.so auto_start
+-session optional pam_kwallet.so auto_start
+session include postlogin
diff --git a/sddm.spec b/sddm.spec
new file mode 100644
index 0000000..555e96a
--- /dev/null
+++ b/sddm.spec
@@ -0,0 +1,179 @@
+%undefine __cmake_in_source_build
+
+# Control wayland by default
+#bcond_with wayland_default
+
+Name: sddm
+Version: 0.20.0
+Release: 1
+License: GPLv2+
+Summary: QML based X11 desktop manager
+
+Url: https://github.com/sddm/sddm
+Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
+
+# sddm.service: +EnvironmentFile=-/etc/sysconfig/sddm
+Patch103: sddm-0.18.0-environment_file.patch
+
+# Fix race with logind restart, and start seat0 if !CanGraphical on timer
+Patch105: 0001-Delay-for-logind-and-fallback-to-seat0.patch
+
+# Shamelessly stolen from fedora
+Source11: sddm.pam
+Source12: sddm-autologin.pam
+Source13: tmpfiles-sddm.conf
+# sample sddm.conf generated with sddm --example-config
+Source14: sddm.conf
+# README.scripts
+Source15: README.scripts
+# sysconfig snippet
+Source16: sddm.sysconfig
+# systemd sysusers config
+Source18: sddm-systemd-sysusers.conf
+
+Provides: service(graphical-login) = sddm
+
+BuildRequires: cmake >= 2.8.8
+BuildRequires: extra-cmake-modules
+BuildRequires: libxcb-devel
+BuildRequires: pam-devel
+BuildRequires: pkgconfig(libsystemd)
+BuildRequires: pkgconfig(systemd)
+# Check which package contains /usr/bin/rst2man
+BuildRequires: python3-docutils
+BuildRequires: qt5-qtbase-devel >= 5.6
+BuildRequires: qt5-qtdeclarative-devel >= 5.6
+BuildRequires: qt5-qttools-devel >= 5.6
+BuildRequires: shadow-utils
+BuildRequires: systemd
+
+Obsoletes: kde-settings-sddm < 20-5
+
+Requires: systemd
+Requires: xorg-x11-xinit
+Requires: xorg-x11-server-Xorg
+
+Suggests: qt5-qtvirtualkeyboard%{?_isa}
+
+%{?systemd_requires}
+
+Requires(pre): shadow-utils
+
+%description
+SDDM is a modern display manager for X11 aiming to be fast, simple and
+beautiful. It uses modern technologies like QtQuick, which in turn gives the
+designer the ability to create smooth, animated user interfaces.
+
+%package themes
+Summary: SDDM Themes
+Obsoletes: sddm < 0.2.0-0.12
+Requires: %{name} = %{version}-%{release}
+BuildArch: noarch
+
+%description themes
+A collection of sddm themes, including: elarun, maldives, maya
+
+
+%prep
+%autosetup -p1
+
+%build
+%cmake \
+ -DBUILD_MAN_PAGES:BOOL=ON \
+ -DCMAKE_BUILD_TYPE:STRING="Release" \
+ -DENABLE_JOURNALD:BOOL=ON \
+ -DSESSION_COMMAND:PATH=/etc/X11/xinit/Xsession \
+ -DWAYLAND_SESSION_COMMAND:PATH=/etc/sddm/wayland-session
+
+%make_build
+
+
+%install
+make install/fast DESTDIR=%{buildroot}
+
+mkdir -p %{buildroot}%{_sysconfdir}/sddm.conf.d
+install -Dpm 644 %{SOURCE11} %{buildroot}%{_sysconfdir}/pam.d/sddm
+install -Dpm 644 %{SOURCE12} %{buildroot}%{_sysconfdir}/pam.d/sddm-autologin
+install -Dpm 644 %{SOURCE13} %{buildroot}%{_tmpfilesdir}/sddm.conf
+install -Dpm 644 %{SOURCE14} %{buildroot}%{_sysconfdir}/sddm.conf
+install -Dpm 644 %{SOURCE15} %{buildroot}%{_datadir}/sddm/scripts/README.scripts
+install -Dpm 644 %{SOURCE16} %{buildroot}%{_sysconfdir}/sysconfig/sddm
+install -Dpm 644 %{SOURCE18} %{buildroot}%{_sysusersdir}/sddm.conf
+mkdir -p %{buildroot}/run/sddm
+mkdir -p %{buildroot}%{_localstatedir}/lib/sddm
+mkdir -p %{buildroot}%{_sysconfdir}/sddm/
+cp -a %{buildroot}%{_datadir}/sddm/scripts/* \
+ %{buildroot}%{_sysconfdir}/sddm/
+rm -fv %{buildroot}%{_sysconfdir}/sddm/Xsession
+
+%pre
+mkdir %{_sysusersdir}/sddm.conf.d
+echo 'u sddm - "Simple Desktop Display Manager" /var/lib/sddm' > %{_sysusersdir}/sddm.conf.d/sddm-systemd-sysusers.conf
+
+%post
+%systemd_post sddm.service
+# handle incompatible configuration changes
+(grep \
+ -e '^\[XDisplay\]$' \
+ -e '^\[WaylandDisplay\]$' \
+ %{_sysconfdir}/sddm.conf > /dev/null && \
+ sed -i.rpmsave \
+ -e 's|^\[XDisplay\]$|\[X11\]|' \
+ -e 's|^\[WaylandDisplay\]$|\[Wayland\]|' \
+ %{_sysconfdir}/sddm.conf
+) ||:
+
+%preun
+%systemd_preun sddm.service
+
+%postun
+%systemd_postun sddm.service
+
+%files
+%license LICENSE
+%doc README.md CONTRIBUTORS
+%dir %{_sysconfdir}/sddm/
+%dir %{_sysconfdir}/sddm.conf.d
+%config(noreplace) %{_sysconfdir}/sddm/*
+%config(noreplace) %{_sysconfdir}/sddm.conf
+%config(noreplace) %{_sysconfdir}/pam.d/sddm
+%config(noreplace) %{_sysconfdir}/pam.d/sddm-autologin
+%config(noreplace) %{_sysconfdir}/pam.d/sddm-greeter
+%config(noreplace) %{_sysconfdir}/sysconfig/sddm
+# THIS IS NOT A CONFIG FILE, but a script that is run by sddm.service
+%{_sysconfdir}/dbus-1/system.d/org.freedesktop.DisplayManager.conf
+%{_bindir}/sddm
+%{_bindir}/sddm-greeter
+%{_libexecdir}/sddm-helper
+%{_libexecdir}/sddm-helper-start-wayland
+%{_libexecdir}/sddm-helper-start-x11user
+%{_tmpfilesdir}/sddm.conf
+%{_sysusersdir}/sddm.conf
+%attr(0711, root, sddm) %dir /run/sddm
+%attr(1770, sddm, sddm) %dir %{_localstatedir}/lib/sddm
+%{_unitdir}/sddm.service
+%{_qt5_archdatadir}/qml/SddmComponents/
+%dir %{_datadir}/sddm
+%{_datadir}/sddm/faces/
+%{_datadir}/sddm/flags/
+%{_datadir}/sddm/scripts/
+%dir %{_datadir}/sddm/themes/
+%{_datadir}/sddm/translations/
+%{_mandir}/man1/sddm.1*
+%{_mandir}/man1/sddm-greeter.1*
+%{_mandir}/man5/sddm.conf.5*
+%{_mandir}/man5/sddm-state.conf.5*
+
+%files themes
+%{_datadir}/sddm/themes/elarun/
+%{_datadir}/sddm/themes/maldives/
+%{_datadir}/sddm/themes/maya/
+
+
+%changelog
+* Thu Jan 04 2024 zhangxingrong <zhangxingrong@uniontech.com> - 0.20.0-1
+- upgrade to 0.20.0
+- Delete patches that have been merged into higher versions
+
+* Fri Jul 22 2022 misaka00251 <misaka00251@misakanet.cn> - 0.19.0-1
+- Init package
diff --git a/sddm.sysconfig b/sddm.sysconfig
new file mode 100644
index 0000000..ddd6aab
--- /dev/null
+++ b/sddm.sysconfig
@@ -0,0 +1,5 @@
+# https://bugzilla.redhat.com/1686675
+# https://bugreports.qt.io/browse/QTBUG-58508
+QML_DISABLE_DISK_CACHE=1
+# enable qDebug messages for debug build
+# QT_LOGGING_RULES="*.debug=true"
diff --git a/sources b/sources
new file mode 100644
index 0000000..350c2c5
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+7af67d5fb767639861d35c80eb4e1191 sddm-0.20.0.tar.gz
diff --git a/tmpfiles-sddm.conf b/tmpfiles-sddm.conf
new file mode 100644
index 0000000..c573868
--- /dev/null
+++ b/tmpfiles-sddm.conf
@@ -0,0 +1,2 @@
+d /run/sddm 1733 root root -
+Z /var/lib/sddm - sddm sddm - -