[SCM] KDE Base Workspace module packaging branch, squeeze, updated. debian/4.4.5-4-2-g8309f5a

Modestas Vainius modax at alioth.debian.org
Fri Nov 26 23:22:55 UTC 2010


The following commit has been merged in the squeeze branch:
commit 8309f5acd4d65ddff76caf3078a8eba65e6130cc
Author: Modestas Vainius <modestas at vainius.eu>
Date:   Sat Nov 27 01:21:48 2010 +0200

    Add initial version of the kFreeBSD VT switching patch for KDM.
    
    Some rather serious issues still remain (not working shutdown/reboot from KDE,
    sometimes buggy VT switching) but this patch is a good start and could be
    considered as closing #586540 in the short term.
---
 debian/changelog                                   |    3 +
 .../patches/31_kdm_vt_switching_on_kfreebsd.diff   |  158 ++++++++++++++++++++
 debian/patches/series                              |    1 +
 3 files changed, 162 insertions(+), 0 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index cd013bb..e658801 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,8 @@
 kdebase-workspace (4:4.4.5-5) UNRELEASED; urgency=low
 
+  * Add patch 31_kdm_vt_switching_on_kfreebsd.diff which implements VT
+    switching and status detection support in KDM on kFreeBSD. This should
+    fix an issue with with KDM hijacking VT2 on bootup. (Closes: #586540)
 
  -- Modestas Vainius <modax at debian.org>  Sat, 27 Nov 2010 01:02:53 +0200
 
diff --git a/debian/patches/31_kdm_vt_switching_on_kfreebsd.diff b/debian/patches/31_kdm_vt_switching_on_kfreebsd.diff
new file mode 100644
index 0000000..b7904bd
--- /dev/null
+++ b/debian/patches/31_kdm_vt_switching_on_kfreebsd.diff
@@ -0,0 +1,158 @@
+From: Modestas Vainius <modax at debian.org>
+Subject: implement VT switching and status detection support in KDM on kFreeBSD
+Forwarded: no
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=586540
+Last-Update: 2010-10-24
+
+This patch implements proper VT switching for KDM on kFreeBSD. It also includes
+detection of the next available VT which should prevent KDM from taking over
+vt2 on bootup and locking up keyboard/mouse input.
+
+This revision of the patch is pretty hackish. What is more, it does not cover
+FreeBSD (only kFreeBSD) while it could perfectly do so.
+--- a/kdm/backend/dm.c
++++ b/kdm/backend/dm.c
+@@ -48,7 +48,13 @@ from the copyright holder.
+ 
+ #ifdef HAVE_VTS
+ # include <sys/ioctl.h>
++#if defined(__linux__)
+ # include <sys/vt.h>
++#elif defined(__FreeBSD_kernel__)
++# include <sys/consio.h>
++# include <sys/tty.h>
++# include <sys/sysctl.h>
++#endif
+ #endif
+ 
+ static void sigHandler( int n );
+@@ -329,7 +335,12 @@ main( int argc, char **argv )
+ int
+ TTYtoVT( const char *tty )
+ {
+-	return memcmp( tty, "tty", 3 ) ? 0 : atoi( tty + 3 );
++	if (!memcmp( tty, "ttyv", 4 )) // FreeBSD
++		return atoi( tty + 4 );
++	else if (!memcmp( tty, "tty", 3 )) // Linux
++		return atoi( tty + 3 );
++	else
++		return 0;
+ }
+ 
+ int
+@@ -1036,9 +1047,15 @@ reapChildren( void )
+ 					} else {
+ 						int con = open( "/dev/console", O_RDONLY );
+ 						if (con >= 0) {
++							int activevt;
++#if defined(__linux__)
+ 							struct vt_stat vtstat;
+ 							ioctl( con, VT_GETSTATE, &vtstat );
+-							if (vtstat.v_active == d->serverVT) {
++							activevt = vtstat.v_active;
++#elif defined(__FreeBSD_kernel__)
++							ioctl( con, VT_GETACTIVE, &activevt);
++#endif
++							if (activevt == d->serverVT) {
+ 								int vt = 1;
+ 								struct display *di;
+ 								for (di = displays; di; di = di->next)
+@@ -1051,7 +1068,9 @@ reapChildren( void )
+ 										vt = di->serverVT;
+ 								ioctl( con, VT_ACTIVATE, vt );
+ 							}
++#ifdef __linux__
+ 							ioctl( con, VT_DISALLOCATE, d->serverVT );
++#endif
+ 							close( con );
+ 						}
+ 					}
+@@ -1327,16 +1346,29 @@ static int activeVTs;
+ static int
+ getBusyVTs( void )
+ {
+-	struct vt_stat vtstat;
+-	int con;
+-
+ 	if (activeVTs == -1) {
++#if defined(__linux__)
++		struct vt_stat vtstat;
++		int con;
++
+ 		vtstat.v_state = 0;
+ 		if ((con = open( "/dev/console", O_RDONLY )) >= 0) {
+ 			ioctl( con, VT_GETSTATE, &vtstat );
+ 			close( con );
+ 		}
+ 		activeVTs = vtstat.v_state;
++#elif defined(__FreeBSD_kernel__)
++		struct xtty *ttys;
++		size_t s, i;
++		activeVTs = 0;
++		if (!sysctlbyname("kern.ttys", NULL, &s, NULL, 0)) {
++			ttys = (struct xtty *) malloc(s);
++			sysctlbyname("kern.ttys", ttys, &s, NULL, 0);
++			for (i = 0; i < s / sizeof(struct xtty); i++) {
++				activeVTs |= !!(ttys[i].xt_flags & TF_OPENED) << i;
++			}
++		}
++#endif
+ 	}
+ 	return activeVTs;
+ }
+--- a/kdm/backend/greet.h
++++ b/kdm/backend/greet.h
+@@ -53,7 +53,7 @@ from the copyright holder.
+ # define USE_SYSLOG
+ #endif
+ 
+-#ifdef __linux__
++#if defined(__linux__) || defined(__FreeBSD_kernel__)
+ /* This needs to be run-time configurable, additionally. */
+ # define HAVE_VTS
+ #endif
+--- a/kdm/backend/client.c
++++ b/kdm/backend/client.c
+@@ -1301,7 +1301,11 @@ startClient( volatile int *pid )
+ 	
+ # ifdef HAVE_VTS
+ 	if (td->serverVT > 0)
++# if defined(__linux__)
+ 		sprintf( ckDeviceBuf, "/dev/tty%d", td->serverVT );
++# elif defined(__FreeBSD_kernel__)
++		sprintf( ckDeviceBuf, "/dev/ttyv%d", td->serverVT );
++# endif
+ # endif
+ 	isLocal = ((td->displayType & d_location) == dLocal);
+ # ifdef XDMCP
+--- a/kdm/kfrontend/genkdmconf.c
++++ b/kdm/kfrontend/genkdmconf.c
+@@ -1483,7 +1483,8 @@ static void
+ upd_servervts( Entry *ce, Section *cs ATTR_UNUSED )
+ {
+ 	if (!ce->active) { /* there is only the Global one */
+-#ifdef __linux__ /* XXX actually, sysvinit */
++/* XXX actually, sysvinit */
++#if defined(__linux__) || defined(__FreeBSD_kernel__) 
+ 		getInitTab();
+ 		ASPrintf( (char **)&ce->value, "-%d", maxTTY + 1 );
+ 		ce->active = ce->written = True;
+@@ -1495,7 +1496,8 @@ static void
+ upd_consolettys( Entry *ce, Section *cs ATTR_UNUSED )
+ {
+ 	if (!ce->active) { /* there is only the Global one */
+-#ifdef __linux__ /* XXX actually, sysvinit */
++/* XXX actually, sysvinit */
++#if defined(__linux__) || defined(__FreeBSD_kernel__) 
+ 		char *buf;
+ 		int i;
+ 
+@@ -3072,7 +3074,7 @@ int main( int argc, char **argv )
+ 			}
+ 		}
+ 	}
+-#ifdef __linux__
++#if defined(__linux__) || defined(__FreeBSD_kernel__)
+ 	if (!stat( "/etc/debian_version", &st )) { /* debian */
+ 		defminuid = "1000";
+ 		defmaxuid = "29999";
diff --git a/debian/patches/series b/debian/patches/series
index dc8f1aa..c087879 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -14,6 +14,7 @@
 28_backport_bug156475_dualhead_support.diff
 29_backport_fix_krandr_support_in_startkde.diff
 30_plasma_netbook_fix_autostart.diff
+31_kdm_vt_switching_on_kfreebsd.diff
 97_fix_target_link_libraries.diff
 27_ld_exclude_libs_qtuitools.diff
 99_solid_network_use_ntrack.diff

-- 
KDE Base Workspace module packaging



More information about the pkg-kde-commits mailing list