summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkwm <kwm@058c260c-8361-11dd-a0ac-aa2bafec7d09>2013-12-01 22:30:03 +0800
committerkwm <kwm@058c260c-8361-11dd-a0ac-aa2bafec7d09>2013-12-01 22:30:03 +0800
commite1b77a9f0c0e576ef7884a350fcc8b59ace9ec91 (patch)
tree052df1eaeddb48d34011c3b36cd7e73697862f62
parentec568ca03766b06d983fc152fd12e6da0aac1c2c (diff)
downloadxorg-devel-ports-e1b77a9f0c0e576ef7884a350fcc8b59ace9ec91.tar
xorg-devel-ports-e1b77a9f0c0e576ef7884a350fcc8b59ace9ec91.tar.gz
xorg-devel-ports-e1b77a9f0c0e576ef7884a350fcc8b59ace9ec91.tar.bz2
xorg-devel-ports-e1b77a9f0c0e576ef7884a350fcc8b59ace9ec91.tar.lz
xorg-devel-ports-e1b77a9f0c0e576ef7884a350fcc8b59ace9ec91.tar.xz
xorg-devel-ports-e1b77a9f0c0e576ef7884a350fcc8b59ace9ec91.tar.zst
xorg-devel-ports-e1b77a9f0c0e576ef7884a350fcc8b59ace9ec91.zip
Update devd backend to fix:
- Add another kludge, allowing keyboard attached to console work after relogin when using xdm or similar session manager - Remove setting of 'path' option, use attrs.device instead for NEW_XORG case - Enable xdriver == NULL check for NEW_XORG case - Properly add devd to config_backends While here unbreak stating as !root Submitted by: ak@ git-svn-id: https://trillian.chruetertee.ch/svn/ports/trunk@1277 058c260c-8361-11dd-a0ac-aa2bafec7d09
-rw-r--r--x11-servers/xorg-server/Makefile15
-rw-r--r--x11-servers/xorg-server/files/extra-devd (renamed from x11-servers/xorg-server/files/extra-config_devd.c)81
2 files changed, 74 insertions, 22 deletions
diff --git a/x11-servers/xorg-server/Makefile b/x11-servers/xorg-server/Makefile
index 698ef95..859929e 100644
--- a/x11-servers/xorg-server/Makefile
+++ b/x11-servers/xorg-server/Makefile
@@ -1,5 +1,5 @@
# Created by: Eric Anholt <anholt@FreeBSD.org>
-# $FreeBSD: head/x11-servers/xorg-server/Makefile 321157 2013-06-17 21:51:48Z jkim $
+# $FreeBSD$
PORTNAME?= xorg-server
PORTVERSION= ${XORG_VERSION}
@@ -95,7 +95,7 @@ CONFIGURE_ARGS+= --enable-config-hal=no
.endif
.if ${PORT_OPTIONS:MDEVD}
-EXTRA_PATCHES+= ${FILESDIR}/extra-config_devd.c
+EXTRA_PATCHES+= ${FILESDIR}/extra-devd
.endif
.if ${PORT_OPTIONS:MAIGLX}
@@ -104,11 +104,12 @@ CONFIGURE_ARGS+= --enable-aiglx=yes
CONFIGURE_ARGS+= --enable-aiglx=no
.endif
+# We handle Xorg setuid in the plist. This allows to build xorg-server as
+# a user.
+CONFIGURE_ARGS+=--enable-install-setuid=no
.if ${PORT_OPTIONS:MSUID}
-CONFIGURE_ARGS+=--enable-install-setuid=yes
PLIST_SUB+= SUID=""
.else
-CONFIGURE_ARGS+=--enable-install-setuid=no
PLIST_SUB+= SUID="@comment"
.endif
@@ -174,16 +175,14 @@ post-patch:
@${REINPLACE_CMD} -e 's|@GLX_TRUE@GLXMODS =|@GLX_BOGUS@GLXMODS =|g' \
-e 's|^LTLIBRARIES = |LTLIBRARIES = libglx.la |g' \
${WRKSRC}/hw/xfree86/dixmods/Makefile.in
-.if ${PORT_OPTIONS:MDEVD}
- @${ECHO_CMD} -e "\nint config_devd_init(void);\nvoid config_devd_fini(void);" \
- >> ${WRKSRC}/config/config-backends.h
-.endif
post-configure:
.if ${PORT_OPTIONS:MDEVD}
@${REINPLACE_CMD} -e 's|config\.c|config.c devd.c|g' \
-e 's|config\.lo|config.lo devd.lo|g' \
${WRKSRC}/config/Makefile
+ @${REINPLACE_CMD} -e 's|^/\* #undef CONFIG_UDEV \*/|#define CONFIG_DEVD 1|' \
+ ${WRKSRC}/include/dix-config.h
.endif
.if ${SLAVE_PORT} == "no"
diff --git a/x11-servers/xorg-server/files/extra-config_devd.c b/x11-servers/xorg-server/files/extra-devd
index f1deff2..6e23d03 100644
--- a/x11-servers/xorg-server/files/extra-config_devd.c
+++ b/x11-servers/xorg-server/files/extra-devd
@@ -1,5 +1,5 @@
Index: config/devd.c
-@@ -0,0 +1,476 @@
+@@ -0,0 +1,487 @@
+/*
+ * Copyright © 2012 Baptiste Daroussin
+ *
@@ -35,6 +35,7 @@ Index: config/devd.c
+#include <sys/un.h>
+
+#include <ctype.h>
++#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
@@ -200,6 +201,7 @@ Index: config/devd.c
+#endif
+ DeviceIntPtr dev = NULL;
+ int i, rc;
++ int fd;
+
+ walk = strchr(line, ' ');
+ if (walk != NULL)
@@ -219,13 +221,10 @@ Index: config/devd.c
+ LogMessageVerb(X_INFO, 10, "config/devd: ignoring device %s\n", line);
+ return;
+ }
-+
-+#if XORG_VERSION_CURRENT < 10800000
+ if (hw_types[i].xdriver == NULL) {
+ LogMessageVerb(X_INFO, 10, "config/devd: ignoring device %s\n", line);
+ return;
+ }
-+#endif
+ if (asprintf(&path, "/dev/%s", line) == -1)
+ return;
+
@@ -258,16 +257,28 @@ Index: config/devd.c
+ walk[0] = '\0';
+#if XORG_VERSION_CURRENT > 10800000
+ attrs.product = strdup(product != NULL ? product : "(unnamed)");
-+ options = input_option_new(options, "name", product != NULL ? product : "(unnamed)");
++ options = input_option_new(options, "name", product != NULL ? product : "(unnamed)");
+#else
+ add_option(&options, "name", product != NULL ? product : "(unnamed)");
+#endif
+ }
+#if XORG_VERSION_CURRENT > 10800000
+ attrs.usb_id = NULL;
-+ options = input_option_new(options, "path", path);
-+ options = input_option_new(options, "device", path);
++ attrs.device = strdup(path);
+ options = input_option_new(options, "driver", hw_types[i].xdriver);
++ if (attrs.flags & ATTR_KEYBOARD) {
++ /*
++ * Don't pass device option if keyboard is attached to console (open fails),
++ * thus activating special logic in xf86-input-keyboard.
++ */
++ fd = open(path, O_RDONLY | O_NONBLOCK | O_EXCL);
++ if (fd > 0) {
++ close(fd);
++ options = input_option_new(options, "device", path);
++ }
++ } else {
++ options = input_option_new(options, "device", path);
++ }
+#else
+ add_option(&options, "path", path);
+ add_option(&options, "device", path);
@@ -477,20 +488,62 @@ Index: config/devd.c
+ close(sock_devd);
+}
Index: config/config.c
-@@ -56,6 +56,8 @@
+@@ -55,6 +55,9 @@
+ #elif defined(CONFIG_WSCONS)
if (!config_wscons_init())
ErrorF("[config] failed to initialise wscons\n");
++#elif defined(CONFIG_DEVD)
++ if (!config_devd_init())
++ ErrorF("[config] failed to initialise devd\n");
#endif
-+ if (!config_devd_init())
-+ ErrorF("[config] failed to initialise devd\n");
}
- void
-@@ -74,6 +76,7 @@
+@@ -73,6 +76,8 @@
+ config_dbus_core_fini();
#elif defined(CONFIG_WSCONS)
config_wscons_fini();
++#elif defined(CONFIG_DEVD)
++ config_devd_fini();
#endif
-+ config_devd_fini();
}
- static void
+Index: config/config-backends.h
+@@ -73,3 +73,8 @@
+ int config_wscons_init(void);
+ void config_wscons_fini(void);
+ #endif
++
++#ifdef CONFIG_DEVD
++int config_devd_init(void);
++void config_devd_fini(void);
++#endif
+Index: hw/xfree86/common/xf86Globals.c
+@@ -122,7 +122,8 @@
+ .log = LogNone,
+ .disableRandR = FALSE,
+ .randRFrom = X_DEFAULT,
+-#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
++#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) || \
++ defined(CONFIG_DEVD)
+ .forceInputDevices = FALSE,
+ .autoAddDevices = TRUE,
+ .autoEnableDevices = TRUE
+Index: hw/xfree86/common/xf86Config.c
+@@ -1371,13 +1371,16 @@
+ }
+
+ if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) {
+-#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
++#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) || \
++ defined(CONFIG_DEVD)
+ const char *config_backend;
+
+ #if defined(CONFIG_HAL)
+ config_backend = "HAL";
+ #elif defined(CONFIG_UDEV)
+ config_backend = "udev";
++#elif defined(CONFIG_DEVD)
++ config_backend = "devd";
+ #else
+ config_backend = "wscons";
+ #endif