summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@gentoo.org>2011-05-03 06:46:10 +0000
committerNirbheek Chauhan <nirbheek@gentoo.org>2011-05-03 06:46:10 +0000
commitf047125a4a219a6fc0f01a30263a6c8c16936d8e (patch)
tree6cff9c70afe3af2ab94a52be10690462373e9746 /gnome-base/gdm
parentMarked ~x64-freebsd (diff)
downloadhistorical-f047125a4a219a6fc0f01a30263a6c8c16936d8e.tar.gz
historical-f047125a4a219a6fc0f01a30263a6c8c16936d8e.tar.bz2
historical-f047125a4a219a6fc0f01a30263a6c8c16936d8e.zip
Fix bug 288852, vt detection finally works properly, remove old
Package-Manager: portage-2.1.9.46/cvs/Linux x86_64
Diffstat (limited to 'gnome-base/gdm')
-rw-r--r--gnome-base/gdm/ChangeLog8
-rw-r--r--gnome-base/gdm/Manifest22
-rw-r--r--gnome-base/gdm/files/gdm-2.32.0-fix-vt-problems.patch195
-rw-r--r--gnome-base/gdm/gdm-2.32.1-r1.ebuild (renamed from gnome-base/gdm/gdm-2.32.0.ebuild)8
4 files changed, 222 insertions, 11 deletions
diff --git a/gnome-base/gdm/ChangeLog b/gnome-base/gdm/ChangeLog
index c74e302b0401..c5b759d11f7b 100644
--- a/gnome-base/gdm/ChangeLog
+++ b/gnome-base/gdm/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for gnome-base/gdm
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/gnome-base/gdm/ChangeLog,v 1.337 2011/03/28 21:41:26 eva Exp $
+# $Header: /var/cvsroot/gentoo-x86/gnome-base/gdm/ChangeLog,v 1.338 2011/05/03 06:46:10 nirbheek Exp $
+
+*gdm-2.32.1-r1 (03 May 2011)
+
+ 03 May 2011; Nirbheek Chauhan <nirbheek@gentoo.org> -gdm-2.32.0.ebuild,
+ +files/gdm-2.32.0-fix-vt-problems.patch, +gdm-2.32.1-r1.ebuild:
+ Fix bug 288852, vt detection finally works properly, remove old
*gdm-2.32.1 (28 Mar 2011)
diff --git a/gnome-base/gdm/Manifest b/gnome-base/gdm/Manifest
index 517c123f8165..4cba459c51a7 100644
--- a/gnome-base/gdm/Manifest
+++ b/gnome-base/gdm/Manifest
@@ -14,22 +14,32 @@ AUX gdm-2.32.0-automagic-libxklavier-support.patch 2069 RMD160 805e7bfd5b2429c8f
AUX gdm-2.32.0-broken-VT-detection.patch 2851 RMD160 89475fd5be6f0692a56ad153239335e90bfc7d9c SHA1 fa2f1c9cc1bf14472bce29a68f9f7e3d2f6a9c6c SHA256 d1ab4a0c931e799adf436a8af53b06436e6fe0321ed05b6cc08de7ad3cba3d49
AUX gdm-2.32.0-custom-session.patch 1317 RMD160 ca07b9580da3bb436629c4655a89b4b6374eb6ba SHA1 db023e279217896849c541dfb50cb96491280ad6 SHA256 3f79b0355225669dd791527a50d5bd0f7ceca850a8eab7bb32f52d609b10eed6
AUX gdm-2.32.0-fix-daemonize-regression.patch 4048 RMD160 4219fec833f0e62a10e52dee89ef5d1a8618d1c1 SHA1 69c5ed6869d5a467e64249f3afe695796c17c463 SHA256 e95e1ebfcfe2c896130e4925fa6f23911bcfe4db27e2a6788229538c6bb2a59d
+AUX gdm-2.32.0-fix-vt-problems.patch 6135 RMD160 7b0a458df1363937c2a6269be192bdb8121c2540 SHA1 69ab0dfb4bc9cb2008a4d7fabfd029cca570368f SHA256 702594b647a728aad7f834f4e38f100f954019f63b7d786b2c9646fe8a24f78d
AUX gdm-2.32.0-selinux-remove-attr.patch 851 RMD160 10dc29802fb29047188bff7aafe979a5e15e030a SHA1 d78bde425b7a141c91767c3e639ee0011feddadc SHA256 ad13d4b1253dca7d5ac362bcce9f5861c2830a3df32e5370a5a0d975c32ec258
AUX gdm-2.32.0-xinitrc-ssh-agent.patch 863 RMD160 6ea58bdc1fa24d41f3c51fc7cdbabc05417053f0 SHA1 ad98258168b84c80d581085804b61649ac67e4d5 SHA256 71231d08baf41ee7b91c33c3d8a731c078d1d29328e09223efb1f579bacdaffe
DIST gdm-2.20.11.tar.bz2 4013059 RMD160 e400bb8a0b78a2e8b0da98edd2e0f3a7a0267f04 SHA1 be23bdf32b7a4254ac80983f4edf25cafa847ff3 SHA256 2e21c9a44941cd0033aaa6b381b563488bbdd0ad1a28ef05f7e0178891f1eaa2
DIST gdm-2.20.9-gentoo-files-r1.tar.bz2 3494 RMD160 9d8f9954bd0d8b657a2faf2516b4548b9f1556d3 SHA1 28ceedb42440fdb50dffa7e69b18f213b00e3935 SHA256 666c0bf1ba28ccc257bf1235b5286e1eb9e15230c0036413ab428e09c54238f9
-DIST gdm-2.32.0.tar.bz2 2477647 RMD160 e072229b29b1420ea8963ab07cf3133868b434a2 SHA1 f3890176f8b10022ed25f6155a98833ae8ce1ca4 SHA256 f47acd19ed10d6fbb37c3e2b54f5b392c7020db67f71db3f75567ead30ab2fa4
DIST gdm-2.32.1.tar.bz2 2441685 RMD160 70526a3ddec3ff8a1313243641bf807a2218f3ae SHA1 75017d6acfc8e158e0df848629431021b25998a5 SHA256 7ba9cb2a8efb9856994467b14e4837a281fcf6d9dc9a267ea38a9aae1ec55abc
DIST gentoo-gdm-theme-r3.tar.bz2 411703 RMD160 9188c8f2661163be72595a6b4924fae0648e7df5 SHA1 246a7ce67ad9d826b1cca6d90b53369b88be72ac SHA256 c7cbe97757ff93f0ffd42f9d9fb702278a361e830940a03901cda9943f44ba68
EBUILD gdm-2.20.11.ebuild 6981 RMD160 d89e163666b53c173578abce9846fed4dde4d5f9 SHA1 5dff7be8ab624c3b15b5dfe6bfb14ae1afc6f0d7 SHA256 174e8685993d432e3cad052626a318f6b622a07954d873ac79c27db0d8ebe3f5
-EBUILD gdm-2.32.0.ebuild 5570 RMD160 f2fd8f43fa9f98fa1c750ea1a8f41e473c4a771a SHA1 803d0e900982be406d15f701d28e3dfb61ea4455 SHA256 50422084bd5c0a3c74faee5c4a5f4e4ebdc021cedbd575099ce2efc1180bbfdc
+EBUILD gdm-2.32.1-r1.ebuild 5563 RMD160 426dd2f7526e923e3f947714f341ce0969c4c75e SHA1 28dc661eeca20e85cf8cdcb9387bc3d9f2e62b12 SHA256 baafbed541c18176749b8794cf6df3d3d810d9d8e752e481be4d361421e41817
EBUILD gdm-2.32.1.ebuild 5564 RMD160 66521c1847ef72639e46c80bff3312581bf211c0 SHA1 6833be35516b42a90510d4ae7212dd2dc0155dbb SHA256 66dfd30db573124795a879bd8a8b28c02fdbe65a9b39e7829c676f5a1877505a
-MISC ChangeLog 46762 RMD160 49b074f87ef342753b47c80478a2c1facbac4374 SHA1 b4a022708c1a64697d864f89eb0fba28862d6417 SHA256 7f46f55f4297c8b28473432c3df5da574c7f0933f07a563419d5dd2d260d6b62
+MISC ChangeLog 47004 RMD160 b3f95e7013e090dccd25aa11d85f5db99eeb204b SHA1 68d42fdc750c6133421a4236b396827baa147b84 SHA256 32cf574d543aa9049b08af0c66c81f6e8845c223f092ea71ceda8da20f3fa774
MISC metadata.xml 536 RMD160 53b21d3083b79fe916434c4031a06d108130185c SHA1 b1e22aa4ac145b16471c105709861ffff6585795 SHA256 9d8a22879d6e19a12a8f47ed551cdf440fec0d7057ff0a12feec1c5752c9ce2d
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
-iEYEARECAAYFAk2RAIwACgkQ1fmVwcYIWAZWVQCg0VQHfh27DBeYFxpg4o/v3ozI
-LukAnjf1dxf+QgDdY+hRED4ngaGPToBd
-=wRm1
+iQIcBAEBAgAGBQJNv6S2AAoJEO/kOhxWD91kwS8P/jjl/YGyZ+rkvTUMf6RdUwbC
+NvTveC+xhajTds21Y8ttOz4UxQdpHXxlGooe1TdjUq1DxCwq1KRFjd2VrUkcD7Wt
+zkGrkoK2eGpN0pbYE1zaqaqGfUBv7Io4rH4I9OqL9vSAF8KJzUJxzxF0H20K2cA0
+6xZaH6PSh6pTchmqMIDDoQIhzKxeJkwbhdCst0N2C7Pk8NQZHbEuo4ZoOH0M5Df4
+/M0LPpupcVijJWwkzdK6l4bB6G8qbu/rQIqbAzpuUd4f0urTJZfXjs18NTV5YotO
+WKMGsOElsGBYVRGr+Ak4X+xN0JGvjUyuO4vcQ4+W7xJkvL4n9TnJyb/YiPRJvps/
+J1BZh+rnlP83aUa7NR9iG/VUlFvkZmSc+eblHXYrezB99d84IyQoUbi+d+Hqk6yI
+TT2vg48slzIRtwftVM53O49wja8NFLXrmisJJ1ROWUQlKycKJoJt1FbjqKINyeB2
+xU62AEIS+4uuyb6y25ucyd30pqPLAqJklX4PYGMGi0J+kkeix4XNcsxRr9qv5WG1
+zCHmtxjyceL/d50lRVDyFyNwbOj/I6ezto5U0++AqmP6Shw3MXnImG/943dYOdUG
+kLbLgK9m51hJwzHN1v4W00x96cdMgrMaMxA/JtS37h/crknq2XC1vuhvM1uMyyYS
+IWybjEws3OjiNb9r/nma
+=5zgw
-----END PGP SIGNATURE-----
diff --git a/gnome-base/gdm/files/gdm-2.32.0-fix-vt-problems.patch b/gnome-base/gdm/files/gdm-2.32.0-fix-vt-problems.patch
new file mode 100644
index 000000000000..b7ceb49c3caf
--- /dev/null
+++ b/gnome-base/gdm/files/gdm-2.32.0-fix-vt-problems.patch
@@ -0,0 +1,195 @@
+From 64002e623fea54ab10040206d164c5fdee4a43d2 Mon Sep 17 00:00:00 2001
+From: Nirbheek Chauhan <nirbheek@gentoo.org>
+Date: Fri, 15 Apr 2011 22:13:44 +0530
+Subject: [PATCH] Fix VT grab race with getty causing X to grab the wrong VT
+
+On bootup, if X is spawned without any args, it'll take up the first unused VT.
+If GDM starts up before gettys are spawned, X takes up VT1 or VT2 depending on
+the init system and bootsplash.
+
+This is problematic because afterwards getty will come up underneath X, and
+cause keyboard problems and eventually crash X.
+
+So we read /etc/inittab, check for open VTs, compare the two values, and take
+the conservative one.
+---
+ configure.ac | 4 ++
+ daemon/Makefile.am | 1 +
+ daemon/gdm-server.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 3 files changed, 110 insertions(+), 1 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ca0f8bb..b9e7462 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -302,6 +302,10 @@ AC_CHECK_TYPE(socklen_t,,
+ AC_CHECK_HEADERS(sys/sockio.h)
+ AC_CHECK_FUNCS([setresuid setenv unsetenv clearenv])
+
++dnl Needed for querying the kernel for free VTs
++AC_CHECK_HEADERS(sys/vt.h)
++AC_CHECK_HEADERS(sys/ioctl.h)
++
+ dnl checks needed for Darwin compatibility to linux **environ.
+ AC_CHECK_HEADERS(crt_externs.h)
+ AC_CHECK_FUNCS(_NSGetEnviron)
+diff --git a/daemon/Makefile.am b/daemon/Makefile.am
+index da18835..c1b6bda 100644
+--- a/daemon/Makefile.am
++++ b/daemon/Makefile.am
+@@ -14,6 +14,7 @@ AM_CPPFLAGS = \
+ -DLIBEXECDIR=\"$(libexecdir)\" \
+ -DLOGDIR=\"$(logdir)\" \
+ -DSBINDIR=\"$(sbindir)\" \
++ -DSYSCONFDIR=\""$(sysconfdir)"\" \
+ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
+ -DGDM_XAUTH_DIR=\"$(GDM_XAUTH_DIR)\" \
+ -DGDM_SCREENSHOT_DIR=\"$(GDM_SCREENSHOT_DIR)\" \
+diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c
+index 339f3cc..29d16dc 100644
+--- a/daemon/gdm-server.c
++++ b/daemon/gdm-server.c
+@@ -26,6 +26,8 @@
+ #include <unistd.h>
+ #include <string.h>
+ #include <sys/types.h>
++#include <sys/ioctl.h>
++#include <sys/vt.h>
+ #include <sys/wait.h>
+ #include <errno.h>
+ #include <ctype.h>
+@@ -42,6 +44,7 @@
+ #include <glib/gi18n.h>
+ #include <glib/gstdio.h>
+ #include <glib-object.h>
++#include <gio/gio.h>
+
+ #include <X11/Xlib.h> /* for Display */
+
+@@ -54,6 +57,8 @@ extern char **environ;
+
+ #define GDM_SERVER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_SERVER, GdmServerPrivate))
+
++#define INITTAB SYSCONFDIR"/inittab"
++
+ /* These are the servstat values, also used as server
+ * process exit codes */
+ #define SERVER_TIMEOUT 2 /* Server didn't start */
+@@ -674,6 +679,105 @@ gdm_server_spawn (GdmServer *server,
+ }
+
+ /**
++ * Parse the inittab file used by getty to spawn VTs to find unused ttys
++ */
++int
++get_free_vt_from_inittab ()
++{
++ GFile *gfile;
++ GFileInputStream *contents;
++ GDataInputStream *dstream;
++ GRegex *getty;
++ GMatchInfo *tty_match = NULL;
++ GSList *tty_list = NULL;
++ GError *error = NULL;
++ gchar *temp = NULL;
++ int vtno = 0;
++
++ gfile = g_file_new_for_path (INITTAB);
++ contents = g_file_read (gfile, NULL, &error);
++ g_object_unref (gfile);
++ if (!contents) {
++ if (error) {
++ g_debug ("Unable to open file %s", INITTAB);
++ g_error_free (error);
++ }
++ goto out;
++ }
++
++ dstream = g_data_input_stream_new (G_INPUT_STREAM (contents));
++ getty = g_regex_new ("^c[0-9]+:.+getty.+tty([0-9]+)", 0, 0, NULL);
++ g_object_unref (contents);
++
++ while (1) {
++ temp = g_data_input_stream_read_line (dstream, NULL, NULL, &error);
++ if (!temp)
++ break;
++ if (!g_regex_match (getty, temp, 0, &tty_match))
++ continue;
++ g_free (temp);
++ temp = g_match_info_fetch (tty_match, 1);
++ if (!temp)
++ continue;
++ tty_list = g_slist_insert_sorted (tty_list, temp, (GCompareFunc)g_strcmp0);
++ g_match_info_free (tty_match);
++ }
++
++ if (error) {
++ g_debug ("Unable to read line from %s", INITTAB);
++ g_error_free (error);
++ goto free;
++ }
++
++ /* Ignore holes in vt allocation, just take the last one */
++ temp = g_slist_last (tty_list)->data;
++ if (temp)
++ vtno = (int) g_ascii_strtoull (temp, NULL, 10) + 1;
++
++free:
++ g_object_unref (dstream);
++ g_regex_unref (getty);
++ g_slist_free_full (tty_list, g_free);
++ g_free (error);
++out:
++ return vtno;
++}
++
++/**
++ * Query the VT_* kernel ioctls to find an empty tty
++ */
++int
++get_free_vt_from_kernel()
++{
++ int fd, vtno = 0;
++
++ fd = open ("/dev/tty0", O_WRONLY, 0);
++ if ((ioctl(fd, VT_OPENQRY, &vtno) < 0) || (vtno == -1)) {
++ vtno = 0;
++ g_debug ("Unable to find a free vt, falling back to Xorg autodetect");
++ }
++ return vtno;
++}
++
++gchar*
++get_free_vt ()
++{
++ int inittab_vtno, kernel_vtno;
++ gchar* vt = NULL;
++
++ inittab_vtno = get_free_vt_from_inittab();
++ if (inittab_vtno > 0)
++ g_debug ("Inittab says vt%i is free\n", inittab_vtno);
++ kernel_vtno = get_free_vt_from_kernel();
++ if (kernel_vtno > 0)
++ g_debug ("Kernel says vt%i is free\n", kernel_vtno);
++ /* Select the greater of the two because getty will use the others */
++ if (kernel_vtno != 0 && inittab_vtno != 0)
++ vt = g_strdup_printf ("vt%i", kernel_vtno > inittab_vtno ? kernel_vtno : inittab_vtno);
++ return vt;
++}
++
++/**
+ * gdm_server_start:
+ * @disp: Pointer to a GdmDisplay structure
+ *
+@@ -686,7 +790,7 @@ gdm_server_start (GdmServer *server)
+ gboolean res;
+
+ /* fork X server process */
+- res = gdm_server_spawn (server, NULL);
++ res = gdm_server_spawn (server, get_free_vt());
+
+ return res;
+ }
+--
+1.7.3.4
+
diff --git a/gnome-base/gdm/gdm-2.32.0.ebuild b/gnome-base/gdm/gdm-2.32.1-r1.ebuild
index 294d4d4fdb04..8c0efcf273ca 100644
--- a/gnome-base/gdm/gdm-2.32.0.ebuild
+++ b/gnome-base/gdm/gdm-2.32.1-r1.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/gnome-base/gdm/gdm-2.32.0.ebuild,v 1.2 2010/11/11 11:48:55 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/gnome-base/gdm/gdm-2.32.1-r1.ebuild,v 1.1 2011/05/03 06:46:10 nirbheek Exp $
EAPI="3"
GCONF_DEBUG="yes"
@@ -102,8 +102,8 @@ src_prepare() {
# daemonize so that the boot process can continue, bug #236701
epatch "${FILESDIR}/${PN}-2.32.0-fix-daemonize-regression.patch"
- # fix VT grab problem causing GDM to grab VT2 instead of 7, bug #261339
- epatch "${FILESDIR}/${PN}-2.32.0-broken-VT-detection.patch"
+ # GDM grabs VT2 instead of VT7, bug 261339, bug 284053, bug 288852
+ epatch "${FILESDIR}/${PN}-2.32.0-fix-vt-problems.patch"
# make custom session work, bug #216984
epatch "${FILESDIR}/${PN}-2.32.0-custom-session.patch"