Marco Trevisan (Treviño) has proposed merging 
~3v1n0/ubuntu/+source/gdm3:ubuntu/master into 
~ubuntu-desktop/ubuntu/+source/gdm3:ubuntu/master.

Requested reviews:
  Ubuntu Desktop (ubuntu-desktop)
Related bugs:
  Bug #1794280 in gdm3 (Ubuntu): "gdm doesn't start on a fresh installation of 
Cosmic Desktop"
  https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1794280

For more details, see:
https://code.launchpad.net/~3v1n0/ubuntu/+source/gdm3/+git/gdm3/+merge/356861
-- 
Your team Ubuntu Desktop is requested to review the proposed merge of 
~3v1n0/ubuntu/+source/gdm3:ubuntu/master into 
~ubuntu-desktop/ubuntu/+source/gdm3:ubuntu/master.
diff --git a/debian/changelog b/debian/changelog
index 29491af..9b30904 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+gdm3 (3.30.1-1ubuntu4) UNRELEASED; urgency=medium
+
+  * d/p/u/gdm3.service-wait-for-drm-device-before-trying-to-start-i.patch:
+    - Wait for the first valid gdm device on pre-start (LP: #1794280)
+    + debian/control:
+      - Add build-depends on libgudev-1.0-dev
+
+ -- Marco Trevisan (Treviño) <[email protected]>  Tue, 16 Oct 2018 14:08:32 -0500
+
 gdm3 (3.30.1-1ubuntu3) cosmic; urgency=medium
 
   * Build-Depend on gjs so that we don't produce uninstallable packages
diff --git a/debian/patches/series b/debian/patches/series
index b7dd121..cab417d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -12,3 +12,4 @@ ubuntu_config_error_dialog.patch
 ubuntu_dont_set_language_env.patch
 ubuntu_prefer_ubuntu_session_fallback.patch
 ubuntu_revert_nvidia_wayland_blacklist.patch
+ubuntu/gdm3.service-wait-for-drm-device-before-trying-to-start-i.patch
diff --git a/debian/patches/ubuntu/gdm3.service-wait-for-drm-device-before-trying-to-start-i.patch b/debian/patches/ubuntu/gdm3.service-wait-for-drm-device-before-trying-to-start-i.patch
new file mode 100644
index 0000000..b33510e
--- /dev/null
+++ b/debian/patches/ubuntu/gdm3.service-wait-for-drm-device-before-trying-to-start-i.patch
@@ -0,0 +1,169 @@
+From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <[email protected]>
+Date: Tue, 16 Oct 2018 20:59:23 +0200
+Subject: gdm3.service: wait for drm device before trying to start it
+
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1794280
+Forwarded: not-needed
+---
+ configure.ac             |  1 +
+ data/Makefile.am         |  1 +
+ data/gdm.service.in      |  4 +++
+ utils/Makefile.am        |  9 +++++
+ utils/gdm-wait-for-drm.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 5 files changed, 100 insertions(+)
+ create mode 100644 utils/gdm-wait-for-drm.c
+
+diff --git a/configure.ac b/configure.ac
+index f763632..37fa2ec 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -76,6 +76,7 @@ PKG_CHECK_MODULES(COMMON,
+         gobject-2.0 >= $GLIB_REQUIRED_VERSION
+         gio-2.0 >= $GLIB_REQUIRED_VERSION
+         gio-unix-2.0 >= $GLIB_REQUIRED_VERSION
++        gudev-1.0
+ )
+ AC_SUBST(COMMON_CFLAGS)
+ AC_SUBST(COMMON_LIBS)
+diff --git a/data/Makefile.am b/data/Makefile.am
+index 4aae042..f5b185a 100644
+--- a/data/Makefile.am
++++ b/data/Makefile.am
+@@ -208,6 +208,7 @@ systemdsystemunit =
+ gdm.service: $(srcdir)/gdm.service.in
+ 	$(AM_V_GEN)sed \
+ 		-e 's,[@]sbindir[@],$(sbindir),g' \
++		-e 's,[@]libexecdir[@],$(libexecdir),g' \
+ 		-e 's,[@]GDM_INITIAL_VT[@],$(GDM_INITIAL_VT),g' \
+ 		-e 's,[@]LANG_CONFIG_FILE[@],$(LANG_CONFIG_FILE),g' \
+ 		-e 's,[@]PLYMOUTH_QUIT_SERVICE[@],$(PLYMOUTH_QUIT_SERVICE),g' \
+diff --git a/data/gdm.service.in b/data/gdm.service.in
+index 446e173..89c0bbc 100644
+--- a/data/gdm.service.in
++++ b/data/gdm.service.in
+@@ -32,3 +32,7 @@ StandardError=inherit
+ EnvironmentFile=-@LANG_CONFIG_FILE@
+ ExecReload=/usr/share/gdm/generate-config
+ ExecReload=/bin/kill -SIGHUP $MAINPID
++ExecStartPre=@libexecdir@/gdm-wait-for-drm
++
++[Install]
++Alias=display-manager.service
+diff --git a/utils/Makefile.am b/utils/Makefile.am
+index babe890..3eb43c3 100644
+--- a/utils/Makefile.am
++++ b/utils/Makefile.am
+@@ -35,6 +35,7 @@ bin_PROGRAMS = \
+ 
+ libexec_PROGRAMS = \
+ 	gdm-disable-wayland	\
++	gdm-wait-for-drm	\
+ 	$(NULL)
+ 
+ gdmflexiserver_LDADD =		\
+@@ -63,6 +64,14 @@ gdm_disable_wayland_SOURCES =	\
+ 	gdm-disable-wayland.c	\
+ 	$(NULL)
+ 
++gdm_wait_for_drm_LDADD =	\
++	$(COMMON_LIBS)		\
++	$(NULL)
++
++gdm_wait_for_drm_SOURCES =	\
++	gdm-wait-for-drm.c	\
++	$(NULL)
++
+ CLEANFILES = 			\
+ 	$(NULL)
+ 
+diff --git a/utils/gdm-wait-for-drm.c b/utils/gdm-wait-for-drm.c
+new file mode 100644
+index 0000000..741134e
+--- /dev/null
++++ b/utils/gdm-wait-for-drm.c
+@@ -0,0 +1,85 @@
++#include <glib.h>
++#include <gudev/gudev.h>
++
++static gboolean
++handle_device (GUdevDevice *device)
++{
++        const gchar * const * tags;
++        tags = g_udev_device_get_tags (device);
++        g_debug ("%s\n", g_udev_device_get_name (device));
++        if (g_strv_contains (tags, "master-of-seat"))
++        {
++                g_debug ("    is seat master\n");
++                return TRUE;
++        }
++
++        return FALSE;
++}
++
++static void
++uevent_cb (GUdevClient *client G_GNUC_UNUSED,
++           gchar       *action,
++           GUdevDevice *device,
++           gpointer     user_data)
++{
++        GMainLoop *loop;
++
++        g_debug ("uevent action: %s\n", action);
++
++        loop = (GMainLoop *) user_data;
++
++        if (g_strcmp0 (action, "add") == 0)
++        {
++                if (handle_device (device))
++                {
++                        g_debug ("        this is good\n");
++                        g_main_loop_quit (loop);
++                }
++                else
++                {
++                        g_debug ("        this is bad\n");
++                }
++        }
++}
++
++int
++main()
++{
++        const gchar * const subsystems[] = { "drm", NULL };
++
++        g_autoptr(GList) devices = NULL;
++        g_autoptr(GMainLoop) loop = NULL;
++        g_autoptr(GUdevClient) udev_client = NULL;
++        g_autoptr(GUdevEnumerator) enumerator = NULL;
++
++        loop = g_main_loop_new (NULL, FALSE);
++
++        udev_client = g_udev_client_new (subsystems);
++        enumerator = g_udev_enumerator_new (udev_client);
++        g_udev_enumerator_add_match_is_initialized (enumerator);
++        g_udev_enumerator_add_match_subsystem (enumerator, "drm");
++
++        devices = g_udev_enumerator_execute (enumerator);
++
++        g_debug ("enumerating devices...\n");
++
++        for (GList *l = devices; l != NULL; l = l->next)
++        {
++                g_autoptr(GUdevDevice) device = G_UDEV_DEVICE (l->data);
++
++                if (handle_device (device))
++                {
++                        g_debug ("        good enough for gdm\n");
++                        return EXIT_SUCCESS;
++                }
++        }
++
++        g_signal_connect (udev_client, "uevent", G_CALLBACK (uevent_cb), loop);
++
++        /* after 10 seconds we try anyway */
++        g_timeout_add_seconds (10, (GSourceFunc) g_main_loop_quit, loop);
++
++        g_main_loop_run (loop);
++
++        return EXIT_SUCCESS;
++}
diff --git a/debian/patches/ubuntu_config_error_dialog.patch b/debian/patches/ubuntu_config_error_dialog.patch
index 6381165..d9eb537 100644
--- a/debian/patches/ubuntu_config_error_dialog.patch
+++ b/debian/patches/ubuntu_config_error_dialog.patch
@@ -17,10 +17,10 @@ Forwarded: https://bugzilla.gnome.org/738970
  create mode 100644 data/config-error-dialog.sh
 
 diff --git a/configure.ac b/configure.ac
-index 57cc0c2..eba3a5f 100644
+index 19ebc33..f763632 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1401,7 +1401,7 @@ fi
+@@ -1409,7 +1409,7 @@ fi
  if test x$os_solaris = xyes ; then
     XSESSION_SHELL=/bin/ksh
  else
@@ -30,10 +30,10 @@ index 57cc0c2..eba3a5f 100644
  
  #
 diff --git a/data/Makefile.am b/data/Makefile.am
-index 7945ea5..0be8e90 100644
+index 32e61a2..4aae042 100644
 --- a/data/Makefile.am
 +++ b/data/Makefile.am
-@@ -237,6 +237,7 @@ uninstall-hook:
+@@ -239,6 +239,7 @@ uninstall-hook:
  	rm -f \
  	$(DESTDIR)$(GDM_CUSTOM_CONF) \
  	$(DESTDIR)$(gdmconfdir)/Xsession \
@@ -41,7 +41,7 @@ index 7945ea5..0be8e90 100644
  	$(DESTDIR)$(initdir)/Default \
  	$(DESTDIR)$(postlogindir)/Default.sample \
  	$(DESTDIR)$(predir)/Default \
-@@ -264,6 +265,8 @@ if ENABLE_GDM_XSESSION
+@@ -266,6 +267,8 @@ if ENABLE_GDM_XSESSION
  	$(INSTALL_SCRIPT) Xsession $(DESTDIR)$(gdmconfdir)/Xsession
  endif
  
diff --git a/debian/patches/ubuntu_nvidia_prime.patch b/debian/patches/ubuntu_nvidia_prime.patch
index da77122..cc7ed2c 100644
--- a/debian/patches/ubuntu_nvidia_prime.patch
+++ b/debian/patches/ubuntu_nvidia_prime.patch
@@ -62,7 +62,7 @@ index 3b2fcef..9a57300 100644
  
          if (state->environment != NULL) {
 diff --git a/data/Makefile.am b/data/Makefile.am
-index 7c6a2eb..7945ea5 100644
+index 162074f..32e61a2 100644
 --- a/data/Makefile.am
 +++ b/data/Makefile.am
 @@ -10,6 +10,8 @@ SUBDIRS =			\
@@ -74,7 +74,7 @@ index 7c6a2eb..7945ea5 100644
  postlogindir = $(gdmconfdir)/PostLogin
  workingdir = $(GDM_WORKING_DIR)
  xauthdir = $(GDM_XAUTH_DIR)
-@@ -174,6 +176,8 @@ EXTRA_DIST +=			\
+@@ -176,6 +178,8 @@ EXTRA_DIST +=			\
  	Xsession.in 		\
  	Init.in 		\
  	PreSession.in 		\
@@ -83,7 +83,7 @@ index 7c6a2eb..7945ea5 100644
  	PostSession.in 		\
  	PostLogin 		\
  	$(NULL)
-@@ -236,6 +240,8 @@ uninstall-hook:
+@@ -238,6 +242,8 @@ uninstall-hook:
  	$(DESTDIR)$(initdir)/Default \
  	$(DESTDIR)$(postlogindir)/Default.sample \
  	$(DESTDIR)$(predir)/Default \
@@ -92,7 +92,7 @@ index 7c6a2eb..7945ea5 100644
  	$(DESTDIR)$(postdir)/Default \
  	$(DESTDIR)$(sysconfdir)/dconf/db/gdm \
  	$(DESTDIR)$(sysconfdir)/dconf/profile/gdm \
-@@ -280,7 +286,25 @@ endif
+@@ -282,7 +288,25 @@ endif
  	-if test -f $(DESTDIR)$(predir)/Default; then \
  		cp -f $(DESTDIR)$(predir)/Default $(DESTDIR)$(predir)/Default.orig; \
  	fi
@@ -119,7 +119,7 @@ index 7c6a2eb..7945ea5 100644
  
  	if test '!' -d $(DESTDIR)$(postdir); then \
  		$(mkinstalldirs) $(DESTDIR)$(postdir); \
-@@ -289,7 +313,7 @@ endif
+@@ -291,7 +315,7 @@ endif
  	-if test -f $(DESTDIR)$(postdir)/Default; then \
  		cp -f $(DESTDIR)$(postdir)/Default $(DESTDIR)$(postdir)/Default.orig; \
  	fi
diff --git a/debian/patches/ubuntu_revert_nvidia_wayland_blacklist.patch b/debian/patches/ubuntu_revert_nvidia_wayland_blacklist.patch
index 473a5a7..3f95c1d 100644
--- a/debian/patches/ubuntu_revert_nvidia_wayland_blacklist.patch
+++ b/debian/patches/ubuntu_revert_nvidia_wayland_blacklist.patch
@@ -11,11 +11,14 @@ Wayland is fine, as checked with usptream. So, we can revert nvidia from
 the blacklist for now.
 Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1797355
 Bug: https://gitlab.gnome.org/GNOME/gdm/issues/429
+---
+ data/61-gdm.rules.in | 2 --
+ 1 file changed, 2 deletions(-)
 
-Index: gdm3/data/61-gdm.rules.in
-===================================================================
---- gdm3.orig/data/61-gdm.rules.in
-+++ gdm3/data/61-gdm.rules.in
+diff --git a/data/61-gdm.rules.in b/data/61-gdm.rules.in
+index ad5b87d..c9f6110 100644
+--- a/data/61-gdm.rules.in
++++ b/data/61-gdm.rules.in
 @@ -2,5 +2,3 @@
  ATTR{vendor}=="0x1013", ATTR{device}=="0x00b8", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", RUN+="@libexecdir@/gdm-disable-wayland"
  # disable Wayland on Hi1710 chipsets
-- 
ubuntu-desktop mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-desktop

Reply via email to