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
commit2abd78de1049c23e9d5adb5a47619605698c0f48 (patch)
treec04780fce09f7773a63b831bfaf6e9489fa77841 /sys-auth
parentVersion bump. (diff)
downloadhistorical-2abd78de1049c23e9d5adb5a47619605698c0f48.tar.gz
historical-2abd78de1049c23e9d5adb5a47619605698c0f48.tar.bz2
historical-2abd78de1049c23e9d5adb5a47619605698c0f48.zip
Check for VT_WAITEVENT ioctl during runtime.
Package-Manager: portage-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/Manifest4
-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
4 files changed, 237 insertions, 2 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/Manifest b/sys-auth/consolekit/Manifest
index e5da0e39416a..b64c4b507270 100644
--- a/sys-auth/consolekit/Manifest
+++ b/sys-auth/consolekit/Manifest
@@ -5,11 +5,13 @@ AUX consolekit-0.2.10-polkit-automagic.patch 988 RMD160 1146e1c30b327191a5429e54
AUX consolekit-0.4.0-multilib.patch 4378 RMD160 ef80a5e681e7d036be4de1dff40a550c3b422087 SHA1 221d6b04e35fca3bc42ec97f9bccb7c3792a0788 SHA256 1b00d28b62c0c71648978a48e65bd1bac08d230945c933e3f7cfd74cf59f337d
AUX consolekit-0.4.0-polkit-automagic.patch 841 RMD160 59f6f8d13a6f030107908b5926e2f49439ae2f6e SHA1 6c1442f4cc860bd5e828997a6fb44cc891028e1c SHA256 965ea7e3a2868ae8fa3d0ee6c48a5b06149c08d273e8f4a8e6afa9eec0a26357
AUX consolekit-0.4.1-shutdown-reboot-without-policies.patch 1166 RMD160 946969cbc2c86bf81f151cbefae022ea95971a57 SHA1 1db7f74e84146c738d5de4b5f835376a1a394280 SHA256 78e7e3b71c34c9a0b2eef58c55c8ac6e34fd4ee0ddb03d20c9adf138d2dafbc9
+AUX consolekit-0.4.2-check-for-VT_WAITEVENT-ioctl-during-runtime.patch 4104 RMD160 7db82fa9b1da7c922b6fa8f68e6677c5fc215c70 SHA1 07bbb52b7d326c23d4262c4996e4be77d22017f7 SHA256 f74c68229ecdef620584b6a5c93aae60e4313dae66e9117099804b49719ac888
AUX consolekit-0.4.2-revert.patch 7953 RMD160 7b156638e153eefa9ded729c48fa4a0aea2041c2 SHA1 3ea4e6d3b604a0c67fd5c3dac28a7f1ca6233cb8 SHA256 aec3c64c7412ad746c871ad596bb67614bbecc0dd40f4e60cd8127aec6bde28d
AUX pam-foreground-compat.ck 389 RMD160 b72a66d5fde612a825fb60f0f1402a0665cc6d81 SHA1 25c3e54e326606e6c476e0dbb9637e2e551a6ccc SHA256 0b5b22641e2b138f4e9dfff9790df9fedaf2f760cc3d878ee1e94c2fd52edea9
DIST ConsoleKit-0.4.1.tar.bz2 398080 RMD160 800076645134ad63d582ea9ffb3ada0113a32db1 SHA1 ab2b8643c1e696df4dc79d9ee0323bdc95aaa6a1 SHA256 f032adc6146d745034315054c5822a7a09f30e20a40d6e802221fa977354403e
DIST ConsoleKit-0.4.2.tar.bz2 412651 RMD160 cc76cfb1462a238754c7c1ecd7404a0db26c7501 SHA1 fa588abe532c1d55fd98e0cc0178dde3f30266ff SHA256 656f406c9c436bd105c34d87e824cb2fbae09fa672b93894059281124480fe15
EBUILD consolekit-0.4.1.ebuild 2972 RMD160 1648925c2b711cf51bc874774ea7d5ea783ad60e SHA1 5992cd04c68009be7bf90a50e0d1bdb4899efd18 SHA256 79c062a5c916f369cc6d023024a1ee85f8515f7c36ea032d93e10b660bc1097f
EBUILD consolekit-0.4.2-r1.ebuild 2557 RMD160 eb81a92e55110dc564fe523bc803c5b877a7e6b8 SHA1 b2a1f070c9165052ede192cf80b3d2c3e07c5cb6 SHA256 761e746972149273e34f057ef98e1dc58080823e2bb0254c3d7f11c4d86cf82d
-MISC ChangeLog 11445 RMD160 4f3d801646582ff827c8713efab0e90de99736c3 SHA1 3ce6695cae1d7fd937ec6871d3ed32c9b860bebe SHA256 a4c702774e30757da14d9c11c539a07544ddf82d84ff4483ded9f15d49f74a98
+EBUILD consolekit-0.4.2-r2.ebuild 2637 RMD160 b7e8a191f7ff1936f6f55b0e60223e802beb7b27 SHA1 67e7b6c4507221042bd08e2d7ead8e11b32a26b1 SHA256 bc5bad43220781acb07b3e402a0b992a13db5470e044b42d8f9af37c035f1ad2
+MISC ChangeLog 11691 RMD160 5b7b1a0d12caed26cab5b0223bf42d29bec69fd1 SHA1 456c266d3ab7846e2429004e47da98a579947934 SHA256 9e8bb5bd1e1498fce79c2f654694cf81218faead849634aa12d7fcc0ef5274af
MISC metadata.xml 316 RMD160 0d18a4fee930a899bcd1eeff6fc7fe4de491f71b SHA1 0643d12b32e383861623f4f257f9d5b1446a90da SHA256 d026b12ac11b38e175987871769588146cf0c587a1462559cd1581ae05aaa83d
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