From ae551eb5a72f3482642e5fb8aba82be9196ecf88 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Fri, 19 Jan 2024 16:07:11 -0600 Subject: [PATCH] Update live-user-mode patch --- live-user-mode.patch | 273 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 262 insertions(+), 11 deletions(-) diff --git a/live-user-mode.patch b/live-user-mode.patch index 221f726..35db8dd 100644 --- a/live-user-mode.patch +++ b/live-user-mode.patch @@ -1,7 +1,7 @@ From 575edeab57c891a7053279c676e82bebe53222d3 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Tue, 15 Aug 2023 10:53:41 -0400 -Subject: [PATCH 01/11] gnome-initial-setup: Bump GLib required version to 2.76 +Subject: [PATCH 01/17] gnome-initial-setup: Bump GLib required version to 2.76 This gives us GStrvBuilder, g_ptr_array_sort_values, etc --- @@ -44,7 +44,7 @@ index 5d30fcd1..00e24d7b 100644 From 60a2db34bd50d561e716a63dd526ee7ff4810a29 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sat, 9 Sep 2023 17:07:46 -0400 -Subject: [PATCH 02/11] keyboard: Don't require localed for existing user mode +Subject: [PATCH 02/17] keyboard: Don't require localed for existing user mode If we're in existing user mode, the user may not have permission to set the system keymap. @@ -82,7 +82,7 @@ index fa41230f..da384495 100644 From 1478cce3663bfa276066c073be3bbb65bc4b1785 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 8 Sep 2023 11:02:39 -0400 -Subject: [PATCH 03/11] language: Don't proceed until localed has set locale +Subject: [PATCH 03/17] language: Don't proceed until localed has set locale In sysmte modes, the keyboard page requires reading the locale from localed, so we need to make sure the setting has been applied before @@ -171,7 +171,7 @@ index 87b9f2d8..26a01257 100644 From e8d5b6a4c1ee9bfb3f8ed7dbe5f25053fae7a1ae Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 24 Aug 2023 21:19:40 -0400 -Subject: [PATCH 04/11] keyboard: Get default input sources from gnome-desktop +Subject: [PATCH 04/17] keyboard: Get default input sources from gnome-desktop Right now, we figure out the default input sources ourselves, based on the current locale and layout information coming from @@ -785,7 +785,7 @@ index da384495..f2bfe164 100644 From 7b83c89d8b2fe2f9de5f7f364a7af5f2f4fcc605 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sun, 13 Aug 2023 09:09:56 -0400 -Subject: [PATCH 05/11] driver: Specify mode via flags instead of boolean +Subject: [PATCH 05/17] driver: Specify mode via flags instead of boolean At the moment we just have system mode and new user mode, but we're actually going to want other modes (such as @@ -1075,7 +1075,7 @@ index adb04075..a079c705 100644 From 68391446ee06083a06899cdadb09ca90b4b40af3 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Wed, 30 Aug 2023 15:08:23 -0400 -Subject: [PATCH 06/11] assistant: Show Back button on summary page +Subject: [PATCH 06/17] assistant: Show Back button on summary page commit f60b4622350468f7ef17f79d9bc6679bf8cce7b9 changed the assistant to no longer show the back and forward buttons on the @@ -1194,7 +1194,7 @@ index 0aee2dad..8a526b64 100644 From f1e4b58ced27b028e13dd9bb29794419dc08fb72 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sun, 13 Aug 2023 09:39:07 -0400 -Subject: [PATCH 07/11] gnome-initial-setup: Add live user mode +Subject: [PATCH 07/17] gnome-initial-setup: Add live user mode This commit adds a new "live user" mode meant to be run in live image environments. @@ -2201,7 +2201,7 @@ index 6c12ca38..3d648c48 100644 From 3f15601af333aeddb8e4458e69f81023a8184a8f Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Wed, 16 Aug 2023 10:47:13 -0400 -Subject: [PATCH 08/11] initial-setup: Don't show duplicated pages between +Subject: [PATCH 08/17] initial-setup: Don't show duplicated pages between modes It's possible a user just got asked questions in live mode @@ -2390,7 +2390,7 @@ index 00e24d7b..95fe8e51 100644 From 935b2cca6dd7e3ce31e2540d90e5864190885d81 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sun, 13 Aug 2023 16:33:49 -0400 -Subject: [PATCH 09/11] polkit: Add fedora specfic rules +Subject: [PATCH 09/17] polkit: Add fedora specfic rules We should probably add some way to check vendor.conf for the policy updates instead of a hardcoded list. @@ -2419,7 +2419,7 @@ index 881efde9..f5b7d981 100644 From 03073bd42bf01f5d051f299860be40afd1844447 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Tue, 22 Aug 2023 13:51:40 -0400 -Subject: [PATCH 10/11] gnome-initial-setup: Read /etc/sysconfig/anaconda +Subject: [PATCH 10/17] gnome-initial-setup: Read /etc/sysconfig/anaconda Just as /var/lib/gnome-initial-setup/state may show pages the user has already answered, on Fedora, /etc/sysconfig/anaconda shows pages the user has @@ -2475,10 +2475,53 @@ index 4e2aa5af..2de3ecab 100644 2.43.0 +From 5ffced5f0b7d96458cde5264b79e08a89e22ffb2 Mon Sep 17 00:00:00 2001 +From: Jeremy Bicha +Date: Wed, 17 Jan 2024 13:07:26 -0500 +Subject: [PATCH 11/17] driver: Allow closing the window in existing user mode + +Existing user mode was disabled in 43f1870c +but some distros like Debian have reverted that change. + +With existing user mode, Initial Setup is just another app. +Since the questions are not mandatory, it is reasonable +to not go out of our way to prevent users from exiting early. + +This partially reverts 1db957a7 +--- + gnome-initial-setup/gis-driver.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/gnome-initial-setup/gis-driver.c b/gnome-initial-setup/gis-driver.c +index 0b3f542f..29c6c0a1 100644 +--- a/gnome-initial-setup/gis-driver.c ++++ b/gnome-initial-setup/gis-driver.c +@@ -802,10 +802,13 @@ gis_driver_startup (GApplication *app) + G_CALLBACK (window_realize_cb), + (gpointer)app); + +- g_signal_connect (driver->main_window, +- "close-request", +- G_CALLBACK (window_close_request_cb), +- NULL); ++ /* Only allow closing the window in existing user mode*/ ++ if (driver->mode != GIS_DRIVER_MODE_EXISTING_USER) { ++ g_signal_connect (driver->main_window, ++ "close-request", ++ G_CALLBACK (window_close_request_cb), ++ NULL); ++ } + + driver->assistant = g_object_new (GIS_TYPE_ASSISTANT, NULL); + gtk_window_set_child (GTK_WINDOW (driver->main_window), +-- +2.43.0 + + From baaa29d56bbb91f3ad15f90e3db98eea446b9adb Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Wed, 17 Jan 2024 12:29:54 -0600 -Subject: [PATCH 11/11] Fix criticals in set_localed_input() +Subject: [PATCH 12/17] Fix criticals in set_localed_input() If the default input sources do not match the current input sources, these won't be set in set_input_settings() and we shouldn't try to use @@ -2511,3 +2554,211 @@ index 7801667c..3b59a0bf 100644 -- 2.43.0 + +From 52c588a3c9990ca1e08beff55acbfc93796104f2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jeremy=20B=C3=ADcha?= +Date: Wed, 17 Jan 2024 14:16:53 -0500 +Subject: [PATCH 13/17] welcome: Use PRETTY_NAME instead of manually combining + NAME and VERSION_ID + +--- + .../pages/welcome/gis-welcome-page.c | 20 ++++--------------- + 1 file changed, 4 insertions(+), 16 deletions(-) + +diff --git a/gnome-initial-setup/pages/welcome/gis-welcome-page.c b/gnome-initial-setup/pages/welcome/gis-welcome-page.c +index 1594e164..f7cfc783 100644 +--- a/gnome-initial-setup/pages/welcome/gis-welcome-page.c ++++ b/gnome-initial-setup/pages/welcome/gis-welcome-page.c +@@ -46,23 +46,11 @@ static void + update_welcome_title (GisWelcomePage *page) + { + GisWelcomePagePrivate *priv = gis_welcome_page_get_instance_private (page); +- g_autofree char *name = g_get_os_info (G_OS_INFO_KEY_NAME); +- g_autofree char *entity = NULL; ++ g_autofree char *name = g_get_os_info (G_OS_INFO_KEY_PRETTY_NAME); + g_autofree char *text = NULL; + +- if (name != NULL) +- { +- g_autofree char *version = g_get_os_info (G_OS_INFO_KEY_VERSION_ID); +- +- if (version) +- entity = g_strdup_printf ("%s %s", name, version); +- else +- entity = g_strdup (name); +- } +- else +- { +- entity = g_strdup ("GNOME"); +- } ++ if (!name) ++ name = g_strdup ("GNOME"); + + /* Translators: This is meant to be a warm, engaging welcome message, + * like greeting somebody at the door. If the exclamation mark is not +@@ -72,7 +60,7 @@ update_welcome_title (GisWelcomePage *page) + * keep or remove. The %s is getting replaced with the name and version + * of the OS, e.g. "GNOME 3.38" + */ +- text = g_strdup_printf (_("Welcome to %s !"), entity); ++ text = g_strdup_printf (_("Welcome to %s !"), name); + + gtk_label_set_label (GTK_LABEL (priv->title), text); + } +-- +2.43.0 + + +From b46a3d7e6df08030680c2e7aaa6408c28315e75f Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Fri, 19 Jan 2024 15:49:15 -0600 +Subject: [PATCH 14/17] assistant: assert next page exists when switching to + next page + +If there is no next page, then we should crash nicely on this assert +rather than not so nicely. +--- + gnome-initial-setup/gis-assistant.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/gnome-initial-setup/gis-assistant.c b/gnome-initial-setup/gis-assistant.c +index 8a7fc52b..c1af2943 100644 +--- a/gnome-initial-setup/gis-assistant.c ++++ b/gnome-initial-setup/gis-assistant.c +@@ -111,7 +111,9 @@ find_next_page (GisAssistant *self, + static void + switch_to_next_page (GisAssistant *assistant) + { +- switch_to (assistant, find_next_page (assistant, assistant->current_page)); ++ GisPage *next = find_next_page (assistant, assistant->current_page); ++ g_assert (next != NULL); ++ switch_to (assistant, next); + } + + static void +-- +2.43.0 + + +From deecf58106544ac8603575cb80e79ddfa1b822ba Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Fri, 19 Jan 2024 15:50:33 -0600 +Subject: [PATCH 15/17] summary: don't crash if there is no user account to + create + +--- + gnome-initial-setup/pages/summary/gis-summary-page.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/gnome-initial-setup/pages/summary/gis-summary-page.c b/gnome-initial-setup/pages/summary/gis-summary-page.c +index 8a526b64..8c005640 100644 +--- a/gnome-initial-setup/pages/summary/gis-summary-page.c ++++ b/gnome-initial-setup/pages/summary/gis-summary-page.c +@@ -151,6 +151,11 @@ log_user_in (GisSummaryPage *page) + return; + } + ++ if (!priv->user_account) { ++ g_info ("No new user account (was the account page skipped?); not initiating login"); ++ return; ++ } ++ + g_signal_connect (user_verifier, "info", + G_CALLBACK (on_info), page); + g_signal_connect (user_verifier, "problem", +-- +2.43.0 + + +From b3e54dbaa09e944e537050c7393cd69e44488384 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Fri, 19 Jan 2024 15:52:03 -0600 +Subject: [PATCH 16/17] Don't show warnings when failing to connect to gdm + +This is an expected condition. We need to log it since it might be +needed when debugging, but a warning is overkill. +--- + gnome-initial-setup/gis-driver.c | 3 ++- + gnome-initial-setup/pages/install/gis-install-page.c | 2 +- + gnome-initial-setup/pages/summary/gis-summary-page.c | 2 +- + 3 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/gnome-initial-setup/gis-driver.c b/gnome-initial-setup/gis-driver.c +index 78265527..653ba56b 100644 +--- a/gnome-initial-setup/gis-driver.c ++++ b/gnome-initial-setup/gis-driver.c +@@ -777,7 +777,8 @@ connect_to_gdm (GisDriver *driver) + driver->user_verifier = gdm_client_get_user_verifier_sync (driver->client, NULL, &error); + + if (error != NULL) { +- g_warning ("Failed to open connection to GDM: %s", error->message); ++ /* Not a warning because this is expected if running in a user session */ ++ g_message ("Failed to open connection to GDM: %s", error->message); + g_clear_object (&driver->user_verifier); + g_clear_object (&driver->greeter); + g_clear_object (&driver->client); +diff --git a/gnome-initial-setup/pages/install/gis-install-page.c b/gnome-initial-setup/pages/install/gis-install-page.c +index 36ed7539..850c8241 100644 +--- a/gnome-initial-setup/pages/install/gis-install-page.c ++++ b/gnome-initial-setup/pages/install/gis-install-page.c +@@ -131,7 +131,7 @@ log_user_in (GisInstallPage *page) + + if (!gis_driver_get_gdm_objects (GIS_PAGE (page)->driver, + &greeter, &user_verifier)) { +- g_warning ("No GDM connection; not initiating login"); ++ g_info ("No GDM connection; not initiating login"); + return; + } + +diff --git a/gnome-initial-setup/pages/summary/gis-summary-page.c b/gnome-initial-setup/pages/summary/gis-summary-page.c +index 8c005640..1352cb41 100644 +--- a/gnome-initial-setup/pages/summary/gis-summary-page.c ++++ b/gnome-initial-setup/pages/summary/gis-summary-page.c +@@ -147,7 +147,7 @@ log_user_in (GisSummaryPage *page) + + if (!gis_driver_get_gdm_objects (GIS_PAGE (page)->driver, + &greeter, &user_verifier)) { +- g_warning ("No GDM connection; not initiating login"); ++ g_info ("No GDM connection; not initiating login"); + return; + } + +-- +2.43.0 + + +From fa8caf710c38c41fc17f6dacc1c964a849e4c6e1 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Fri, 19 Jan 2024 15:58:09 -0600 +Subject: [PATCH 17/17] Never skip the summary page if available + +This avoids a crash when finishing the welcome page if there are no +other pages available. +--- + gnome-initial-setup/gnome-initial-setup.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/gnome-initial-setup/gnome-initial-setup.c b/gnome-initial-setup/gnome-initial-setup.c +index 2de3ecab..54bca86f 100644 +--- a/gnome-initial-setup/gnome-initial-setup.c ++++ b/gnome-initial-setup/gnome-initial-setup.c +@@ -99,6 +99,16 @@ should_skip_page (const gchar *page_id, + if (strcmp (page_id, "welcome") == 0) + return !should_skip_page ("language", skip_pages); + ++ /* We have to make sure the welcome page is not the last page because it ++ * unconditionally attempts to load the next page. So, always show the ++ * summary page. ++ * ++ * This doesn't work in existing user mode, but that's OK because we don't ++ * skip arbitrary previously-visited pages when in existing user mode. ++ */ ++ if (strcmp (page_id, "summary") == 0) ++ return FALSE; ++ + /* check through our skip pages list for pages we don't want */ + if (skip_pages) { + while (skip_pages[i]) { +-- +2.43.0 +