Files
gdm/gdm-switch-to-tty1.patch
T
iznogood b095c4b248 Accepting request 1255007 from GNOME:Next
- Rebase/fix gdm-switch-to-tty1.patch to fix build against gcc 15.

- Add gdm-settings-utils_rename-variable.patch: Rename variable to
  fix build with gcc 15
  (https://gitlab.gnome.org/GNOME/gdm/-/merge_requests/273).

OBS-URL: https://build.opensuse.org/request/show/1255007
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gdm?expand=0&rev=570
2025-03-21 16:03:07 +00:00

67 lines
1.5 KiB
Diff

--- a/daemon/main.c
+++ b/daemon/main.c
@@ -61,6 +61,31 @@ static GdmSettings *settings =
static uid_t gdm_uid = -1;
static gid_t gdm_gid = -1;
+#define SHELLSCRIPT "\
+/bin/bash -c \
+\'PROCESS=\"X Xwayland plymouth\";\
+R=$(pidof $PROCESS);\
+while [ $? == 0 ];\
+do sleep 1;\
+ R=$(pidof $PROCESS);\
+done;\
+systemd-cat echo Switch to tty1 Successfully;\
+/usr/bin/chvt 1\'\
+"
+
+static void
+jump_to_tty1 ()
+{
+ g_autoptr(GError) error = NULL;
+
+ g_debug ("Spawn jump to tty1 process");
+ g_spawn_command_line_async (SHELLSCRIPT,
+ &error);
+
+ if (error != NULL)
+ g_warning ("Error chvt to tty1: %s", error->message);
+}
+
static gboolean
timed_exit_cb (GMainLoop *loop)
{
@@ -263,6 +288,12 @@ on_shutdown_signal_cb (gpointer user_dat
return FALSE;
}
+static void
+on_signal_term_cb (int signal)
+{
+ g_debug ("Received SIGTERM again");
+}
+
static gboolean
on_sighup_cb (gpointer user_data)
{
@@ -387,6 +418,7 @@ main (int argc,
g_main_loop_run (main_loop);
g_debug ("GDM finished, cleaning up...");
+ signal (SIGTERM, on_signal_term_cb);
g_clear_object (&manager);
g_clear_object (&settings);
@@ -394,6 +426,10 @@ main (int argc,
gdm_settings_direct_shutdown ();
gdm_log_shutdown ();
+ jump_to_tty1 ();
+
+ g_debug ("GDM finished");
+
g_main_loop_unref (main_loop);
return EXIT_SUCCESS;