-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gdm doesn't show a session chooser #34101
Comments
It looks like the patch we're using to modify the session lookup path is not working as expected. system.activationScripts.etcX11sessinos = ''
echo "setting up /etc/X11/sessions..."
mkdir -p /etc/X11
[[ ! -L /etc/X11/sessions ]] || rm /etc/X11/sessions
ln -sf ${config.services.xserver.displayManager.session.desktops} /etc/X11/sessions
''; This allows gdm to find the installed desktop sessions. /cc @jtojnar |
The environment is defnitely read, I patched gdm to print it and it does: Without your activation script
With your activation script
The only difference seems to be a missing slash in the environment variable but adding it does not help: With a trailing slash
|
Gdm session list was not showing up, so needed a dirty fix NixOS/nixpkgs#34101
Okay, so the current GDM patch only fixes the code starting a session. GDM somehow starts GNOME Shell as a greeter, which uses libgdm to get list of the sessions. We need to add the following patch: --- a/libgdm/gdm-sessions.c
+++ b/libgdm/gdm-sessions.c
@@ -217,6 +217,7 @@
{
int i;
const char *xorg_search_dirs[] = {
+ "/var/empty/",
"/etc/X11/sessions/",
DMCONFDIR "/Sessions/",
DATADIR "/gdm/BuiltInSessions/",
@@ -224,6 +225,10 @@
NULL
};
+ if (g_getenv("GDM_SESSIONS_DIR") != NULL) {
+ xorg_search_dirs[0] = g_getenv("GDM_SESSIONS_DIR");
+ };
+
#ifdef ENABLE_WAYLAND_SUPPORT
const char *wayland_search_dirs[] = {
DATADIR "/wayland-sessions/", That is not enough, though, since GDM does not seem to pass the |
Okay, I have fixed the issue in #39615: In the future, we might want to use upstream session --- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -343,6 +343,8 @@
{
GArray *search_array = NULL;
char **search_dirs;
+ int i;
+ const gchar * const *system_data_dirs = g_get_system_data_dirs ();
static const char *x_search_dirs[] = {
"/etc/X11/sessions/",
@@ -357,12 +359,27 @@
g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
+ for (i = 0; system_data_dirs[i]; i++) {
+ gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
+ g_array_insert_val (search_array, i, dir);
+ }
+
#ifdef ENABLE_WAYLAND_SUPPORT
if (!self->priv->ignore_wayland) {
#ifdef ENABLE_USER_DISPLAY_SERVER
g_array_prepend_val (search_array, wayland_search_dir);
+
+ for (i = 0; system_data_dirs[i]; i++) {
+ gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
+ g_array_insert_val (search_array, i, dir);
+ }
#else
g_array_append_val (search_array, wayland_search_dir);
+
+ for (i = 0; system_data_dirs[i]; i++) {
+ gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
+ g_array_append_val (search_array, dir);
+ }
#endif
}
#endif
--- a/libgdm/gdm-sessions.c
+++ b/libgdm/gdm-sessions.c
@@ -162,7 +162,7 @@
}
static void
-collect_sessions_from_directory (const char *dirname)
+collect_sessions_from_directory (const char *dirname, void *user_data)
{
GDir *dir;
const char *filename;
@@ -216,19 +216,30 @@
collect_sessions (void)
{
int i;
- const char *xorg_search_dirs[] = {
- "/etc/X11/sessions/",
- DMCONFDIR "/Sessions/",
- DATADIR "/gdm/BuiltInSessions/",
- DATADIR "/xsessions/",
- NULL
- };
+ GPtrArray *xorg_search_dirs = g_ptr_array_new ();
+ const gchar * const *system_data_dirs = g_get_system_data_dirs ();
+
+ g_ptr_array_add (xorg_search_dirs, g_strdup ("/etc/X11/sessions/"));
+ g_ptr_array_add (xorg_search_dirs, g_strdup (DMCONFDIR "/Sessions/"));
+ g_ptr_array_add (xorg_search_dirs, g_strdup (DATADIR "/gdm/BuiltInSessions/"));
+ g_ptr_array_add (xorg_search_dirs, g_strdup (DATADIR "/xsessions/"));
+
+ for (i = 0; system_data_dirs[i]; i++) {
+ g_ptr_array_add (xorg_search_dirs, g_build_filename (system_data_dirs[i], "xsessions", NULL));
+ }
+
+ g_ptr_array_add (xorg_search_dirs, NULL);
#ifdef ENABLE_WAYLAND_SUPPORT
- const char *wayland_search_dirs[] = {
- DATADIR "/wayland-sessions/",
- NULL
- };
+ GPtrArray *wayland_search_dirs = g_ptr_array_new ();
+
+ g_ptr_array_add (wayland_search_dirs, g_strdup (DATADIR "/wayland-sessions/"));
+
+ for (i = 0; system_data_dirs[i]; i++) {
+ g_ptr_array_add (wayland_search_dirs, g_build_filename (system_data_dirs[i], "wayland-sessions", NULL));
+ }
+
+ g_ptr_array_add (wayland_search_dirs, NULL);
#endif
if (gdm_available_sessions_map == NULL) {
@@ -236,9 +247,9 @@
g_free, (GDestroyNotify)gdm_session_file_free);
}
- for (i = 0; xorg_search_dirs [i] != NULL; i++) {
- collect_sessions_from_directory (xorg_search_dirs [i]);
- }
+ g_ptr_array_foreach (xorg_search_dirs, (GFunc) collect_sessions_from_directory, NULL);
+
+ g_ptr_array_free (xorg_search_dirs, TRUE);
#ifdef ENABLE_WAYLAND_SUPPORT
#ifdef ENABLE_USER_DISPLAY_SERVER
@@ -247,9 +258,9 @@
}
#endif
- for (i = 0; wayland_search_dirs [i] != NULL; i++) {
- collect_sessions_from_directory (wayland_search_dirs [i]);
- }
+ g_ptr_array_foreach (wayland_search_dirs, (GFunc) collect_sessions_from_directory, NULL);
+
+ g_ptr_array_free (wayland_search_dirs, TRUE);
#endif
}
|
We are patching GDM to respect GDM_SESSIONS_DIR environment variable, which we are setting in the GDM module. Previously, we only took care of a single code path, the one that handled session start-up; missing the one obtaining the list of sessions. This commit patches the second code path, and also whitelists the GDM_SESSIONS_DIR so that it can be passed to the greeter. Fixes NixOS#34101
We are patching GDM to respect GDM_SESSIONS_DIR environment variable, which we are setting in the GDM module. Previously, we only took care of a single code path, the one that handled session start-up; missing the one obtaining the list of sessions. This commit patches the second code path, and also whitelists the GDM_SESSIONS_DIR so that it can be passed to the greeter. Fixes NixOS#34101
Steps to reproduce
In the NixOS configuration.nix enable two desktops and gdm, e.g.
Boot the system to gdm and note that there is not way of choosing the session.
I'd expect there to be a button that allows to choose the session used for the next login.
Technical details
"x86_64-linux"
Linux 4.14.14, NixOS, 17.09.2823.fd0abdcebc1 (Hummingbird)
yes
no
nix-env (Nix) 1.11.16
"nixos-unstable-18.03pre125750.a6dca042722, nixos-17.09.2823.fd0abdcebc1"
""
/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
The text was updated successfully, but these errors were encountered: