Allow vendor nvidia users to choose wayland sessions
Update to 40.1 Related: #1985099
This commit is contained in:
parent
b59bfdfb53
commit
1b44d3556e
1
.gitignore
vendored
1
.gitignore
vendored
@ -137,3 +137,4 @@ gdm-2.30.2.tar.bz2
|
|||||||
/gdm-40.beta.tar.xz
|
/gdm-40.beta.tar.xz
|
||||||
/gdm-40.rc.tar.xz
|
/gdm-40.rc.tar.xz
|
||||||
/gdm-40.0.tar.xz
|
/gdm-40.0.tar.xz
|
||||||
|
/gdm-40.1.tar.xz
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 42b18e4c84d470f33cdec5fc1f481cb25c25cf0d Mon Sep 17 00:00:00 2001
|
From 7a39e99348a3ca8988c8542126f82012f81135af Mon Sep 17 00:00:00 2001
|
||||||
From: Rui Matos <tiagomatos@gmail.com>
|
From: Rui Matos <tiagomatos@gmail.com>
|
||||||
Date: Mon, 23 Jan 2017 20:19:51 +0100
|
Date: Mon, 23 Jan 2017 20:19:51 +0100
|
||||||
Subject: [PATCH] Honor initial setup being disabled by distro installer
|
Subject: [PATCH] Honor initial setup being disabled by distro installer
|
||||||
@ -14,15 +14,43 @@ that but more might be added in the future.
|
|||||||
|
|
||||||
https://bugzilla.gnome.org/show_bug.cgi?id=777708
|
https://bugzilla.gnome.org/show_bug.cgi?id=777708
|
||||||
---
|
---
|
||||||
daemon/Makefile.am | 1 +
|
|
||||||
daemon/gdm-display.c | 29 +++++++++++++++++++++++++++++
|
daemon/gdm-display.c | 29 +++++++++++++++++++++++++++++
|
||||||
2 files changed, 30 insertions(+)
|
daemon/gdm-manager.c | 11 +++++------
|
||||||
|
daemon/gdm-session.c | 2 +-
|
||||||
|
3 files changed, 35 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
|
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
|
||||||
index 5e193f2..878be88 100644
|
index 46d5a773..c7a8028b 100644
|
||||||
--- a/daemon/gdm-display.c
|
--- a/daemon/gdm-display.c
|
||||||
+++ b/daemon/gdm-display.c
|
+++ b/daemon/gdm-display.c
|
||||||
@@ -1547,6 +1547,31 @@ kernel_cmdline_initial_setup_force_state (gboolean *force_state)
|
@@ -1621,103 +1621,132 @@ kernel_cmdline_initial_setup_force_state (gboolean *force_state)
|
||||||
|
GError *error = NULL;
|
||||||
|
gchar *contents = NULL;
|
||||||
|
gchar *setup_argument = NULL;
|
||||||
|
|
||||||
|
g_return_val_if_fail (force_state != NULL, FALSE);
|
||||||
|
|
||||||
|
if (!g_file_get_contents ("/proc/cmdline", &contents, NULL, &error)) {
|
||||||
|
g_debug ("GdmDisplay: Could not check kernel parameters, not forcing initial setup: %s",
|
||||||
|
error->message);
|
||||||
|
g_clear_error (&error);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_debug ("GdmDisplay: Checking kernel command buffer %s", contents);
|
||||||
|
|
||||||
|
if (!kernel_cmdline_initial_setup_argument (contents, &setup_argument, &error)) {
|
||||||
|
g_debug ("GdmDisplay: Failed to read kernel commandline: %s", error->message);
|
||||||
|
g_clear_pointer (&contents, g_free);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_clear_pointer (&contents, g_free);
|
||||||
|
|
||||||
|
/* Poor-man's check for truthy or falsey values */
|
||||||
|
*force_state = setup_argument[0] == '1';
|
||||||
|
|
||||||
|
g_free (setup_argument);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +82,43 @@ index 5e193f2..878be88 100644
|
|||||||
static gboolean
|
static gboolean
|
||||||
wants_initial_setup (GdmDisplay *self)
|
wants_initial_setup (GdmDisplay *self)
|
||||||
{
|
{
|
||||||
@@ -1587,6 +1612,10 @@ wants_initial_setup (GdmDisplay *self)
|
GdmDisplayPrivate *priv;
|
||||||
|
gboolean enabled = FALSE;
|
||||||
|
gboolean forced = FALSE;
|
||||||
|
|
||||||
|
priv = gdm_display_get_instance_private (self);
|
||||||
|
|
||||||
|
if (already_done_initial_setup_on_this_boot ()) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (kernel_cmdline_initial_setup_force_state (&forced)) {
|
||||||
|
if (forced) {
|
||||||
|
g_debug ("GdmDisplay: Forcing gnome-initial-setup");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_debug ("GdmDisplay: Forcing no gnome-initial-setup");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* don't run initial-setup on remote displays
|
||||||
|
*/
|
||||||
|
if (!priv->is_local) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* don't run if the system has existing users */
|
||||||
|
if (priv->have_existing_user_accounts) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* don't run if initial-setup is unavailable */
|
||||||
|
if (!can_create_environment ("gnome-initial-setup")) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!gdm_settings_direct_get_boolean (GDM_KEY_INITIAL_SETUP_ENABLE, &enabled)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,6 +129,196 @@ index 5e193f2..878be88 100644
|
|||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gdm_display_start_greeter_session (GdmDisplay *self)
|
||||||
|
{
|
||||||
|
GdmDisplayPrivate *priv;
|
||||||
|
GdmSession *session;
|
||||||
|
char *display_name;
|
||||||
|
char *seat_id;
|
||||||
|
char *hostname;
|
||||||
|
char *auth_file = NULL;
|
||||||
|
|
||||||
|
priv = gdm_display_get_instance_private (self);
|
||||||
|
g_return_if_fail (g_strcmp0 (priv->session_class, "greeter") == 0);
|
||||||
|
|
||||||
|
g_debug ("GdmDisplay: Running greeter");
|
||||||
|
|
||||||
|
display_name = NULL;
|
||||||
|
seat_id = NULL;
|
||||||
|
hostname = NULL;
|
||||||
|
|
||||||
|
g_object_get (self,
|
||||||
|
"x11-display-name", &display_name,
|
||||||
|
"seat-id", &seat_id,
|
||||||
|
"remote-hostname", &hostname,
|
||||||
|
NULL);
|
||||||
|
if (priv->access_file != NULL) {
|
||||||
|
auth_file = gdm_display_access_file_get_path (priv->access_file);
|
||||||
|
}
|
||||||
|
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||||
|
index e433acf3..f8dce936 100644
|
||||||
|
--- a/daemon/gdm-manager.c
|
||||||
|
+++ b/daemon/gdm-manager.c
|
||||||
|
@@ -2278,86 +2278,85 @@ on_session_reauthentication_started (GdmSession *session,
|
||||||
|
|
||||||
|
if (invocation != NULL) {
|
||||||
|
g_hash_table_steal (manager->priv->open_reauthentication_requests,
|
||||||
|
source_tag);
|
||||||
|
gdm_dbus_manager_complete_open_reauthentication_channel (GDM_DBUS_MANAGER (manager),
|
||||||
|
invocation,
|
||||||
|
address);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clean_user_session (GdmSession *session)
|
||||||
|
{
|
||||||
|
g_object_set_data (G_OBJECT (session), "gdm-display", NULL);
|
||||||
|
g_object_unref (session);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
create_user_session_for_display (GdmManager *manager,
|
||||||
|
GdmDisplay *display,
|
||||||
|
uid_t allowed_user)
|
||||||
|
{
|
||||||
|
GdmSession *session;
|
||||||
|
gboolean display_is_local = FALSE;
|
||||||
|
char *display_name = NULL;
|
||||||
|
char *display_device = NULL;
|
||||||
|
char *remote_hostname = NULL;
|
||||||
|
char *display_auth_file = NULL;
|
||||||
|
char *display_seat_id = NULL;
|
||||||
|
char *display_id = NULL;
|
||||||
|
-#if defined(ENABLE_WAYLAND_SUPPORT) && defined(ENABLE_USER_DISPLAY_SERVER)
|
||||||
|
- g_autofree char *display_session_type = NULL;
|
||||||
|
-#endif
|
||||||
|
+ g_auto (GStrv) supported_session_types = NULL;
|
||||||
|
|
||||||
|
g_object_get (G_OBJECT (display),
|
||||||
|
"id", &display_id,
|
||||||
|
"x11-display-name", &display_name,
|
||||||
|
"is-local", &display_is_local,
|
||||||
|
"remote-hostname", &remote_hostname,
|
||||||
|
"x11-authority-file", &display_auth_file,
|
||||||
|
"seat-id", &display_seat_id,
|
||||||
|
-#if defined(ENABLE_WAYLAND_SUPPORT) && defined(ENABLE_USER_DISPLAY_SERVER)
|
||||||
|
- "session-type", &display_session_type,
|
||||||
|
-#endif
|
||||||
|
+ "supported-session-types", &supported_session_types,
|
||||||
|
NULL);
|
||||||
|
display_device = get_display_device (manager, display);
|
||||||
|
|
||||||
|
session = gdm_session_new (GDM_SESSION_VERIFICATION_MODE_LOGIN,
|
||||||
|
allowed_user,
|
||||||
|
display_name,
|
||||||
|
remote_hostname,
|
||||||
|
display_device,
|
||||||
|
display_seat_id,
|
||||||
|
display_auth_file,
|
||||||
|
display_is_local,
|
||||||
|
NULL);
|
||||||
|
+ g_object_set (G_OBJECT (session),
|
||||||
|
+ "supported-session-types", supported_session_types,
|
||||||
|
+ NULL);
|
||||||
|
|
||||||
|
g_debug ("GdmSession: Created user session for user %d on display %s (seat %s)",
|
||||||
|
(int) allowed_user,
|
||||||
|
display_id,
|
||||||
|
display_seat_id);
|
||||||
|
|
||||||
|
g_free (display_name);
|
||||||
|
g_free (remote_hostname);
|
||||||
|
g_free (display_auth_file);
|
||||||
|
g_free (display_seat_id);
|
||||||
|
|
||||||
|
g_signal_connect (session,
|
||||||
|
"reauthentication-started",
|
||||||
|
G_CALLBACK (on_session_reauthentication_started),
|
||||||
|
manager);
|
||||||
|
g_signal_connect (session,
|
||||||
|
"reauthenticated",
|
||||||
|
G_CALLBACK (on_session_reauthenticated),
|
||||||
|
manager);
|
||||||
|
g_signal_connect (session,
|
||||||
|
"client-ready-for-session-to-start",
|
||||||
|
G_CALLBACK (on_session_client_ready_for_session_to_start),
|
||||||
|
manager);
|
||||||
|
g_signal_connect (session,
|
||||||
|
"client-connected",
|
||||||
|
G_CALLBACK (on_session_client_connected),
|
||||||
|
manager);
|
||||||
|
g_signal_connect (session,
|
||||||
|
"client-disconnected",
|
||||||
|
G_CALLBACK (on_session_client_disconnected),
|
||||||
|
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||||
|
index 2cd9c323..5c225445 100644
|
||||||
|
--- a/daemon/gdm-session.c
|
||||||
|
+++ b/daemon/gdm-session.c
|
||||||
|
@@ -2562,61 +2562,61 @@ gdm_session_send_environment (GdmSession *self,
|
||||||
|
g_return_if_fail (GDM_IS_SESSION (self));
|
||||||
|
|
||||||
|
conversation = find_conversation_by_name (self, service_name);
|
||||||
|
if (conversation != NULL) {
|
||||||
|
send_environment (self, conversation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static const char *
|
||||||
|
get_session_name (GdmSession *self)
|
||||||
|
{
|
||||||
|
/* FIXME: test the session names before we use them? */
|
||||||
|
|
||||||
|
if (self->selected_session != NULL) {
|
||||||
|
return self->selected_session;
|
||||||
|
}
|
||||||
|
|
||||||
|
return get_default_session_name (self);
|
||||||
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
get_session_command (GdmSession *self)
|
||||||
|
{
|
||||||
|
gboolean res;
|
||||||
|
char *command;
|
||||||
|
const char *session_name;
|
||||||
|
|
||||||
|
session_name = get_session_name (self);
|
||||||
|
|
||||||
|
command = NULL;
|
||||||
|
- res = get_session_command_for_name (self, session_name, NULL, &command);
|
||||||
|
+ res = get_session_command_for_name (self, session_name, self->session_type, &command);
|
||||||
|
if (! res) {
|
||||||
|
g_critical ("Cannot find a command for specified session: %s", session_name);
|
||||||
|
exit (EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return command;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gchar *
|
||||||
|
get_session_desktop_names (GdmSession *self)
|
||||||
|
{
|
||||||
|
gchar *filename;
|
||||||
|
GKeyFile *keyfile;
|
||||||
|
gchar *desktop_names = NULL;
|
||||||
|
|
||||||
|
if (self->selected_program != NULL) {
|
||||||
|
return g_strdup ("GNOME-Greeter:GNOME");
|
||||||
|
}
|
||||||
|
|
||||||
|
filename = g_strdup_printf ("%s.desktop", get_session_name (self));
|
||||||
|
g_debug ("GdmSession: getting desktop names for file '%s'", filename);
|
||||||
|
keyfile = load_key_file_for_file (self, filename, NULL, NULL);
|
||||||
|
if (keyfile != NULL) {
|
||||||
|
gchar **names;
|
||||||
|
|
||||||
|
names = g_key_file_get_string_list (keyfile, G_KEY_FILE_DESKTOP_GROUP,
|
||||||
|
"DesktopNames", NULL, NULL);
|
||||||
|
if (names != NULL) {
|
||||||
|
desktop_names = g_strjoinv (":", names);
|
||||||
|
|
||||||
--
|
--
|
||||||
2.19.0
|
2.32.0
|
||||||
|
|
||||||
|
44
0001-data-disable-wayland-on-certain-hardware.patch
Normal file
44
0001-data-disable-wayland-on-certain-hardware.patch
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
From 3e3ffe6083746b5ce7dadc482a14f18644dbf012 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ray Strode <rstrode@redhat.com>
|
||||||
|
Date: Mon, 11 Feb 2019 18:14:07 -0500
|
||||||
|
Subject: [PATCH] data: disable wayland on certain hardware
|
||||||
|
|
||||||
|
We're having issues with wayland on passthrough to virt
|
||||||
|
setups and with the vendor nvidia driver on hybrid graphics
|
||||||
|
setups, so disable it in those cases.
|
||||||
|
---
|
||||||
|
data/61-gdm.rules.in | 22 ++++++++++++++++++----
|
||||||
|
1 file changed, 18 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/data/61-gdm.rules.in b/data/61-gdm.rules.in
|
||||||
|
index b1da191f8..fde22e9f3 100644
|
||||||
|
--- a/data/61-gdm.rules.in
|
||||||
|
+++ b/data/61-gdm.rules.in
|
||||||
|
@@ -1,6 +1,20 @@
|
||||||
|
# disable Wayland on Hi1710 chipsets
|
||||||
|
-ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", RUN+="@libexecdir@/gdm-runtime-config set daemon WaylandEnable false"
|
||||||
|
-# disable Wayland when using the proprietary nvidia driver
|
||||||
|
-DRIVER=="nvidia", RUN+="@libexecdir@/gdm-runtime-config set daemon WaylandEnable false"
|
||||||
|
+ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||||
|
+
|
||||||
|
+# disable Wayland on hybrid systems with vendor nvidia driver
|
||||||
|
+# default to Xorg on single gpu vendor nvidia systems
|
||||||
|
+DRIVER=="nvidia", ENV{GDM_HAS_VENDOR_NVIDIA_DRIVER}="1"
|
||||||
|
+DRIVER=="nvidia", RUN+="@libexecdir@/gdm-runtime-config set daemon PreferredDisplayServer xorg"
|
||||||
|
+SUBSYSTEM=="drm", KERNEL=="card[1-9]*", ENV{GDM_HAS_NVIDIA_DRIVER}=="1", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||||
|
+ACTION=="add", SUBSYSTEM=="module", KERNEL=="nvidia_drm", ATTR{parameters/modeset}=="N", RUN+="/usr/libexec/gdm-disable-wayland"
|
||||||
|
+
|
||||||
|
+# disable Wayland on passthrough graphics setups for now (assumes passthrough if
|
||||||
|
+# there is more than one card, and one of the cards is virt: cirrus, bochs, qxl)
|
||||||
|
+ATTR{vendor}=="0x1013", ATTR{device}=="0x00b8", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", ENV{GDM_HAS_VIRTUAL_GPU}="1"
|
||||||
|
+ATTR{vendor}=="0x1b36", ATTR{device}=="0x0100", ENV{GDM_HAS_VIRTUAL_GPU}="1"
|
||||||
|
+ATTR{vendor}=="0x1234", ATTR{device}=="0x1111", ENV{GDM_HAS_VIRTUAL_GPU}="1"
|
||||||
|
+
|
||||||
|
+SUBSYSTEM=="drm", KERNEL=="card[1-9]*", ENV{GDM_HAS_VIRTUAL_GPU}=="1", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||||
|
+
|
||||||
|
# disable Wayland if modesetting is disabled
|
||||||
|
-IMPORT{cmdline}="nomodeset", RUN+="@libexecdir@/gdm-runtime-config set daemon WaylandEnable false"
|
||||||
|
+IMPORT{cmdline}="nomodeset", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||||
|
--
|
||||||
|
2.31.1
|
||||||
|
|
2354
0001-local-display-factory-Provide-more-flexibility-for-c.patch
Normal file
2354
0001-local-display-factory-Provide-more-flexibility-for-c.patch
Normal file
File diff suppressed because it is too large
Load Diff
13
gdm.spec
13
gdm.spec
@ -10,8 +10,8 @@
|
|||||||
|
|
||||||
Name: gdm
|
Name: gdm
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Version: 40.0
|
Version: 40.1
|
||||||
Release: 5%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: The GNOME Display Manager
|
Summary: The GNOME Display Manager
|
||||||
|
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
@ -22,7 +22,11 @@ Source1: org.gnome.login-screen.gschema.override
|
|||||||
# moved here from pulseaudio-gdm-hooks-11.1-16
|
# moved here from pulseaudio-gdm-hooks-11.1-16
|
||||||
Source5: default.pa-for-gdm
|
Source5: default.pa-for-gdm
|
||||||
|
|
||||||
|
# Upstream backports
|
||||||
|
Patch10001: 0001-local-display-factory-Provide-more-flexibility-for-c.patch
|
||||||
|
|
||||||
# Downstream patches
|
# Downstream patches
|
||||||
|
Patch70001: 0001-data-disable-wayland-on-certain-hardware.patch
|
||||||
Patch80001: 0001-Honor-initial-setup-being-disabled-by-distro-install.patch
|
Patch80001: 0001-Honor-initial-setup-being-disabled-by-distro-install.patch
|
||||||
Patch90001: 0001-data-add-system-dconf-databases-to-gdm-profile.patch
|
Patch90001: 0001-data-add-system-dconf-databases-to-gdm-profile.patch
|
||||||
|
|
||||||
@ -307,6 +311,11 @@ dconf update || :
|
|||||||
%{_libdir}/pkgconfig/gdm-pam-extensions.pc
|
%{_libdir}/pkgconfig/gdm-pam-extensions.pc
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Jul 23 2021 Ray Strode <rstrode@redhat.com> - 40.1-1
|
||||||
|
- Update to 40.1
|
||||||
|
- Allow vendor nvidia users to choose wayland sessions
|
||||||
|
Related: #1985099
|
||||||
|
|
||||||
* Wed Jun 16 2021 Ray Strode <rstrode@redhat.com> - 40.0-5
|
* Wed Jun 16 2021 Ray Strode <rstrode@redhat.com> - 40.0-5
|
||||||
- Ensure gdm dconf db is generated at install time
|
- Ensure gdm dconf db is generated at install time
|
||||||
Related: #1972234
|
Related: #1972234
|
||||||
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (gdm-40.0.tar.xz) = b20d02f8a80f6aff8909a69c6c621c20c5aa1b25cfedd68bf95faaaa56d5f7cd5d607d1a7388b97aa06510684f1e9e474248042a00203f496c39930e001bb64c
|
SHA512 (gdm-40.1.tar.xz) = 34e3d905195c9d44f3681fcf8170b67e739cef60fe3987802b7006e5063b9cdf5ca047470d0aebd6e9b47dbbb660040648a647ed8d3186a3099b8c6532c5ded7
|
||||||
|
Loading…
Reference in New Issue
Block a user