summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2010-10-21 13:02:30 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2010-10-21 13:02:30 +0000
commite75832bca613e2d08b802b63a070b18ec64507d1 (patch)
tree2f5807e559a7a1cb28ab4929974259326483788a /sys-auth
parentVersion bump. (diff)
downloadgentoo-2-e75832bca613e2d08b802b63a070b18ec64507d1.tar.gz
gentoo-2-e75832bca613e2d08b802b63a070b18ec64507d1.tar.bz2
gentoo-2-e75832bca613e2d08b802b63a070b18ec64507d1.zip
Check for VT_WAITEVENT ioctl during runtime.
(Portage version: 2.2_rc98/cvs/Linux x86_64)
Diffstat (limited to 'sys-auth')
-rw-r--r--sys-auth/consolekit/ChangeLog9
-rw-r--r--sys-auth/consolekit/consolekit-0.4.2-r2.ebuild88
-rw-r--r--sys-auth/consolekit/files/consolekit-0.4.2-check-for-VT_WAITEVENT-ioctl-during-runtime.patch138
3 files changed, 234 insertions, 1 deletions
diff --git a/sys-auth/consolekit/ChangeLog b/sys-auth/consolekit/ChangeLog
index 5437779dfa20..72ccf2093e00 100644
--- a/sys-auth/consolekit/ChangeLog
+++ b/sys-auth/consolekit/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-auth/consolekit
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-auth/consolekit/ChangeLog,v 1.76 2010/09/09 21:13:16 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-auth/consolekit/ChangeLog,v 1.77 2010/10/21 13:02:30 ssuominen Exp $
+
+*consolekit-0.4.2-r2 (21 Oct 2010)
+
+ 21 Oct 2010; Samuli Suominen <ssuominen@gentoo.org>
+ +consolekit-0.4.2-r2.ebuild,
+ +files/consolekit-0.4.2-check-for-VT_WAITEVENT-ioctl-during-runtime.patch:
+ Check for VT_WAITEVENT ioctl during runtime.
*consolekit-0.4.2-r1 (09 Sep 2010)
diff --git a/sys-auth/consolekit/consolekit-0.4.2-r2.ebuild b/sys-auth/consolekit/consolekit-0.4.2-r2.ebuild
new file mode 100644
index 000000000000..e6f8f46cc904
--- /dev/null
+++ b/sys-auth/consolekit/consolekit-0.4.2-r2.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-auth/consolekit/consolekit-0.4.2-r2.ebuild,v 1.1 2010/10/21 13:02:30 ssuominen Exp $
+
+EAPI=3
+inherit autotools eutils multilib pam
+
+MY_PN=ConsoleKit
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Framework for defining and tracking users, login sessions and seats."
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/ConsoleKit"
+SRC_URI="http://www.freedesktop.org/software/${MY_PN}/dist/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux"
+IUSE="debug doc pam policykit test"
+
+RDEPEND=">=dev-libs/dbus-glib-0.80
+ >=dev-libs/glib-2.20
+ sys-libs/zlib
+ x11-libs/libX11
+ pam? ( virtual/pam )
+ policykit? ( >=sys-auth/polkit-0.96 )"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig
+ dev-libs/libxslt
+ doc? ( app-text/xmlto )
+ test? ( app-text/docbook-xml-dtd:4.1.2 )"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-0.2.10-cleanup_console_tags.patch \
+ "${FILESDIR}"/${PN}-0.4.0-polkit-automagic.patch \
+ "${FILESDIR}"/${PN}-0.4.0-multilib.patch \
+ "${FILESDIR}"/${PN}-0.4.1-shutdown-reboot-without-policies.patch \
+ "${FILESDIR}"/${PN}-0.4.2-revert.patch \
+ "${FILESDIR}"/${PN}-0.4.2-check-for-VT_WAITEVENT-ioctl-during-runtime.patch
+
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ XMLTO_FLAGS="--skip-validation" \
+ --localstatedir="${EPREFIX}"/var \
+ $(use_enable pam pam-module) \
+ $(use_enable doc docbook-docs) \
+ $(use_enable debug) \
+ $(use_enable policykit polkit) \
+ --with-dbus-services="${EPREFIX}"/usr/share/dbus-1/services \
+ --with-pam-module-dir=$(getpam_mod_dir)
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ htmldocdir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ install || die
+
+ dodoc AUTHORS ChangeLog HACKING NEWS README TODO
+
+ newinitd "${FILESDIR}"/${PN}-0.1.rc consolekit
+
+ keepdir /usr/$(get_libdir)/ConsoleKit/run-session.d
+ keepdir /etc/ConsoleKit/run-session.d
+ keepdir /var/run/ConsoleKit
+ keepdir /var/log/ConsoleKit
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ doexe "${FILESDIR}"/90-consolekit || die
+
+ exeinto /usr/$(get_libdir)/ConsoleKit/run-session.d
+ doexe "${FILESDIR}"/pam-foreground-compat.ck || die
+
+ find "${ED}" -name '*.la' -exec rm -f '{}' +
+}
+
+pkg_postinst() {
+ ewarn
+ ewarn "You need to restart ConsoleKit to get the new features."
+ ewarn "This can be done with /etc/init.d/consolekit restart"
+ ewarn "but make sure you do this and then restart your session"
+ ewarn "otherwise you will get access denied for certain actions"
+}
diff --git a/sys-auth/consolekit/files/consolekit-0.4.2-check-for-VT_WAITEVENT-ioctl-during-runtime.patch b/sys-auth/consolekit/files/consolekit-0.4.2-check-for-VT_WAITEVENT-ioctl-during-runtime.patch
new file mode 100644
index 000000000000..cee268a2244c
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-0.4.2-check-for-VT_WAITEVENT-ioctl-during-runtime.patch
@@ -0,0 +1,138 @@
+From 24dc214f55e7c7c17d888d0ccf94cd3625767462 Mon Sep 17 00:00:00 2001
+From: Michael Biebl <biebl@debian.org>
+Date: Sun, 19 Sep 2010 22:45:16 +0000
+Subject: linux: Check for VT_WAITEVENT ioctl during runtime
+
+Since 2782cc8d4950effbc4407455e72bd4750cef6e11 ConsoleKit fails, if it
+has been compiled on a linux kernel >= 2.6.32 but is run with an older
+kernel. Check for VT_WAITEVENT ioctl during runtime and fallback to the
+old behaviour of creating a thread for every possible vt.
+---
+diff --git a/src/ck-vt-monitor.c b/src/ck-vt-monitor.c
+index 369c63e..9310341 100644
+--- a/src/ck-vt-monitor.c
++++ b/src/ck-vt-monitor.c
+@@ -27,6 +27,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <signal.h>
++#include <sys/ioctl.h>
+
+ #include <glib.h>
+ #include <glib/gi18n.h>
+@@ -311,6 +312,34 @@ schedule_process_queue (CkVtMonitor *vt_monitor)
+ G_UNLOCK (schedule_lock);
+ }
+
++#ifdef VT_WAITEVENT
++static gboolean
++vt_waitevent_supported (int fd)
++{
++ static int supported = -1;
++ int res;
++
++ if (supported >= 0)
++ return supported;
++
++ res = ioctl(fd, VT_WAITEVENT, NULL);
++
++ if (res == ERROR) {
++ if (errno == EINVAL) {
++ g_debug ("VT_WAITEVENT not supported on this system");
++ supported = FALSE;
++ return FALSE;
++ } else if (errno == EFAULT) {
++ g_debug ("VT_WAITEVENT supported on this system");
++ supported = TRUE;
++ return TRUE;
++ }
++ }
++ g_debug ("Unexpected result for VT_WAITEVENT check, returning FALSE");
++ return FALSE;
++}
++#endif
++
+ static void *
+ vt_thread_start (ThreadData *data)
+ {
+@@ -322,6 +351,9 @@ vt_thread_start (ThreadData *data)
+ num = data->num;
+
+ #ifdef VT_WAITEVENT
++ if (!vt_waitevent_supported(vt_monitor->priv->vfd))
++ goto no_waitevent;
++
+ for (;;) {
+ res = ck_wait_for_console_switch (vt_monitor->priv->vfd, &num);
+ if (! res) {
+@@ -340,7 +372,10 @@ vt_thread_start (ThreadData *data)
+ schedule_process_queue (vt_monitor);
+ }
+ }
+-#else
++ goto out;
++#endif
++
++no_waitevent:
+ res = ck_wait_for_active_console_num (vt_monitor->priv->vfd, num);
+ if (! res) {
+ /* FIXME: what do we do if it fails? */
+@@ -357,8 +392,8 @@ vt_thread_start (ThreadData *data)
+ /* schedule processing of queue */
+ schedule_process_queue (vt_monitor);
+ }
+-#endif
+
++out:
+ G_LOCK (hash_lock);
+ if (vt_monitor->priv->vt_thread_hash != NULL) {
+ g_hash_table_remove (vt_monitor->priv->vt_thread_hash, GUINT_TO_POINTER (num));
+@@ -418,19 +453,24 @@ vt_add_watches (CkVtMonitor *vt_monitor)
+ sigaction (SIGPOLL, &act, NULL);
+
+ ioctl (vt_monitor->priv->vfd, I_SETSIG, S_MSG);
+-#elif defined (VT_WAITEVENT)
++#else
++ guint max_consoles;
++ int i;
++ gint32 current_num;
+ gpointer id;
+
++#if defined (VT_WAITEVENT)
++ if (!vt_waitevent_supported(vt_monitor->priv->vfd))
++ goto no_waitevent;
++
+ G_LOCK (hash_lock);
+ id = GINT_TO_POINTER (1);
+ if (g_hash_table_lookup (vt_monitor->priv->vt_thread_hash, id) == NULL)
+ vt_add_watch_unlocked (vt_monitor, 1);
+- G_UNLOCK (hash_lock);
+-#else
+- guint max_consoles;
+- int i;
+- gint32 current_num;
++ goto out;
++#endif
+
++no_waitevent:
+ G_LOCK (hash_lock);
+
+ current_num = vt_monitor->priv->active_num;
+@@ -442,7 +482,6 @@ vt_add_watches (CkVtMonitor *vt_monitor)
+ }
+
+ for (i = 1; i < max_consoles; i++) {
+- gpointer id;
+
+ /* don't wait on the active vc */
+ if (i == current_num) {
+@@ -457,6 +496,7 @@ vt_add_watches (CkVtMonitor *vt_monitor)
+ }
+ }
+
++out:
+ G_UNLOCK (hash_lock);
+ #endif
+ }
+--
+cgit v0.8.3-6-g21f6