r22379 - in /desktop/experimental/gdm/debian: TODO changelog patches/06_first_vt.patch patches/series
lethalman-guest at users.alioth.debian.org
lethalman-guest at users.alioth.debian.org
Thu Nov 19 20:03:02 UTC 2009
Author: lethalman-guest
Date: Thu Nov 19 20:02:54 2009
New Revision: 22379
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=22379
Log:
* debian/patches/06_first_vt.patch:
- Backport some code of the tty manager from gdm 2.20.
- TODO: TTYs are allocated by X itself, which leads to giant FAIL when
gdm is started before the getty processes.
Added:
desktop/experimental/gdm/debian/patches/06_first_vt.patch
Modified:
desktop/experimental/gdm/debian/TODO
desktop/experimental/gdm/debian/changelog
desktop/experimental/gdm/debian/patches/series
Modified: desktop/experimental/gdm/debian/TODO
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gdm/debian/TODO?rev=22379&op=diff
==============================================================================
--- desktop/experimental/gdm/debian/TODO [utf-8] (original)
+++ desktop/experimental/gdm/debian/TODO [utf-8] Thu Nov 19 20:02:54 2009
@@ -14,12 +14,6 @@
* The default session is always GNOME
=> Fixed by Ubuntu’s 15_default_session.patch
- * TTYs are allocated by X itself, which leads to giant FAIL when gdm is
- started before the getty processes (which is the case on Debian).
- => Ubuntu uses a giant hack that is clearly not an acceptable fix.
- => We need to port some functions of the VT manager from GDM 2.20,
- mostly the one that finds the first unallocated VT.
-
* There is no configuration GUI
=> Ubuntu has one, in 08_use_polkit_for_settings.patch and
09_gdmsetup.patch.
Modified: desktop/experimental/gdm/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gdm/debian/changelog?rev=22379&op=diff
==============================================================================
--- desktop/experimental/gdm/debian/changelog [utf-8] (original)
+++ desktop/experimental/gdm/debian/changelog [utf-8] Thu Nov 19 20:02:54 2009
@@ -19,6 +19,10 @@
* debian/patches/05_default_keyboard_layout_xkl.patch:
- Ubuntu hal patch translated to libxklavier.
- TODO: The default keyboard layout is wrong.
+ * debian/patches/06_first_vt.patch:
+ - Backport some code of the tty manager from gdm 2.20.
+ - TODO: TTYs are allocated by X itself, which leads to giant FAIL when
+ gdm is started before the getty processes.
* debian/patches/90_relibtoolize.patch:
- Update for 05_default_keyboard_layout_xkl.patch libxklavier changes to
Makefile.am.
@@ -34,7 +38,7 @@
* debian/TODO:
- gdmflexiserver is ignoring many options, including xnest.
- -- Luca Bruno <lethalman88 at gmail.com> Sat, 14 Nov 2009 17:50:44 +0100
+ -- Luca Bruno <lethalman88 at gmail.com> Thu, 19 Nov 2009 20:56:19 +0100
gdm (2.26.1-1) UNRELEASED; urgency=low
Added: desktop/experimental/gdm/debian/patches/06_first_vt.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gdm/debian/patches/06_first_vt.patch?rev=22379&op=file
==============================================================================
--- desktop/experimental/gdm/debian/patches/06_first_vt.patch (added)
+++ desktop/experimental/gdm/debian/patches/06_first_vt.patch [utf-8] Thu Nov 19 20:02:54 2009
@@ -1,0 +1,245 @@
+It's almost the same tty manager of gdm 2.20, except we don't support Sun VTs,
+only Linux and FreeBSD.
+diff -urN gdm-2.28.1.orig/common/gdm-settings-keys.h gdm-2.28.1/common/gdm-settings-keys.h
+--- gdm-2.28.1.orig/common/gdm-settings-keys.h 2009-10-20 00:12:45.000000000 +0200
++++ gdm-2.28.1/common/gdm-settings-keys.h 2009-11-17 23:55:18.000000000 +0100
+@@ -32,6 +32,7 @@
+ #define GDM_KEY_TIMED_LOGIN_ENABLE "daemon/TimedLoginEnable"
+ #define GDM_KEY_TIMED_LOGIN_USER "daemon/TimedLogin"
+ #define GDM_KEY_TIMED_LOGIN_DELAY "daemon/TimedLoginDelay"
++#define GDM_KEY_FIRST_VT "daemon/FirstVT"
+
+ #define GDM_KEY_DISALLOW_TCP "security/DisallowTCP"
+
+diff -urN gdm-2.28.1.orig/daemon/gdm-server.c gdm-2.28.1/daemon/gdm-server.c
+--- gdm-2.28.1.orig/daemon/gdm-server.c 2009-10-20 00:12:45.000000000 +0200
++++ gdm-2.28.1/daemon/gdm-server.c 2009-11-18 00:14:19.000000000 +0100
+@@ -44,6 +44,9 @@
+ #include "gdm-common.h"
+ #include "gdm-signal-handler.h"
+
++#include "gdm-settings-direct.h"
++#include "gdm-settings-keys.h"
++
+ #include "gdm-server.h"
+
+ extern char **environ;
+@@ -663,6 +666,187 @@
+ return ret;
+ }
+
++#include <sys/ioctl.h>
++#include <sys/stat.h>
++#if defined (__linux__)
++#define GDM_USE_SYS_VT
++#include <sys/vt.h>
++#elif defined (__FreeBSD__)
++#define GDM_USE_CONSIO_VT
++#include <sys/consio.h>
++#endif
++#define GDMCONSOLEDEVICE "/dev/console"
++
++static gchar *
++gdm_get_vt_device (int vtno)
++{
++ gchar *vtname = NULL;
++
++#if defined (GDM_USE_SYS_VT)
++ vtname = g_strdup_printf ("/dev/tty%d", vtno);
++#elif defined (GDM_USE_CONSIO_VT)
++ vtname = g_strdup_printf ("/dev/ttyv%s", __itovty (vtno - 1));
++#endif
++
++ return vtname;
++}
++
++static int
++open_vt (int vtno)
++{
++ char *vtname = NULL;
++ int fd = -1;
++
++ vtname = gdm_get_vt_device (vtno);
++
++ do {
++ errno = 0;
++ fd = open (vtname, O_RDWR
++#ifdef O_NOCTTY
++ |O_NOCTTY
++#endif
++ , 0);
++ } while G_UNLIKELY (errno == EINTR);
++
++ g_free (vtname);
++
++ return fd;
++}
++
++static int
++get_first_vt (void)
++{
++ int first_vt;
++ if (!gdm_settings_direct_get_int (GDM_KEY_FIRST_VT,
++ &first_vt))
++ first_vt = 1;
++ return first_vt;
++}
++
++#if defined (GDM_USE_SYS_VT)
++
++static int
++get_free_vt_sys (void)
++{
++ int fd, fdv;
++ int vtno;
++ unsigned short vtmask;
++ struct vt_stat vtstat;
++
++ do {
++ errno = 0;
++ fd = open (GDMCONSOLEDEVICE,
++ O_WRONLY
++#ifdef O_NOCTTY
++ |O_NOCTTY
++#endif
++ , 0);
++ } while G_UNLIKELY (errno == EINTR);
++ if (fd < 0)
++ return -1;
++
++ if (ioctl (fd, VT_GETSTATE, &vtstat) < 0) {
++ VE_IGNORE_EINTR (close (fd));
++ return -1;
++ }
++
++ for (vtno = get_first_vt (), vtmask = 1 << vtno; vtstat.v_state & vtmask; vtno++, vtmask <<= 1);
++ if (!vtmask) {
++ VE_IGNORE_EINTR (close (fd));
++ return -1;
++ }
++
++ fdv = open_vt (vtno);
++ if (fdv < 0) {
++ VE_IGNORE_EINTR (close (fd));
++ return -1;
++ }
++ VE_IGNORE_EINTR (close (fdv));
++ VE_IGNORE_EINTR (close (fd));
++ return vtno;
++}
++
++#elif defined (GDM_USE_CONSIO_VT)
++
++static int
++get_free_vt_consio (void)
++{
++ int fd, fdv;
++ int vtno;
++ GList *to_close_vts = NULL, *li;
++
++ do {
++ errno = 0;
++ fd = open (GDMCONSOLEDEVICE,
++ O_WRONLY
++#ifdef O_NOCTTY
++ |O_NOCTTY
++#endif
++ , 0);
++ } while G_UNLIKELY (errno == EINTR);
++ if (fd < 0)
++ return -1;
++
++ if ((ioctl (fd, VT_OPENQRY, &vtno) < 0) || (vtno == -1)) {
++ VE_IGNORE_EINTR (close (fd));
++ return -1;
++ }
++
++ fdv = open_vt (vtno);
++ if (fdv < 0) {
++ VE_IGNORE_EINTR (close (fd));
++ return -1;
++ }
++
++ while (vtno < get_first_vt ()) {
++ int oldvt = vtno;
++ to_close_vts = g_list_prepend (to_close_vts,
++ GINT_TO_POINTER (fdv));
++
++ if (ioctl (fd, VT_OPENQRY, &vtno) == -1) {
++ vtno = -1;
++ break;
++ }
++
++ if (oldvt == vtno) {
++ vtno = -1;
++ break;
++ }
++
++ fdv = open_vt (vtno);
++ if (fdv < 0) {
++ vtno = -1;
++ break;
++ }
++ }
++
++ for (li = to_close_vts; li != NULL; li = li->next) {
++ VE_IGNORE_EINTR (close (GPOINTER_TO_INT (li->data)));
++ }
++ VE_IGNORE_EINTR (close (fdv));
++ VE_IGNORE_EINTR (close (fd));
++ return vtno;
++}
++
++#endif
++
++static char *
++gdm_get_empty_vt_argument (void)
++{
++ int vt = -1;
++
++#if defined (GDM_USE_SYS_VT)
++ vt = get_free_vt_sys ();
++#elif defined (GDM_USE_CONSIO_VT)
++ vt = get_free_vt_consio ();
++#endif
++
++ if (vt < 0)
++ return NULL;
++ else
++ return g_strdup_printf ("vt%d", vt);
++}
++
+ /**
+ * gdm_server_start:
+ * @disp: Pointer to a GdmDisplay structure
+@@ -674,10 +858,14 @@
+ gdm_server_start (GdmServer *server)
+ {
+ gboolean res;
++ char *vtarg;
++
++ vtarg = gdm_get_empty_vt_argument ();
+
+ /* fork X server process */
+- res = gdm_server_spawn (server, NULL);
++ res = gdm_server_spawn (server, vtarg);
+
++ g_free (vtarg);
+ return res;
+ }
+
+diff -urN gdm-2.28.1.orig/data/gdm.schemas.in.in gdm-2.28.1/data/gdm.schemas.in.in
+--- gdm-2.28.1.orig/data/gdm.schemas.in.in 2009-10-20 00:12:45.000000000 +0200
++++ gdm-2.28.1/data/gdm.schemas.in.in 2009-11-17 23:47:19.000000000 +0100
+@@ -47,6 +47,11 @@
+ <signature>i</signature>
+ <default>30</default>
+ </schema>
++ <schema>
++ <key>daemon/FirstVT</key>
++ <signature>i</signature>
++ <default>7</default>
++ </schema>
+
+ <schema>
+ <key>security/DisallowTCP</key>
Modified: desktop/experimental/gdm/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gdm/debian/patches/series?rev=22379&op=diff
==============================================================================
--- desktop/experimental/gdm/debian/patches/series [utf-8] (original)
+++ desktop/experimental/gdm/debian/patches/series [utf-8] Thu Nov 19 20:02:54 2009
@@ -3,4 +3,5 @@
03_authdir.patch
04_custom-conf.patch
05_default_keyboard_layout_xkl.patch
+06_first_vt.patch
90_relibtoolize.patch
More information about the pkg-gnome-commits
mailing list