View | Details | Raw Unified | Return to bug 196678 | Differences between
and this patch

Collapse All | Expand All

(-)Mk/bsd.xorg.mk (-9 / +11 lines)
Lines 58-69 Link Here
58
. endif
58
. endif
59
59
60
. if ${XORG_CAT} == "driver"
60
. if ${XORG_CAT} == "driver"
61
USE_XORG+=	xorg-server xproto randrproto xi renderproto xextproto \
61
USE_XORG+=	dri2proto dri3proto fontsproto glproto inputproto kbproto \
62
		inputproto kbproto fontsproto videoproto dri2proto dri3proto \
62
			presentproto randrproto renderproto resourceproto \
63
		xf86driproto presentproto glproto xineramaproto resourceproto \
63
			scrnsaverproto videoproto xextproto xf86driproto xi \
64
		scrnsaverproto
64
			xineramaproto xorg-server xproto
65
CONFIGURE_ENV+=	DRIVER_MAN_SUFFIX=4x DRIVER_MAN_DIR='$$(mandir)/man4'
65
CONFIGURE_ENV+=	DRIVER_MAN_SUFFIX=4x DRIVER_MAN_DIR='$$(mandir)/man4'
66
USES+=		libtool
66
CFLAGS+=		-Werror=uninitialized
67
USES+=			libtool
67
INSTALL_TARGET=	install-strip
68
INSTALL_TARGET=	install-strip
68
. endif
69
. endif
69
70
Lines 81-87 Link Here
81
.  endif
82
.  endif
82
83
83
. if ${XORG_CAT} == "lib"
84
. if ${XORG_CAT} == "lib"
84
USES+=		pathfix libtool
85
USES+=			libtool pathfix
85
USE_LDCONFIG=	yes
86
USE_LDCONFIG=	yes
87
CFLAGS+=		-Werror=uninitialized
86
CONFIGURE_ARGS+=--enable-malloc0returnsnull
88
CONFIGURE_ARGS+=--enable-malloc0returnsnull
87
. endif
89
. endif
Lines 93-102 Link Here
93
. if ${XORG_CAT} == "xserver"
95
. if ${XORG_CAT} == "xserver"
94
DISTFILES?=	xorg-server-${PORTVERSION}.tar.bz2
96
DISTFILES?=	xorg-server-${PORTVERSION}.tar.bz2
95
WRKSRC=		${WRKDIR}/xorg-server-${PORTVERSION}
97
WRKSRC=		${WRKDIR}/xorg-server-${PORTVERSION}
96
USES+=	pathfix
98
USES+=		libtool pathfix
99
CFLAGS+=	-Werror=uninitialized
97
CONFIGURE_ARGS+=	--with-xkb-path=${LOCALBASE}/share/X11/xkb \
100
CONFIGURE_ARGS+=	--with-xkb-path=${LOCALBASE}/share/X11/xkb \
98
					--with-fontrootdir=${LOCALBASE}/share/fonts
101
					--with-fontrootdir=${LOCALBASE}/share/fonts
99
100
LIB_PC_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/dri
102
LIB_PC_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/dri
101
USE_XORG+=	fontutil:build
103
USE_XORG+=	fontutil:build
102
. endif
104
. endif
Lines 112-118 Link Here
112
# Register all xorg .pc files here.
114
# Register all xorg .pc files here.
113
# foo_LIB_PC_DEPENDS means it should go to BUILD_DEPENDS *and* RUN_DEPENDS.
115
# foo_LIB_PC_DEPENDS means it should go to BUILD_DEPENDS *and* RUN_DEPENDS.
114
116
115
XORG_MODULES=			bigreqsproto \
117
XORG_MODULES=	bigreqsproto \
116
				compositeproto \
118
				compositeproto \
117
				damageproto \
119
				damageproto \
118
				dmx \
120
				dmx \
(-)x11-servers/xephyr/Makefile (-2 lines)
Lines 16-23 Link Here
16
DESCR=		${.CURDIR}/pkg-descr
16
DESCR=		${.CURDIR}/pkg-descr
17
17
18
SLAVE_PORT=	yes
18
SLAVE_PORT=	yes
19
OPTIONS_EXCLUDE=DEVD HAL SUID
20
21
USE_XORG=	x11 xcb
19
USE_XORG=	x11 xcb
22
20
23
CONFIGURE_ARGS+=--enable-xephyr --disable-dmx --disable-xnest --disable-xvfb \
21
CONFIGURE_ARGS+=--enable-xephyr --disable-dmx --disable-xnest --disable-xvfb \
(-)x11-servers/xorg-dmx/Makefile (-2 lines)
Lines 11-18 Link Here
11
DESCR=		${.CURDIR}/pkg-descr
11
DESCR=		${.CURDIR}/pkg-descr
12
12
13
SLAVE_PORT=	yes
13
SLAVE_PORT=	yes
14
OPTIONS_EXCLUDE=DEVD HAL SUID
15
16
USE_XORG=	dmx dmxproto x11 xaw7 xext xfixes xi xmu xpm xrender xres xt xtst
14
USE_XORG=	dmx dmxproto x11 xaw7 xext xfixes xi xmu xpm xrender xres xt xtst
17
15
18
CONFIGURE_ARGS+=--enable-dmx --disable-xephyr --disable-xnest --disable-xvfb \
16
CONFIGURE_ARGS+=--enable-dmx --disable-xephyr --disable-xnest --disable-xvfb \
(-)x11-servers/xorg-nestserver/Makefile (-6 / +1 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	xorg-nestserver
4
PORTNAME=	xorg-nestserver
5
PORTVERSION=	1.19.1
6
PORTEPOCH=	2
5
PORTEPOCH=	2
7
6
8
COMMENT=	Nesting X server from X.Org
7
COMMENT=	Nesting X server from X.Org
Lines 11-26 Link Here
11
10
12
MASTERDIR=	${.CURDIR}/../xorg-server
11
MASTERDIR=	${.CURDIR}/../xorg-server
13
DESCR=		${.CURDIR}/pkg-descr
12
DESCR=		${.CURDIR}/pkg-descr
14
DISTINFO_FILE=	${.CURDIR}/distinfo
15
PATCHDIR=	${.CURDIR}/files
16
13
17
RUN_DEPENDS=	xkeyboard-config>=2.5:x11/xkeyboard-config
14
RUN_DEPENDS=	xkeyboard-config>=2.5:x11/xkeyboard-config
18
15
19
SLAVE_PORT=	yes
16
SLAVE_PORT=	yes
20
OPTIONS_EXCLUDE=DEVD HAL SUID
17
USE_XORG=	x11 xext
21
18
22
USE_XORG=	x11 xext xfont2
23
24
CONFIGURE_ARGS+=--enable-xnest --disable-dmx --disable-xephyr --disable-xvfb \
19
CONFIGURE_ARGS+=--enable-xnest --disable-dmx --disable-xephyr --disable-xvfb \
25
		--disable-xwayland
20
		--disable-xwayland
26
21
(-)x11-servers/xorg-nestserver/distinfo (-3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1484388904
2
SHA256 (xorg/xserver/xorg-server-1.19.1.tar.bz2) = 79ae2cf39d3f6c4a91201d8dad549d1d774b3420073c5a70d390040aa965a7fb
3
SIZE (xorg/xserver/xorg-server-1.19.1.tar.bz2) = 6041792
(-)x11-servers/xorg-server/Makefile (-51 / +27 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME?=	xorg-server
4
PORTNAME?=	xorg-server
5
PORTVERSION?=	1.18.4
5
PORTVERSION?=	1.19.3
6
PORTREVISION?=	0
6
PORTREVISION?=	0
7
PORTEPOCH?=	1
7
PORTEPOCH?=	1
8
CATEGORIES=	x11-servers
8
CATEGORIES=	x11-servers
Lines 23-39 Link Here
23
OPTIONS_SUB=	yes
23
OPTIONS_SUB=	yes
24
OPTIONS_DEFINE=	SUID
24
OPTIONS_DEFINE=	SUID
25
OPTIONS_RADIO=	CONF
25
OPTIONS_RADIO=	CONF
26
OPTIONS_RADIO_CONF=	DEVD HAL
26
OPTIONS_RADIO_CONF=	DEVD HAL UDEV
27
DEVD_DESC=	Use devd for autoconfiguration of input devices
27
OPTIONS_DEFAULT=	DEVD SUID
28
HAL_DESC=	Use hald for autoconfiguration of input devices
29
SUID_DESC=	Install the Xorg server with setuid bit set
30
OPTIONS_DEFAULT=DEVD SUID
31
28
29
SUID_DESC=	Install setuid wrapper to allow startx as non-root
30
CONF_DESC=	Backend to use for input device configuration
31
DEVD_DESC=	Use devd (native)
32
HAL_DESC=	Use HAL (deprecated)
33
UDEV_DESC=	Use udev via libudev-devd (experimental)
34
32
OPTIONS_EXCLUDE_sparc64=	HAL
35
OPTIONS_EXCLUDE_sparc64=	HAL
33
36
34
.include <bsd.port.options.mk>
37
DEVD_CONFIGURE_ENABLE=	config-devd
38
HAL_CONFIGURE_ENABLE=	config-hal
39
HAL_LIB_DEPENDS=	libhal.so:sysutils/hal \
40
			libdbus-1.so:devel/dbus
41
SUID_CONFIGURE_ENABLE=	suid-wrapper
42
SUID_CONFIGURE_ON=	--libexecdir=${PREFIX}/bin	# set SUID_WRAPPER_DIR
43
UDEV_CONFIGURE_ENABLE=	config-udev
44
UDEV_CONFIGURE_ON=	--disable-config-udev-kms
45
UDEV_LIB_DEPENDS=	libudev.so:devel/libudev-devd
35
46
36
USES=		gmake libtool perl5 ssl tar:bzip2
47
USES=		gmake perl5 ssl
37
USE_PERL5=	build
48
USE_PERL5=	build
38
USE_GL+=	gl
49
USE_GL+=	gl
39
USE_XORG+=	bigreqsproto compositeproto damageproto dri2proto dri3proto \
50
USE_XORG+=	bigreqsproto compositeproto damageproto dri2proto dri3proto \
Lines 40-51 Link Here
40
		fixesproto fontsproto glproto inputproto kbproto pixman \
51
		fixesproto fontsproto glproto inputproto kbproto pixman \
41
		presentproto randrproto recordproto renderproto \
52
		presentproto randrproto recordproto renderproto \
42
		resourceproto scrnsaverproto videoproto xau \
53
		resourceproto scrnsaverproto videoproto xau \
43
		xcmiscproto xdmcp xextproto xf86driproto xfont \
54
		xcmiscproto xdmcp xextproto xf86driproto xfont2 \
44
		xineramaproto xkbfile xproto xshmfence xtrans
55
		xineramaproto xkbfile xproto xshmfence xtrans
45
CONFIGURE_ARGS+=--without-doxygen --without-xmlto --without-fop \
56
CONFIGURE_ARGS+=--without-doxygen --without-xmlto --without-fop \
46
		--localstatedir=/var --with-shared-memory-dir=/tmp \
57
		--without-dtrace --with-shared-memory-dir=/tmp \
47
		--disable-config-udev --disable-config-udev-kms \
58
		--disable-install-setuid
48
		--without-dtrace --enable-glamor
49
INSTALL_TARGET=	install-strip
59
INSTALL_TARGET=	install-strip
50
60
51
.if ${SLAVE_PORT} == "no" || ${PORTNAME} == "xephyr" || ${PORTNAME} == "xwayland"
61
.if ${SLAVE_PORT} == "no" || ${PORTNAME} == "xephyr" || ${PORTNAME} == "xwayland"
Lines 62-70 Link Here
62
		--disable-xwayland
72
		--disable-xwayland
63
SUB_FILES=	pkg-install pkg-deinstall
73
SUB_FILES=	pkg-install pkg-deinstall
64
.else
74
.else
65
CONFIGURE_ARGS+=--disable-xorg
75
CONFIGURE_ARGS+=	--disable-xorg
66
# for slave ports we need to overwrite PLIST, so it doesn't overwrite
76
OPTIONS_EXCLUDE=	DEVD HAL UDEV SUID
67
# PLIST_FILES, with the masterport plist.
77
# Set PLIST for slave ports so they only need to set PLIST_FILES
68
PLIST=		${.CURDIR}/pkg-plist
78
PLIST=		${.CURDIR}/pkg-plist
69
.endif
79
.endif
70
80
Lines 77-92 Link Here
77
CONFIGURE_ENV=	SHA1_LIB="-L/usr/lib -lcrypto" SHA1_CFLAGS="-I/usr/include"
87
CONFIGURE_ENV=	SHA1_LIB="-L/usr/lib -lcrypto" SHA1_CFLAGS="-I/usr/include"
78
.endif
88
.endif
79
89
80
.if ${PORT_OPTIONS:MHAL}
81
LIB_DEPENDS+=	libhal.so:sysutils/hal
82
CONFIGURE_ARGS+=	--enable-config-hal
83
.else
84
CONFIGURE_ARGS+=	--disable-config-hal
85
.endif
86
87
# We handle Xorg setuid in the plist. This allows to build xorg-server as a user.
88
CONFIGURE_ARGS+=--disable-install-setuid
89
90
.if ${ARCH} == "i386" || ${ARCH} == "amd64"
90
.if ${ARCH} == "i386" || ${ARCH} == "amd64"
91
LIB_DEPENDS+=	libunwind.so:devel/libunwind
91
LIB_DEPENDS+=	libunwind.so:devel/libunwind
92
.endif
92
.endif
Lines 97-135 Link Here
97
PLIST_SUB+=	SPARC64="@comment "
97
PLIST_SUB+=	SPARC64="@comment "
98
.endif
98
.endif
99
99
100
.if ${PORT_OPTIONS:MSUID}
101
pre-everything::
102
	@${ECHO_MSG} "By default, the X Server installs as a set-user-id root binary. When run by"
103
	@${ECHO_MSG} "a normal user, it checks arguments and environment as done in the x11/wrapper"
104
	@${ECHO_MSG} "port before handling them normally.  If you are concerned about the security"
105
	@${ECHO_MSG} "of this, but still want to run an X Server (for example using xdm/kdm/gdm,"
106
	@${ECHO_MSG} "which will still run the server as root), you can cancel the build and set"
107
	@${ECHO_MSG} "xorg-server_UNSET=SUID in /etc/make.conf."
108
.endif
109
110
post-patch:
100
post-patch:
111
	@${REINPLACE_CMD} 's/test.*-traditional.*;/true;/' \
101
	@${REINPLACE_CMD} 's/test.*-traditional.*;/true;/' \
112
		${WRKSRC}/configure
102
		${WRKSRC}/configure
113
# build libglx.so but don't install it yet. which is done in pre-install.
114
	@${REINPLACE_CMD} -e 's|@GLX_TRUE@GLXMODS =|@GLX_BOGUS@GLXMODS =|g' \
115
		-e 's|^LTLIBRARIES = |LTLIBRARIES = libglx.la |g' \
116
		${WRKSRC}/hw/xfree86/dixmods/Makefile.in
117
103
118
post-configure:
119
.if ${PORT_OPTIONS:MDEVD}
120
	@${REINPLACE_CMD} -e 's|config\.c|config.c devd.c|g' \
121
		-e 's|config\.lo|config.lo devd.lo|g' \
122
		${WRKSRC}/config/Makefile
123
	@${REINPLACE_CMD} -e 's|^/\* #undef CONFIG_UDEV \*/|#define CONFIG_DEVD 1|' \
124
		${WRKSRC}/include/dix-config.h
125
.endif
126
127
.if ${SLAVE_PORT} == "no"
104
.if ${SLAVE_PORT} == "no"
128
post-install:
105
post-install:
129
# The .xorg dir because else the xorg-server might not load the correct
106
# Avoid conflict with nvidia-driver, move libglx.so into .xorg directory
130
# libglx module.
131
	@${MKDIR} ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg
107
	@${MKDIR} ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg
132
	${INSTALL_LIB} ${WRKSRC}/hw/xfree86/dixmods/.libs/libglx.so \
108
	${MV} ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/libglx.so \
133
		${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg/
109
		${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg/
134
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d
110
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d
135
.endif # ! SLAVE_PORT
111
.endif # ! SLAVE_PORT
(-)x11-servers/xorg-server/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1484803304
1
TIMESTAMP = 1489641765
2
SHA256 (xorg/xserver/xorg-server-1.18.4.tar.bz2) = 278459b2c31d61a15655d95a72fb79930c480a6bb8cf9226e48a07df8b1d31c8
2
SHA256 (xorg/xserver/xorg-server-1.19.3.tar.bz2) = 677a8166e03474719238dfe396ce673c4234735464d6dadf2959b600d20e5a98
3
SIZE (xorg/xserver/xorg-server-1.18.4.tar.bz2) = 6009508
3
SIZE (xorg/xserver/xorg-server-1.19.3.tar.bz2) = 6050221
(-)x11-servers/xorg-server/files/config_Makefile.am (+16 lines)
Line 0 Link Here
1
* Build the devd config backend if activated
2
*
3
--- config/Makefile.am.orig	2017-03-16 05:24:43 UTC
4
+++ config/Makefile.am
5
@@ -4,6 +4,11 @@ noinst_LTLIBRARIES = libconfig.la
6
 libconfig_la_SOURCES = config.c config-backends.h
7
 libconfig_la_LIBADD =
8
 
9
+if CONFIG_DEVD
10
+libconfig_la_SOURCES += devd.c
11
+libconfig_la_LIBADD += -lusbhid
12
+endif
13
+
14
 if NEED_DBUS
15
 AM_CFLAGS += $(DBUS_CFLAGS)
16
 libconfig_la_SOURCES += dbus-core.c
(-)x11-servers/xorg-server/files/configure.ac (+97 lines)
Line 0 Link Here
1
* Plumb the devd config backend into configure
2
*
3
* define USE_DEV_IO for ARM platforms
4
*
5
* Only run pkg-config for udev if it is not disabled to prevent over-linking
6
*
7
* Automatically use systemd/logind only on Linux
8
*
9
--- configure.ac.orig	2017-03-15 18:05:25 UTC
10
+++ configure.ac
11
@@ -328,9 +328,12 @@ case $host_cpu in
12
 	esac
13
 	GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee"
14
 	;;
15
-  arm*)
16
+  arm*|aarch64*)
17
 	ARM_VIDEO=yes
18
 	DEFAULT_INT10="stub"
19
+	case $host_os in
20
+		*freebsd*)	AC_DEFINE(USE_DEV_IO) ;;
21
+	esac
22
 	;;
23
   i*86)
24
 	I386_VIDEO=yes
25
@@ -628,6 +631,7 @@ AC_ARG_ENABLE(tslib,          AS_HELP_ST
26
 AC_ARG_ENABLE(dbe,            AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes])
27
 AC_ARG_ENABLE(xf86bigfont,    AS_HELP_STRING([--enable-xf86bigfont], [Build XF86 Big Font extension (default: disabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=no])
28
 AC_ARG_ENABLE(dpms,           AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
29
+AC_ARG_ENABLE(config-devd,    AS_HELP_STRING([--enable-config-devd], [Build devd support (default: auto)]), [CONFIG_DEVD=$enableval], [CONFIG_DEVD=auto])
30
 AC_ARG_ENABLE(config-udev,    AS_HELP_STRING([--enable-config-udev], [Build udev support (default: auto)]), [CONFIG_UDEV=$enableval], [CONFIG_UDEV=auto])
31
 AC_ARG_ENABLE(config-udev-kms,    AS_HELP_STRING([--enable-config-udev-kms], [Build udev kms support (default: auto)]), [CONFIG_UDEV_KMS=$enableval], [CONFIG_UDEV_KMS=auto])
32
 AC_ARG_ENABLE(config-hal,     AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto])
33
@@ -924,10 +928,27 @@ if test "x$CONFIG_UDEV" = xyes && test "
34
 	AC_MSG_ERROR([Hotplugging through both libudev and hal not allowed])
35
 fi
36
 
37
-PKG_CHECK_MODULES(UDEV, $LIBUDEV, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no])
38
-if test "x$CONFIG_UDEV" = xauto; then
39
-	CONFIG_UDEV="$HAVE_LIBUDEV"
40
-	AC_DEFINE(HAVE_LIBUDEV, 1, [Define to 1 if libudev is available.])
41
+if test "x$CONFIG_DEVD" = xauto; then
42
+	case $host_os in
43
+		*freebsd*)
44
+			CONFIG_DEVD=yes
45
+			;;
46
+		*)
47
+			CONFIG_DEVD=no
48
+			;;
49
+	esac
50
+fi
51
+AM_CONDITIONAL(CONFIG_DEVD, [test "x$CONFIG_DEVD" = xyes])
52
+if test "x$CONFIG_DEVD" = xyes; then
53
+	AC_DEFINE(CONFIG_DEVD, 1, [Use devd for input auto configuration])
54
+fi
55
+
56
+if test "x$CONFIG_UDEV" != xno; then
57
+	PKG_CHECK_MODULES(UDEV, $LIBUDEV, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no])
58
+	if test "x$CONFIG_UDEV" = xauto; then
59
+		CONFIG_UDEV="$HAVE_LIBUDEV"
60
+		AC_DEFINE(HAVE_LIBUDEV, 1, [Define to 1 if libudev is available.])
61
+	fi
62
 fi
63
 AM_CONDITIONAL(CONFIG_UDEV, [test "x$CONFIG_UDEV" = xyes])
64
 if test "x$CONFIG_UDEV" = xyes; then
65
@@ -975,7 +996,14 @@ AM_CONDITIONAL(CONFIG_HAL, [test "x$CONF
66
 
67
 if test "x$SYSTEMD_LOGIND" = xauto; then
68
         if test "x$HAVE_DBUS" = xyes -a "x$CONFIG_UDEV" = xyes ; then
69
-                SYSTEMD_LOGIND=yes
70
+            case $host_os in
71
+                *linux*)
72
+                        SYSTEMD_LOGIND=yes
73
+                        ;;
74
+                *)
75
+                        SYSTEMD_LOGIND=no
76
+                        ;;
77
+            esac
78
         else
79
                 SYSTEMD_LOGIND=no
80
         fi
81
@@ -2570,12 +2598,12 @@ AC_SUBST([prefix])
82
 
83
 AC_CONFIG_COMMANDS([sdksyms], [touch hw/xfree86/sdksyms.dep])
84
 
85
-if test "x$CONFIG_HAL" = xno && test "x$CONFIG_UDEV" = xno; then
86
+if test "x$CONFIG_HAL" = xno && test "x$CONFIG_UDEV" = xno && test "x$CONFIG_DEVD" = xno; then
87
     AC_MSG_WARN([
88
-             ***********************************************
89
-             Neither HAL nor udev backend will be enabled.
90
+             *****************************************************
91
+             Neither HAL, devd, nor udev backend will be enabled.
92
              Input device hotplugging will not be available!
93
-             ***********************************************])
94
+             *****************************************************])
95
 fi
96
 
97
 AC_CONFIG_FILES([
(-)x11-servers/xorg-server/files/hw_xfree86_Makefile.am (+14 lines)
Line 0 Link Here
1
* Don't overwrite Xorg binary with Xorg.sh when SUID_WRAPPER_DIR == bindir
2
* Instead, relink bin/X to Xorg.wrap rather than to Xorg (which isn't Xorg.sh)
3
*
4
--- hw/xfree86/Makefile.am.orig	2017-03-16 05:24:43 UTC
5
+++ hw/xfree86/Makefile.am
6
@@ -109,7 +109,7 @@ endif
7
 if SUID_WRAPPER
8
 	$(MKDIR_P) $(DESTDIR)$(SUID_WRAPPER_DIR)
9
 	mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg
10
-	${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg
11
+	(test ! -f $(DESTDIR)$(bindir)/Xorg && ${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg || cd $(DESTDIR)$(bindir) && rm -f X && $(LN_S) Xorg.wrap$(EXEEXT) X)
12
 	-chown root $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap
13
 endif
14
 
(-)x11-servers/xorg-server/files/patch-config_Makefile.in (+91 lines)
Line 0 Link Here
1
* generated from patched Makefile.am; revise and regen instead of editing
2
*
3
* Build the devd config backend if activated
4
*
5
--- config/Makefile.in.orig	2017-03-16 05:24:43 UTC
6
+++ config/Makefile.in
7
@@ -89,16 +89,18 @@ PRE_UNINSTALL = :
8
 POST_UNINSTALL = :
9
 build_triplet = @build@
10
 host_triplet = @host@
11
-@NEED_DBUS_TRUE@am__append_1 = $(DBUS_CFLAGS)
12
-@NEED_DBUS_TRUE@am__append_2 = dbus-core.c
13
-@NEED_DBUS_TRUE@am__append_3 = $(DBUS_LIBS)
14
-@CONFIG_UDEV_TRUE@am__append_4 = $(UDEV_CFLAGS)
15
-@CONFIG_UDEV_TRUE@am__append_5 = udev.c
16
-@CONFIG_UDEV_TRUE@am__append_6 = $(UDEV_LIBS)
17
-@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__append_7 = $(HAL_CFLAGS)
18
-@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__append_8 = hal.c
19
-@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__append_9 = $(HAL_LIBS)
20
-@CONFIG_HAL_FALSE@@CONFIG_UDEV_FALSE@@CONFIG_WSCONS_TRUE@am__append_10 = wscons.c
21
+@CONFIG_DEVD_TRUE@am__append_1 = devd.c
22
+@CONFIG_DEVD_TRUE@am__append_2 = -lusbhid
23
+@NEED_DBUS_TRUE@am__append_3 = $(DBUS_CFLAGS)
24
+@NEED_DBUS_TRUE@am__append_4 = dbus-core.c
25
+@NEED_DBUS_TRUE@am__append_5 = $(DBUS_LIBS)
26
+@CONFIG_UDEV_TRUE@am__append_6 = $(UDEV_CFLAGS)
27
+@CONFIG_UDEV_TRUE@am__append_7 = udev.c
28
+@CONFIG_UDEV_TRUE@am__append_8 = $(UDEV_LIBS)
29
+@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__append_9 = $(HAL_CFLAGS)
30
+@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__append_10 = hal.c
31
+@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__append_11 = $(HAL_LIBS)
32
+@CONFIG_HAL_FALSE@@CONFIG_UDEV_FALSE@@CONFIG_WSCONS_TRUE@am__append_12 = wscons.c
33
 subdir = config
34
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
35
 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
36
@@ -126,16 +128,18 @@ am__DEPENDENCIES_1 =
37
 @CONFIG_UDEV_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1)
38
 @CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__DEPENDENCIES_4 =  \
39
 @CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@	$(am__DEPENDENCIES_1)
40
-libconfig_la_DEPENDENCIES = $(am__DEPENDENCIES_2) \
41
-	$(am__DEPENDENCIES_3) $(am__DEPENDENCIES_4)
42
-am__libconfig_la_SOURCES_DIST = config.c config-backends.h dbus-core.c \
43
-	udev.c hal.c wscons.c
44
-@NEED_DBUS_TRUE@am__objects_1 = dbus-core.lo
45
-@CONFIG_UDEV_TRUE@am__objects_2 = udev.lo
46
-@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__objects_3 = hal.lo
47
-@CONFIG_HAL_FALSE@@CONFIG_UDEV_FALSE@@CONFIG_WSCONS_TRUE@am__objects_4 = wscons.lo
48
+libconfig_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
49
+	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
50
+	$(am__DEPENDENCIES_4)
51
+am__libconfig_la_SOURCES_DIST = config.c config-backends.h devd.c \
52
+	dbus-core.c udev.c hal.c wscons.c
53
+@CONFIG_DEVD_TRUE@am__objects_1 = devd.lo
54
+@NEED_DBUS_TRUE@am__objects_2 = dbus-core.lo
55
+@CONFIG_UDEV_TRUE@am__objects_3 = udev.lo
56
+@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__objects_4 = hal.lo
57
+@CONFIG_HAL_FALSE@@CONFIG_UDEV_FALSE@@CONFIG_WSCONS_TRUE@am__objects_5 = wscons.lo
58
 am_libconfig_la_OBJECTS = config.lo $(am__objects_1) $(am__objects_2) \
59
-	$(am__objects_3) $(am__objects_4)
60
+	$(am__objects_3) $(am__objects_4) $(am__objects_5)
61
 libconfig_la_OBJECTS = $(am_libconfig_la_OBJECTS)
62
 AM_V_lt = $(am__v_lt_@AM_V@)
63
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
64
@@ -586,12 +590,14 @@ target_alias = @target_alias@
65
 top_build_prefix = @top_build_prefix@
66
 top_builddir = @top_builddir@
67
 top_srcdir = @top_srcdir@
68
-AM_CFLAGS = $(DIX_CFLAGS) $(am__append_1) $(am__append_4) \
69
-	$(am__append_7)
70
+AM_CFLAGS = $(DIX_CFLAGS) $(am__append_3) $(am__append_6) \
71
+	$(am__append_9)
72
 noinst_LTLIBRARIES = libconfig.la
73
-libconfig_la_SOURCES = config.c config-backends.h $(am__append_2) \
74
-	$(am__append_5) $(am__append_8) $(am__append_10)
75
-libconfig_la_LIBADD = $(am__append_3) $(am__append_6) $(am__append_9)
76
+libconfig_la_SOURCES = config.c config-backends.h $(am__append_1) \
77
+	$(am__append_4) $(am__append_7) $(am__append_10) \
78
+	$(am__append_12)
79
+libconfig_la_LIBADD = $(am__append_2) $(am__append_5) $(am__append_8) \
80
+	$(am__append_11)
81
 @CONFIG_UDEV_TRUE@@XORG_TRUE@xorgconfddir = $(datadir)/X11/$(XF86CONFIGDIR)
82
 @CONFIG_UDEV_TRUE@@XORG_TRUE@xorgconfd_DATA = 10-quirks.conf
83
 EXTRA_DIST = x11-input.fdi fdi2iclass.py 10-quirks.conf
84
@@ -651,6 +657,7 @@ distclean-compile:
85
 
86
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Plo@am__quote@
87
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-core.Plo@am__quote@
88
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/devd.Plo@am__quote@
89
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hal.Plo@am__quote@
90
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/udev.Plo@am__quote@
91
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wscons.Plo@am__quote@
(-)x11-servers/xorg-server/files/patch-config_config-backends.h (-6 / +7 lines)
Lines 1-11 Link Here
1
--- config/config-backends.h.orig	2016-07-15 16:17:45 UTC
1
* Define required functions for devd config backend
2
*
3
--- config/config-backends.h.orig	2017-03-15 18:05:25 UTC
2
+++ config/config-backends.h
4
+++ config/config-backends.h
3
@@ -44,3 +44,8 @@ void config_hal_fini(void);
5
@@ -43,4 +43,7 @@ void config_hal_fini(void);
6
 #elif defined(CONFIG_WSCONS)
4
 int config_wscons_init(void);
7
 int config_wscons_init(void);
5
 void config_wscons_fini(void);
8
 void config_wscons_fini(void);
6
 #endif
9
+#elif defined(CONFIG_DEVD)
7
+
8
+#ifdef CONFIG_DEVD
9
+int config_devd_init(void);
10
+int config_devd_init(void);
10
+void config_devd_fini(void);
11
+void config_devd_fini(void);
11
+#endif
12
 #endif
(-)x11-servers/xorg-server/files/patch-config_config.c (-1 / +3 lines)
Lines 1-4 Link Here
1
--- config/config.c.orig	2016-07-19 17:07:29 UTC
1
* Call the devd config backend functions if activated
2
*
3
--- config/config.c.orig	2017-03-15 18:05:25 UTC
2
+++ config/config.c
4
+++ config/config.c
3
@@ -55,6 +55,9 @@ config_init(void)
5
@@ -55,6 +55,9 @@ config_init(void)
4
 #elif defined(CONFIG_WSCONS)
6
 #elif defined(CONFIG_WSCONS)
(-)x11-servers/xorg-server/files/patch-config_devd.c (-347 / +697 lines)
Lines 1-11 Link Here
1
--- config/devd.c.orig	2017-01-19 15:20:42 UTC
1
--- config/devd.c.orig	2017-03-16 05:24:43 UTC
2
+++ config/devd.c
2
+++ config/devd.c
3
@@ -0,0 +1,532 @@
3
@@ -0,0 +1,882 @@
4
+/*
4
+/*
5
+ * Copyright (c) 2012 Baptiste Daroussin
5
+ * Copyright (c) 2012 Baptiste Daroussin
6
+ * Copyright (c) 2013, 2014 Alex Kozlov
6
+ * Copyright (c) 2013, 2014 Alex Kozlov
7
+ * Copyright (c) 2014 Robert Millan
7
+ * Copyright (c) 2014 Robert Millan
8
+ * Copyright (c) 2014 Jean-Sebastien Pedron
8
+ * Copyright (c) 2014 Jean-Sebastien Pedron
9
+ * Copyright (c) 2015 Hans Petter Selasky
10
+ * Copyright (c) 2015-2017 Rozhuk Ivan
11
+ * Copyright (c) 2016, 2017 Vladimir Kondratyev
12
+ * Copyright (c) 2017 Matthew Rezny
9
+ *
13
+ *
10
+ * Permission is hereby granted, free of charge, to any person obtaining a
14
+ * Permission is hereby granted, free of charge, to any person obtaining a
11
+ * copy of this software and associated documentation files (the "Software"),
15
+ * copy of this software and associated documentation files (the "Software"),
Lines 39-46 Link Here
39
+#include <sys/stat.h>
43
+#include <sys/stat.h>
40
+#include <sys/sysctl.h>
44
+#include <sys/sysctl.h>
41
+#include <sys/un.h>
45
+#include <sys/un.h>
46
+#include <sys/mouse.h>
47
+#include <sys/consio.h>
48
+#include <sys/ioctl.h>
49
+#include <dev/usb/usb_ioctl.h>
50
+#include <dev/usb/usbhid.h>
42
+
51
+
43
+#include <ctype.h>
52
+#include <ctype.h>
53
+#include <dirent.h>
44
+#include <errno.h>
54
+#include <errno.h>
45
+#include <fcntl.h>
55
+#include <fcntl.h>
46
+#include <stdlib.h>
56
+#include <stdlib.h>
Lines 47-52 Link Here
47
+#include <stdio.h>
57
+#include <stdio.h>
48
+#include <stdbool.h>
58
+#include <stdbool.h>
49
+#include <unistd.h>
59
+#include <unistd.h>
60
+#include <string.h>
61
+#include <paths.h>
62
+#include <usbhid.h>
50
+
63
+
51
+#include "input.h"
64
+#include "input.h"
52
+#include "inputstr.h"
65
+#include "inputstr.h"
Lines 54-493 Link Here
54
+#include "config-backends.h"
67
+#include "config-backends.h"
55
+#include "os.h"
68
+#include "os.h"
56
+
69
+
57
+#define DEVD_SOCK_PATH "/var/run/devd.pipe"
70
+/* from: <linux/input.h> */
71
+#define	_IOC_READ   IOC_OUT
72
+struct input_id {
73
+	uint16_t bustype;
74
+	uint16_t vendor;
75
+	uint16_t product;
76
+	uint16_t version;
77
+};
58
+
78
+
79
+#define	EVIOCGBIT(ev, len)	_IOC(_IOC_READ, 'E', 0x20 + (ev), (len))
80
+#define	EVIOCGID		_IOR('E', 0x02, struct input_id)
81
+#define	EVIOCGNAME(len)		_IOC(_IOC_READ, 'E', 0x06, (len))
82
+#define	EVIOCGPHYS(len)		_IOC(_IOC_READ, 'E', 0x07, (len))
83
+
84
+#define	EV_KEY			0x01
85
+#define	EV_REL			0x02
86
+#define	EV_ABS			0x03
87
+#define	BTN_MISC		0x100
88
+#define	BTN_LEFT		0x110
89
+#define	BTN_RIGHT		0x111
90
+#define	BTN_MIDDLE		0x112
91
+#define	BTN_JOYSTICK		0x120
92
+#define	BTN_TOOL_PEN		0x140
93
+#define	BTN_TOOL_FINGER		0x145
94
+#define	BTN_TOUCH		0x14a
95
+#define	BTN_STYLUS		0x14b
96
+#define	BTN_STYLUS2		0x14c
97
+#define	KEY_MAX			0x2ff
98
+#define	KEY_CNT			(KEY_MAX + 1)
99
+#define	REL_X			0x00
100
+#define	REL_Y			0x01
101
+#define	REL_MAX			0x0f
102
+#define	REL_CNT			(REL_MAX + 1)
103
+#define	ABS_X			0x00
104
+#define	ABS_Y			0x01
105
+#define	ABS_PRESSURE		0x18
106
+#define	ABS_MT_SLOT		0x2f
107
+#define	ABS_MAX			0x3f
108
+#define	ABS_CNT			(ABS_MAX + 1)
109
+
110
+#define	ULONG_BITS		(sizeof(unsigned long) * 8)
111
+#define	ULONG_CNT(__x)		(((__x) + ULONG_BITS - 1) / ULONG_BITS)
112
+#define ULONG_IS_BIT_SET(__x, __bit) (((((const unsigned long*)(__x))[((__bit) >> 5)] >> ((__bit) & 0x1f))) & 0x01)
113
+
114
+/* from: <linux/joystick.h> */
115
+#define JSIOCGNAME(len)		_IOC(_IOC_READ, 'j', 0x13, len)		/* get identifier string */
116
+
117
+/* WebCamD specific. */
118
+#define WEBCAMD_IOCTL_GET_USB_VENDOR_ID _IOR('q', 250, unsigned short)
119
+#define WEBCAMD_IOCTL_GET_USB_PRODUCT_ID _IOR('q', 251, unsigned short)
120
+#define WEBCAMD_IOCTL_GET_USB_SPEED	_IOR('q', 252, unsigned int)
121
+
122
+#ifdef COMPAT_32BIT
123
+	#define hid_pass_ptr(ptr)	((uint64_t)(uintptr_t)(ptr))
124
+#else
125
+	#define hid_pass_ptr(ptr)	(ptr)
126
+#endif
127
+
128
+#define _PATH_DEV_LEN		(sizeof(_PATH_DEV) - 1)
129
+#define DEVD_PATH_DEV		"devd:" _PATH_DEV
130
+#define DEVD_PATH_DEV_LEN	(sizeof(DEVD_PATH_DEV) - 1)
131
+#define DEVD_PATH_LEN		(DEVD_PATH_DEV_LEN - _PATH_DEV_LEN)
132
+
133
+#define DEVD_SOCK_PATH		_PATH_VARRUN "devd.pipe"
134
+
59
+#define DEVD_EVENT_ADD		'+'
135
+#define DEVD_EVENT_ADD		'+'
60
+#define DEVD_EVENT_REMOVE	'-'
136
+#define DEVD_EVENT_REMOVE	'-'
137
+#define DEVD_EVENT_NOTIFY	'!'
61
+
138
+
62
+#define RECONNECT_DELAY		5 * 1000
139
+#define RECONNECT_DELAY	(5 * 1000)
63
+
140
+
64
+static int sock_devd;
141
+#define is_meuqual(__v1, __v1sz, __v2, __v2sz)				\
65
+static bool is_console_kbd = false;
142
+	((__v1sz) == (__v2sz) && NULL != (__v1) && NULL != (__v2) &&	\
66
+static bool is_kbdmux = false;
143
+	 0 == memcmp((__v1), (__v2), (__v1sz)))
144
+
145
+#define is_meuqual_cstr(__cstr, __v, __vsz)				\
146
+	is_meuqual(__cstr, (sizeof(__cstr) - 1), __v, __vsz)
147
+
148
+#define is_de_euqual_cstr(__de, __cstr)					\
149
+	(NULL != (__de) &&						\
150
+	 is_meuqual((__de)->d_name, (__de)->d_namlen, __cstr, (sizeof(__cstr) - 1)))
151
+
152
+#define devd_get_val_cstr(__cstr, __buf, __bufsz, __valsz)		\
153
+	devd_get_val((__buf), (__bufsz), __cstr, (sizeof(__cstr) - 1),	\
154
+	(__valsz))
155
+
156
+static int devd_skt = 0;
157
+static char devd_buf[4096];
158
+static size_t devd_buf_used = 0;
159
+static int is_kbdmux = 0;
67
+static OsTimerPtr rtimer = NULL;
160
+static OsTimerPtr rtimer = NULL;
68
+
161
+
69
+struct hw_type {
162
+/* Input devices. */
70
+	const char *driver;
163
+typedef struct hw_type_s {
71
+	int flag;
164
+	const char	*dev_name;
72
+	const char *xdriver;
165
+	size_t		dev_name_size;
166
+	size_t		path_offset;
167
+	int		flags;
168
+	const char	*xdriver; 
169
+} hw_type_t, *hw_type_p;
170
+
171
+/* xdriver can be set via config "InputClass" section.
172
+ * Do not set xdriver name if device have more than one
173
+ * xf86-input-* drivers.
174
+ * "input/event" can be hadled by: xf86-input-evdev and
175
+ * xf86-input-wacom, let user choose.
176
+ */
177
+static hw_type_t hw_types[] = {
178
+	{ "uhid",	4, 0, 0, NULL },
179
+	{ "ukbd",	4, 0, ATTR_KEY | ATTR_KEYBOARD, "kbd" },
180
+	{ "atkbd",	5, 0, ATTR_KEY | ATTR_KEYBOARD, "kbd" },
181
+	{ "kbdmux",	6, 0, ATTR_KEY | ATTR_KEYBOARD, "kbd" },
182
+	{ "sysmouse",	8, 0, ATTR_POINTER, "mouse" },
183
+	{ "ums",	3, 0, ATTR_POINTER, "mouse" },
184
+	{ "psm",	3, 0, ATTR_POINTER, "mouse" },
185
+	{ "vboxguest",	9, 0, ATTR_POINTER, "vboxmouse" },
186
+	{ "joy",	3, 0, ATTR_JOYSTICK, NULL },
187
+	{ "atp",	3, 0, ATTR_TOUCHPAD, NULL },
188
+	{ "uep",	3, 0, ATTR_TOUCHSCREEN, NULL },
189
+	{ "input/event",5, 6, 0, NULL },
190
+	{ "input/js",	2, 6, ATTR_JOYSTICK, NULL },
191
+	{ NULL,		0, 0, 0, NULL },
73
+};
192
+};
74
+
193
+
75
+static struct hw_type hw_types[] = {
194
+/* Input devices paths. */
76
+	{ "ukbd", ATTR_KEYBOARD, "kbd" },
195
+static hw_type_t hw_type_path[] = {
77
+	{ "atkbd", ATTR_KEYBOARD, "kbd" },
196
+	{ "input/",	0, 6, 0, NULL },
78
+	{ "kbdmux", ATTR_KEYBOARD, "kbd" },
197
+	{ NULL,		0, 0, 0, NULL },
79
+	{ "sysmouse", ATTR_POINTER, "mouse" },
80
+	{ "ums", ATTR_POINTER, "mouse" },
81
+	{ "psm", ATTR_POINTER, "mouse" },
82
+	{ "vboxguest", ATTR_POINTER, "vboxmouse" },
83
+	{ "joy", ATTR_JOYSTICK, NULL },
84
+	{ "atp", ATTR_TOUCHPAD, NULL },
85
+	{ "uep", ATTR_TOUCHSCREEN, NULL },
86
+	{ NULL, -1, NULL },
87
+};
198
+};
88
+
199
+
89
+static bool
200
+static size_t
90
+sysctl_exists(const struct hw_type *device, int unit,
201
+bits_calc(const unsigned long *bits, size_t off_start, size_t off_stop)
91
+	char *devname, size_t devname_len)
92
+{
202
+{
93
+	char sysctlname[PATH_MAX];
203
+	size_t count = 0;
94
+	size_t len;
95
+	int ret;
96
+
204
+
97
+	if (device == NULL || device->driver == NULL)
205
+	for (size_t i = off_start; i < off_stop; ++i) {
98
+		return false;
206
+		if (ULONG_IS_BIT_SET(bits, i)) {
207
+			++count;
208
+		}
209
+	}
210
+	return count;
211
+}
99
+
212
+
100
+	/* Check if a sysctl exists. */
213
+static hw_type_p
101
+	snprintf(sysctlname, sizeof(sysctlname), "dev.%s.%i.%%desc",
214
+get_dev_type_by_name(const char *dev_name, size_t dev_name_size)
102
+	    device->driver, unit);
215
+{
103
+	ret = sysctlbyname(sysctlname, NULL, &len, NULL, 0);
216
+	if (!dev_name || !dev_name_size)
217
+		return NULL;
104
+
218
+
105
+	if (ret == 0 && len > 0) {
219
+	for (size_t i = 0; hw_types[i].dev_name; ++i) {
106
+		snprintf(devname, devname_len, "%s%i", device->driver, unit);
220
+		if (dev_name_size >= (hw_types[i].dev_name_size + hw_types[i].path_offset) &&
107
+		return true;
221
+		    !memcmp(dev_name, hw_types[i].dev_name, (hw_types[i].path_offset + hw_types[i].dev_name_size))) {
222
+			return &hw_types[i];
223
+		}
108
+	}
224
+	}
225
+	return NULL;
226
+}
109
+
227
+
110
+	return false;
228
+static hw_type_p
229
+get_dev_type_by_path(const char *dev_name, size_t dev_name_size, hw_type_p hw_type_cust)
230
+{
231
+	if (!dev_name || !dev_name_size || !hw_type_cust)
232
+		return NULL;
233
+
234
+	for (size_t i = 0; hw_type_path[i].dev_name; ++i) {
235
+		if (dev_name_size <= hw_type_path[i].path_offset ||
236
+		    memcmp(dev_name, hw_type_path[i].dev_name, hw_type_path[i].path_offset))
237
+			continue;
238
+		/* Path in white list. */
239
+		hw_type_cust->dev_name = dev_name;
240
+		hw_type_cust->flags = hw_type_path[i].flags;
241
+		hw_type_cust->xdriver = hw_type_path[i].xdriver;
242
+		hw_type_cust->path_offset = hw_type_path[i].path_offset;
243
+		size_t name_end = hw_type_cust->path_offset;
244
+		while (name_end < dev_name_size && !isdigit(dev_name[name_end]))
245
+			++name_end;
246
+		hw_type_cust->dev_name_size = (name_end - hw_type_cust->path_offset);
247
+		return hw_type_cust;
248
+	}
249
+	return NULL;
111
+}
250
+}
112
+
251
+
113
+static bool
252
+static int
114
+devpath_exists(const struct hw_type *device,
253
+is_kbdmux_enabled(void)
115
+	char *devname, size_t devname_len)
116
+{
254
+{
117
+	char *devpath;
255
+	/* Xorg uses /dev/ttyv0 as a console device */
118
+	struct stat st;
256
+	/* const char device[]="/dev/console"; */
119
+	int ret;
257
+	static const char *device = _PATH_TTY "v0";
120
+
258
+
121
+	if (device == NULL || device->driver == NULL)
259
+	int fd = open(device, O_RDONLY);
122
+		return false;
260
+	if (fd < 0)
261
+		return 0;
123
+
262
+
124
+	/* Check if /dev/$driver exists. */
263
+	keyboard_info_t info;
125
+	asprintf(&devpath, "/dev/%s", device->driver);
264
+	int ret = (ioctl(fd, KDGKBINFO, &info) == -1 ||
126
+	if (devpath == NULL)
265
+	           memcmp(info.kb_name, "kbdmux", 6)) ? 0 : 1;
127
+		return false;
266
+	close(fd);
267
+	return ret;
268
+}
128
+
269
+
129
+	ret = stat(devpath, &st);
270
+/* Derived from EvdevProbe() function of xf86-input-evdev driver */
130
+	free(devpath);
271
+static int
272
+get_evdev_flags(int fd)
273
+{
274
+	if (fd<0)
275
+		return 0;
131
+
276
+
132
+	if (ret == 0) {
277
+	unsigned long key_bits[ULONG_CNT(KEY_CNT)], rel_bits[ULONG_CNT(REL_CNT)], abs_bits[ULONG_CNT(ABS_CNT)];
133
+		strncpy(devname, device->driver, devname_len);
278
+	size_t has_keys = 0, has_buttons = 0, has_lmr = 0, has_rel_axes = 0, has_abs_axes = 0, has_mt = 0;
134
+		return true;
279
+	if (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(key_bits)), key_bits) != -1) {
280
+		has_keys = bits_calc(key_bits, 0, BTN_MISC);
281
+		has_buttons = bits_calc(key_bits, BTN_MISC, BTN_JOYSTICK);
282
+		has_lmr = bits_calc(key_bits, BTN_LEFT, BTN_MIDDLE);
135
+	}
283
+	}
284
+	if (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(rel_bits)), rel_bits) != -1) {
285
+		has_rel_axes = bits_calc(rel_bits, 0, REL_MAX);
286
+	}
287
+	if (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(abs_bits)), abs_bits) != -1) {
288
+		has_abs_axes = bits_calc(abs_bits, 0, ABS_MAX);
289
+		has_mt = bits_calc(abs_bits, ABS_MT_SLOT, ABS_MAX);
290
+	}
136
+
291
+
137
+	return false;
292
+	int flags = 0;
293
+	if (has_abs_axes) {
294
+		if (has_mt) {
295
+			if (!has_buttons) {
296
+				/*
297
+				 * XXX: I'm not sure that joystick detection is
298
+				 * done right. xf86-input-evdev does not support them.
299
+				 */
300
+				if (ULONG_IS_BIT_SET(key_bits, BTN_JOYSTICK))
301
+					flags = ATTR_JOYSTICK;
302
+				else
303
+					++has_buttons;
304
+			}
305
+		}
306
+		if (!flags && ULONG_IS_BIT_SET(abs_bits, ABS_X) && ULONG_IS_BIT_SET(abs_bits, ABS_Y)) {
307
+			if (ULONG_IS_BIT_SET(key_bits, BTN_TOOL_PEN) ||
308
+			    ULONG_IS_BIT_SET(key_bits, BTN_STYLUS) ||
309
+			    ULONG_IS_BIT_SET(key_bits, BTN_STYLUS2))
310
+				flags = ATTR_TABLET;
311
+			else if (ULONG_IS_BIT_SET(abs_bits, ABS_PRESSURE) ||
312
+			         ULONG_IS_BIT_SET(key_bits, BTN_TOUCH)) {
313
+				if (has_lmr || ULONG_IS_BIT_SET(key_bits, BTN_TOOL_FINGER))
314
+					flags = ATTR_TOUCHPAD;
315
+				else
316
+					flags = ATTR_TOUCHSCREEN;
317
+			} else if (!(ULONG_IS_BIT_SET(rel_bits, REL_X) &&
318
+			             ULONG_IS_BIT_SET(rel_bits, REL_Y)) &&
319
+			            has_lmr) /* some touchscreens use BTN_LEFT rather than BTN_TOUCH */
320
+				flags = ATTR_TOUCHSCREEN;
321
+		}
322
+	}
323
+	if (!flags) {
324
+		if (has_keys)
325
+			flags = ATTR_KEY | ATTR_KEYBOARD;
326
+		else if (has_rel_axes || has_abs_axes || has_buttons)
327
+			flags = ATTR_POINTER;
328
+	}
329
+	return flags;
138
+}
330
+}
139
+
331
+
332
+/* From: sys/dev/usb/usb_hid.c */
333
+static int
334
+hid_is_collection(report_desc_t s, uint32_t usage)
335
+{
336
+	struct hid_data* hd = hid_start_parse(s, ~0, -1);
337
+	if (!hd)
338
+		return 0;
339
+
340
+	struct hid_item hi;
341
+	int rc;
342
+	while ((rc = hid_get_item(hd, &hi))) {
343
+		 if (hi.kind == hid_collection && hi.usage == usage)
344
+			break;
345
+	}
346
+	hid_end_parse(hd);
347
+	return rc;
348
+}
349
+
350
+static int
351
+hid_is_mouse(report_desc_t s)
352
+{
353
+	struct hid_data* hd = hid_start_parse(s, (1 << hid_input), -1);
354
+	if (!hd)
355
+		return 0;
356
+
357
+	struct hid_item hi;
358
+	int found = 0, mdepth = 0;
359
+	while (hid_get_item(hd, &hi)) {
360
+		switch (hi.kind) {
361
+		case hid_collection:
362
+			if (mdepth != 0)
363
+				++mdepth;
364
+			else if (hi.collection == 1 &&
365
+			         hi.usage == HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))
366
+				++mdepth;
367
+			break;
368
+		case hid_endcollection:
369
+			if (mdepth)
370
+				--mdepth;
371
+			break;
372
+		case hid_input:
373
+			if (!mdepth)
374
+				break;
375
+			if (hi.usage == HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X) &&
376
+			    (hi.flags & (HIO_CONST|HIO_RELATIVE)) == HIO_RELATIVE)
377
+				++found;
378
+			if (hi.usage == HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y) &&
379
+			    (hi.flags & (HIO_CONST|HIO_RELATIVE)) == HIO_RELATIVE)
380
+				++found;
381
+			break;
382
+		default:
383
+			break;
384
+		}
385
+	}
386
+	hid_end_parse(hd);
387
+	return found;
388
+}
389
+
140
+static char *
390
+static char *
141
+sysctl_get_str(const char *sysctlname)
391
+sysctl_get_str(const char *sysctlname, size_t *size_ret)
142
+{
392
+{
143
+	char *dest = NULL;
393
+	if (!sysctlname)
144
+	size_t len;
394
+		return NULL;
145
+
395
+
146
+	if (sysctlname == NULL)
396
+	size_t len = 0;
397
+	if (sysctlbyname(sysctlname, NULL, &len, NULL, 0) || !len)
147
+		return NULL;
398
+		return NULL;
148
+
399
+
149
+	if (sysctlbyname(sysctlname, NULL, &len, NULL, 0) == 0) {
400
+	char* dest = malloc(len + 1);
150
+		dest = malloc(len + 1);
401
+	if (!dest)
151
+		if (dest) {
402
+		return NULL;
152
+			if (sysctlbyname(sysctlname, dest, &len, NULL, 0) == 0)
403
+
153
+				dest[len] = '\0';
404
+	if (sysctlbyname(sysctlname, dest, &len, NULL, 0)) {
154
+			else {
405
+		free(dest);
155
+				free(dest);
406
+		return NULL;
156
+				dest = NULL;
157
+			}
158
+		}
159
+	}
407
+	}
160
+
408
+	dest[len] = 0;
409
+	if (size_ret)
410
+		*size_ret = len;
161
+	return dest;
411
+	return dest;
162
+}
412
+}
163
+
413
+
164
+static void
414
+static char *
165
+device_added(const char *devname)
415
+devd_get_val(char *buf, size_t buf_size, const char *val_name, size_t val_name_size, size_t *val_size)
166
+{
416
+{
167
+	char path[PATH_MAX];
417
+	if (!buf || !buf_size || !val_name || !val_name_size)
168
+	char sysctlname[PATH_MAX];
418
+		return NULL;
169
+	char *vendor;
170
+	char *product = NULL;
171
+	char *config_info = NULL;
172
+	char *walk;
173
+	InputOption *options = NULL;
174
+	InputAttributes attrs = { };
175
+	DeviceIntPtr dev = NULL;
176
+	int i;
177
+	int fd;
178
+
419
+
179
+	for (i = 0; hw_types[i].driver != NULL; i++) {
420
+	char *ret = buf, *buf_end = (buf + buf_size);
180
+		size_t len;
421
+	while (ret && ret < buf_end) {
181
+
422
+		ret = memmem(ret, (buf_end - ret), val_name, val_name_size);
182
+		len = strlen(hw_types[i].driver);
423
+		if (!ret)
183
+		if (strcmp(devname, hw_types[i].driver) == 0 ||
424
+			return NULL;
184
+			(strncmp(devname, hw_types[i].driver, len) == 0 &&
425
+		/* Found. */
185
+				isnumber(*(devname + len)))) {
426
+		/* Check: space before or buf+1. */
186
+			attrs.flags |= hw_types[i].flag;
427
+		if ((buf + 1) < ret && ret[-1] != ' ') {
187
+			break;
428
+			ret += val_name_size;
429
+			continue;
188
+		}
430
+		}
431
+		/* Check: = after name and size for value. */
432
+		ret += val_name_size;
433
+		if ((ret + 1) >= buf_end)
434
+			return NULL;
435
+		if (ret[0] != '=')
436
+			continue;
437
+		++ret;
438
+		break;
189
+	}
439
+	}
440
+	if (!ret || !val_size)
441
+		return ret;
442
+	/* Calc value data size. */
443
+	char* ptr = memchr(ret, ' ', (buf_end - ret));
444
+	if (!ptr) /* End of string/last value. */
445
+		ptr = buf_end;
446
+	*val_size = (ptr - ret);
447
+	return ret;
448
+}
190
+
449
+
191
+	if (hw_types[i].driver == NULL || hw_types[i].xdriver == NULL) {
450
+static void
192
+		LogMessage(X_INFO, "config/devd: ignoring device %s\n",
451
+device_added(const char *dev_name, size_t dev_name_size, int allow_no_device)
193
+				devname);
452
+{
453
+	if (!dev_name || !dev_name_size || dev_name_size > PATH_MAX)
194
+		return;
454
+		return;
455
+
456
+	char config_info[PATH_MAX + 32];
457
+	/* Make dev_name null ended string. */
458
+	snprintf(config_info, sizeof(config_info), DEVD_PATH_DEV"%.*s", (int)dev_name_size, dev_name);
459
+	/* Set / update pointers to dev_name and dev_path. */
460
+	char* dev_path = (config_info + DEVD_PATH_LEN); /* Skip: "devd:" */
461
+	dev_name = (dev_path + _PATH_DEV_LEN); /* Skip: "/dev/" */
462
+
463
+	/* Is known input device or path? */
464
+	hw_type_t *hwtype = get_dev_type_by_name(dev_name, dev_name_size);
465
+	if (!hwtype) {
466
+		hw_type_t hwtype_cust;
467
+		hwtype = get_dev_type_by_path(dev_name, dev_name_size, &hwtype_cust);
195
+	}
468
+	}
469
+	if (!hwtype) /* Not found in white list. */
470
+		return;
196
+
471
+
197
+	/* Skip keyboard devices if kbdmux is enabled */
472
+	/* Skip keyboard devices if kbdmux is enabled */
198
+	if (is_kbdmux && is_console_kbd && hw_types[i].flag & ATTR_KEYBOARD) {
473
+	if (is_kbdmux && !allow_no_device && (hwtype->flags & ATTR_KEYBOARD)) {
199
+		LogMessage(X_INFO, "config/devd: kbdmux is enabled, ignoring device %s\n",
474
+		LogMessage(X_INFO, "config/devd: kbdmux is enabled, ignoring device %s\n", dev_name);
200
+				devname);
201
+		return;
475
+		return;
202
+	}
476
+	}
203
+
477
+	/* Skip duplicate devices. */
204
+	snprintf(path, sizeof(path), "/dev/%s", devname);
478
+	if (device_is_duplicate(config_info)) {
205
+
479
+		LogMessage(X_WARNING, "config/devd: device %s already added. ignoring\n", dev_path);
206
+	options = input_option_new(NULL, "_source", "server/devd");
207
+	if (!options)
208
+		return;
480
+		return;
209
+
210
+	snprintf(sysctlname, sizeof(sysctlname), "dev.%s.%s.%%desc",
211
+	    hw_types[i].driver, devname + strlen(hw_types[i].driver));
212
+	vendor = sysctl_get_str(sysctlname);
213
+	if (vendor == NULL) {
214
+		options = input_option_new(options, "name", devname);
215
+	}
481
+	}
216
+	else {
217
+		if ((walk = strchr(vendor, ' ')) != NULL) {
218
+			walk[0] = '\0';
219
+			walk++;
220
+			product = walk;
221
+			if ((walk = strchr(product, ',')) != NULL)
222
+				walk[0] = '\0';
223
+		}
224
+
482
+
225
+		attrs.vendor = strdup(vendor);
483
+	/* Init and set attributes. */
226
+		if (product) {
484
+	char pnp_usb_id[PATH_MAX], product[PATH_MAX], vendor[PATH_MAX];
227
+			attrs.product = strdup(product);
485
+	InputAttributes attrs;
228
+			options = input_option_new(options, "name", product);
486
+	memset(&attrs, 0, sizeof(attrs));
229
+		}
487
+	attrs.device = dev_path;
230
+		else
488
+	attrs.flags = hwtype->flags;
231
+			options = input_option_new(options, "name", "(unnamed)");
232
+
489
+
233
+		free(vendor);
490
+	/* Try to open device. */
234
+	}
491
+	int fd = open(dev_path, O_RDONLY);
235
+
492
+	if (fd < 0) {
236
+	/* XXX implement usb_id */
493
+		if (!(hwtype->flags & (ATTR_KEY | ATTR_KEYBOARD))) {
237
+	attrs.usb_id = NULL;
238
+	attrs.device = strdup(path);
239
+	options = input_option_new(options, "driver", hw_types[i].xdriver);
240
+
241
+	fd = open(path, O_RDONLY);
242
+	if (fd > 0) {
243
+		close(fd);
244
+		options = input_option_new(options, "device", path);
245
+	}
246
+	else {
247
+		if (attrs.flags & ~ATTR_KEYBOARD) {
248
+			LogMessage(X_INFO, "config/devd: device %s already opened\n",
249
+					 path);
250
+
251
+			/*
494
+			/*
252
+			 * Fail if cannot open device, it breaks AllowMouseOpenFail,
495
+			 * Fail if cannot open device, it breaks AllowMouseOpenFail,
253
+			 * but it should not matter when config/devd enabled
496
+			 * but it should not matter when config/devd is enabled
254
+			 */
497
+			 */
255
+			goto unwind;
498
+			LogMessage(X_WARNING, "config/devd: device %s already opened\n", dev_path);
499
+			return;
256
+		}
500
+		}
257
+
501
+		if (!allow_no_device) {
258
+		if (is_console_kbd) {
259
+			/*
502
+			/*
260
+			 * There can be only one keyboard attached to console and
503
+			 * There can be only one keyboard attached to console and
261
+			 * it is already added.
504
+			 * it is already added.
262
+			 */
505
+			 */
263
+			LogMessage(X_WARNING, "config/devd: console keyboard is "
506
+			LogMessage(X_WARNING, "config/devd: console keyboard is already added, ignoring %s\n", dev_path);
264
+					"already added, ignoring %s (%s)\n",
507
+			return;
265
+					attrs.product, path);
266
+			goto unwind;
267
+		}
508
+		}
268
+		else
509
+	} else {
269
+			/*
510
+		/* Try to get device info via ioctl(). */
270
+			 * Don't pass "device" option if the keyboard is already
511
+		keyboard_info_t kbdi;
271
+			 * attached to the console (ie. open() fails).
512
+		mousehw_t mshw;
272
+			 * This would activate a special logic in xf86-input-keyboard.
513
+		struct input_id iid;
273
+			 * Prevent any other attached to console keyboards being
514
+		report_desc_t rep_desc;
274
+			 * processed. There can be only one such device.
275
+			 */
276
+			is_console_kbd = true;
277
+	}
278
+
515
+
279
+	if (asprintf(&config_info, "devd:%s", devname) == -1) {
516
+		if (ioctl(fd, KDGKBINFO, &kbdi) != -1) { /* Is this keyboard? */
280
+		config_info = NULL;
517
+			memcpy(product, kbdi.kb_name, sizeof(kbdi.kb_name));
281
+		goto unwind;
518
+			attrs.product = product;
519
+			attrs.flags = ATTR_KEY | ATTR_KEYBOARD;
520
+			LogMessage(X_INFO, "config/devd: detected keyboard: %s, kb_index=%i, kb_unit=%i, kb_type=%i, kb_config=%i\n",
521
+			           kbdi.kb_name, kbdi.kb_index, kbdi.kb_unit, kbdi.kb_type, kbdi.kb_config);
522
+		} else if (ioctl(fd, MOUSE_GETHWINFO, &mshw) != -1) { /* Is this mouse? */
523
+			/* FreeBSD mouse drivers does not return real vid+pid. */
524
+			/* construct USB ID in lowercase hex - "0000:ffff" */
525
+			if (mshw.iftype != MOUSE_IF_USB && mshw.model > 0) {
526
+				snprintf(pnp_usb_id, sizeof(pnp_usb_id), "%04x:%04x", mshw.hwid, mshw.model);
527
+				attrs.usb_id = pnp_usb_id;
528
+			}
529
+			if (mshw.type == MOUSE_PAD)
530
+				attrs.flags = ATTR_TOUCHPAD;
531
+			else
532
+				attrs.flags = ATTR_POINTER;
533
+			LogMessage(X_INFO, "config/devd: detected mouse: hwid=%04x, model=%04x, type=%04x, iftype=%04x, buttons=%d\n",
534
+			           mshw.hwid, mshw.model, mshw.type, mshw.iftype, mshw.buttons);
535
+		} else if (ioctl(fd, JSIOCGNAME((sizeof(product) - 1)), product) != -1) { /* Is this joystick? */
536
+			attrs.product = product;
537
+			attrs.flags = ATTR_JOYSTICK;
538
+			LogMessage(X_INFO, "config/devd: detected joystick: %s\n", product);
539
+		} else if (ioctl(fd, EVIOCGID, &iid) != -1 &&
540
+		           ioctl(fd, EVIOCGNAME((sizeof(product) - 1)), product) != -1) { /* Is this event? */
541
+			/* construct USB ID in lowercase hex - "0000:ffff" */
542
+			snprintf(pnp_usb_id, sizeof(pnp_usb_id), "%04x:%04x", iid.vendor, iid.product);
543
+			attrs.usb_id = pnp_usb_id;
544
+			attrs.product = product;
545
+			/* Detect device type. */
546
+			attrs.flags = get_evdev_flags(fd);
547
+			/* Skip keyboard devices if kbdmix is enabled */
548
+			if (is_kbdmux && (attrs.flags & ATTR_KEYBOARD)) {
549
+				close(fd);
550
+				LogMessage(X_INFO, "config/devd: kbdmux is enabled, ignoring device %s\n", dev_name);
551
+				return;
552
+			}
553
+			LogMessage(X_INFO, "config/devd: detected event input: %s, bustype=%04x, vendor=%04x, product=%04x, version=%04x\n",
554
+			           product, iid.bustype, iid.vendor, iid.product, iid.version);
555
+		} else if ((rep_desc = hid_get_report_desc(fd))) { /* Is USB HID? */
556
+			if (hid_is_mouse(rep_desc)) {
557
+				attrs.flags = ATTR_POINTER;
558
+				LogMessage(X_INFO, "config/devd: detected USB HID mouse\n");
559
+			} else if (hid_is_collection(rep_desc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_KEYBOARD))) {
560
+				/* Skip keyboard devices if kbdmux is enabled */
561
+				if (is_kbdmux) {
562
+					hid_dispose_report_desc(rep_desc);
563
+					close(fd);
564
+					LogMessage(X_INFO, "config/devd: kbdmux is enabled, ignoring device %s\n", dev_name);
565
+					return;
566
+				}
567
+				attrs.flags = ATTR_KEY | ATTR_KEYBOARD;
568
+				LogMessage(X_INFO, "config/devd: detected USB HID keyboard\n");
569
+			} else if (hid_is_collection(rep_desc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_JOYSTICK)) ||
570
+			           hid_is_collection(rep_desc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_GAME_PAD))) {
571
+				attrs.flags = ATTR_JOYSTICK;
572
+				LogMessage(X_INFO, "config/devd: detected USB HID joystick\n");
573
+			} else
574
+				LogMessage(X_INFO, "config/devd: detected USB HID of unknown type\n");
575
+			hid_dispose_report_desc(rep_desc);
576
+		}
577
+
578
+		if (!attrs.usb_id) { /* Is this webcamd device? */
579
+			unsigned short vid, pid;
580
+			if (ioctl(fd, WEBCAMD_IOCTL_GET_USB_VENDOR_ID, &vid) != -1 &&
581
+			    ioctl(fd, WEBCAMD_IOCTL_GET_USB_PRODUCT_ID, &pid) != -1) {
582
+				snprintf(pnp_usb_id, sizeof(pnp_usb_id), "%04x:%04x", vid, pid);
583
+				attrs.usb_id = pnp_usb_id;
584
+				LogMessage(X_INFO, "config/devd: webcamd device: %s\n", pnp_usb_id);
585
+			}
586
+		}
282
+	}
587
+	}
588
+	close(fd);
283
+
589
+
284
+	if (device_is_duplicate(config_info)) {
590
+	/* Try to get device info via sysctl(). */
285
+		LogMessage(X_WARNING, "config/devd: device %s (%s) already added. "
591
+	if (!attrs.usb_id && !attrs.pnp_id) {
286
+				"ignoring\n", attrs.product, path);
592
+		char sysctlname[PATH_MAX];
287
+		goto unwind;
593
+		snprintf(sysctlname, sizeof(sysctlname), "dev.%.*s.%s.%%pnpinfo",
594
+		         (int)hwtype->dev_name_size,
595
+		         (hwtype->dev_name + hwtype->path_offset),
596
+		         (dev_name + hwtype->path_offset + hwtype->dev_name_size));
597
+		size_t sdata_size;
598
+		char* sdata = sysctl_get_str(sysctlname, &sdata_size);
599
+		if (sdata) {
600
+			size_t pid_size, vid_size;
601
+			char* ptr_vid = devd_get_val_cstr("vendor", sdata, sdata_size, &vid_size);
602
+			char* ptr_pid = devd_get_val_cstr("product", sdata, sdata_size, &pid_size);
603
+			if (ptr_vid && ptr_pid) { /* usb_id */
604
+				ptr_vid[vid_size] = 0;
605
+				ptr_pid[pid_size] = 0;
606
+				snprintf(pnp_usb_id, sizeof(pnp_usb_id), "%s:%s", ptr_vid, ptr_pid);
607
+				attrs.usb_id = pnp_usb_id;
608
+				LogMessage(X_INFO, "config/devd: [sysctl] usb_id: %s\n", pnp_usb_id);
609
+			} else { /* pnp_id */
610
+				strlcpy(pnp_usb_id, sdata, sizeof(pnp_usb_id));
611
+				attrs.pnp_id = pnp_usb_id;
612
+			}
613
+			free(sdata);
614
+		}
288
+	}
615
+	}
616
+	if (!attrs.vendor || !attrs.product) {
617
+		char sysctlname[PATH_MAX];
618
+		snprintf(sysctlname, sizeof(sysctlname), "dev.%.*s.%s.%%desc",
619
+		         (int)hwtype->dev_name_size,
620
+		         (hwtype->dev_name + hwtype->path_offset),
621
+		         (dev_name + hwtype->path_offset + hwtype->dev_name_size));
622
+		size_t sdata_size;
623
+		char* sdata = sysctl_get_str(sysctlname, &sdata_size);
624
+		if (sdata) {
625
+			/* Vendor. */
626
+			char* ptr_pid = memchr(sdata, ' ', sdata_size);
627
+			if (ptr_pid)
628
+				ptr_pid[0] = 0;
629
+			strlcpy(vendor, sdata, sizeof(vendor));
630
+			attrs.vendor = vendor;
631
+			/* Product. */
632
+			if (!attrs.product && ptr_pid) {
633
+				++ptr_pid;
634
+				char* ptr_vid = memchr(ptr_pid, ',', (sdata_size - (ptr_pid - sdata)));
635
+				if (ptr_vid)
636
+					ptr_vid[0] = 0;
637
+				strlcpy(product, ptr_pid, sizeof(product));
638
+				attrs.product = product;
639
+			} else
640
+				product[0] = 0;
641
+			free(sdata);
642
+			LogMessage(X_INFO, "config/devd: [sysctl] vendor: %s, product: %s\n", vendor, product);
643
+		}
644
+	}
289
+
645
+
290
+	options = input_option_new(options, "config_info", config_info);
646
+	/* Init options. */
291
+	LogMessage(X_INFO, "config/devd: adding input device %s (%s)\n",
647
+	InputOption *option = NULL, *options = NULL;
292
+			attrs.product, path);
648
+	if ((option = input_option_new(options, "_source", "server/devd")))
293
+
649
+		options = option;
294
+	NewInputDeviceRequest(options, &attrs, &dev);
650
+	if (option && (option = input_option_new(options, "config_info", config_info)))
295
+
651
+		options = option;
296
+unwind:
652
+	if (option && (option = input_option_new(options, "name", (attrs.product ? attrs.product : dev_name))))
297
+	free(config_info);
653
+		options = option;
298
+	input_option_free_list(&options);
654
+	if (option && hwtype->xdriver && (option = input_option_new(options, "driver", hwtype->xdriver)))
299
+	free(attrs.usb_id);
655
+		options = option;
300
+	free(attrs.product);
656
+	/*
301
+	free(attrs.device);
657
+	 * Don't pass "device" option if the keyboard is already attached to the console (ie. open() failed)
302
+	free(attrs.vendor);
658
+	 * This would activate a special logic in xf86-input-keyboard. Prevent any other attached to console
659
+	 * keyboards being processed. There can be only one such device.
660
+	 */
661
+	if (option && fd >= 0 && (option = input_option_new(options, "device", dev_path)))
662
+		options = option;
663
+	/* Most drivers just use "device" but evdev also uses "path" so populate both */
664
+	if (option && (option = input_option_new(options, "path", dev_path)))
665
+		options = option;
666
+	if (option) {
667
+		LogMessage(X_INFO, "config/devd: adding input device %s\n", dev_path);
668
+		DeviceIntPtr dev_iptr = NULL;
669
+		int rc;
670
+		if ((rc = NewInputDeviceRequest(options, &attrs, &dev_iptr)) != Success)
671
+			LogMessage(X_ERROR, "config/devd: error %d adding device %s\n", rc, dev_path);
672
+	} else
673
+		LogMessage(X_ERROR, "config/devd: error adding device %s\n", dev_path);
674
+	if (options)
675
+		input_option_free_list(&options);
676
+	return;
303
+}
677
+}
304
+
678
+
305
+static void
679
+static void
306
+device_removed(char *devname)
680
+device_removed(const char *dev_name, size_t dev_name_size)
307
+{
681
+{
308
+	char *config_info;
309
+
682
+
310
+	if (asprintf(&config_info, "devd:%s", devname) == -1)
683
+	if (!dev_name || !dev_name_size || dev_name_size > PATH_MAX)
311
+		return;
684
+		return;
312
+
685
+
686
+	hw_type_t hwtype_cust;
687
+	if (!get_dev_type_by_name(dev_name, dev_name_size) &&
688
+	    !get_dev_type_by_path(dev_name, dev_name_size, &hwtype_cust))
689
+		return;	/* Device not in list - unknown. */
690
+
691
+	char config_info[PATH_MAX + 32];
692
+	snprintf(config_info, sizeof(config_info), DEVD_PATH_DEV"%.*s", (int)dev_name_size, dev_name);
693
+	if (device_is_duplicate(config_info))
694
+		LogMessage(X_INFO, "config/devd: removing input device %s\n", (config_info + DEVD_PATH_LEN));
695
+	else
696
+		LogMessage(X_INFO, "config/devd: removing nonexistent device %s\n", (config_info + DEVD_PATH_LEN));
313
+	remove_devices("devd", config_info);
697
+	remove_devices("devd", config_info);
314
+
698
+	return;
315
+	free(config_info);
316
+}
699
+}
317
+
700
+
318
+static bool is_kbdmux_enabled(void)
701
+static void socket_handler(int fd, int ready, void *data);
319
+{
320
+	/* Xorg uses /dev/ttyv0 as a console device */
321
+	/* const char device[]="/dev/console"; */
322
+	const char device[]="/dev/ttyv0";
323
+	keyboard_info_t info;
324
+	int fd;
325
+
702
+
326
+	fd = open(device, O_RDONLY);
327
+
328
+	if (fd < 0)
329
+		return false;
330
+
331
+	if (ioctl(fd, KDGKBINFO, &info) == -1) {
332
+		close(fd);
333
+		return false;
334
+	}
335
+
336
+	close(fd);
337
+
338
+	if (!strncmp(info.kb_name, "kbdmux", 6))
339
+		return true;
340
+
341
+	return false;
342
+}
343
+
344
+static void
345
+disconnect_devd(int sock)
346
+{
347
+	if (sock >= 0) {
348
+		RemoveGeneralSocket(sock);
349
+		close(sock);
350
+	}
351
+}
352
+
353
+static int
703
+static int
354
+connect_devd(void)
704
+connect_devd(void)
355
+{
705
+{
356
+	struct sockaddr_un devd;
706
+	int sock = socket(AF_UNIX, SOCK_STREAM, 0);
357
+	int sock;
358
+
359
+	sock = socket(AF_UNIX, SOCK_STREAM, 0);
360
+	if (sock < 0) {
707
+	if (sock < 0) {
361
+		LogMessage(X_ERROR, "config/devd: fail opening stream socket\n");
708
+		LogMessage(X_ERROR, "config/devd: failed opening stream socket: %s\n", strerror(errno));
362
+		return -1;
709
+		return -1;
363
+	}
710
+	}
364
+
711
+
712
+	struct sockaddr_un devd;
365
+	devd.sun_family = AF_UNIX;
713
+	devd.sun_family = AF_UNIX;
366
+	strlcpy(devd.sun_path, DEVD_SOCK_PATH, sizeof(devd.sun_path));
714
+	memcpy(devd.sun_path, DEVD_SOCK_PATH, sizeof(DEVD_SOCK_PATH));
367
+
715
+	if (connect(sock, (struct sockaddr*)&devd, sizeof(devd)) < 0) {
368
+	if (connect(sock, (struct sockaddr *) &devd, sizeof(devd)) < 0) {
716
+		int error = errno;
369
+		close(sock);
717
+		close(sock);
370
+		LogMessage(X_ERROR, "config/devd: fail to connect to devd\n");
718
+		LogMessage(X_ERROR, "config/devd: failed to connect to devd: %s)\n", strerror(error));
371
+		return -1;
719
+		return -1;
372
+	}
720
+	}
373
+
721
+
374
+	AddGeneralSocket(sock);
722
+	SetNotifyFd(sock, socket_handler, X_NOTIFY_READ, NULL);
723
+	return sock;
724
+}
375
+
725
+
376
+	return	sock;
726
+static void
727
+disconnect_devd(int sock)
728
+{
729
+	if (sock < 0)
730
+		return;
731
+	RemoveNotifyFd(sock);
732
+	close(sock);
733
+	return;
377
+}
734
+}
378
+
735
+
379
+static CARD32
736
+static CARD32
380
+reconnect_handler(OsTimerPtr timer, CARD32 time, void *arg)
737
+reconnect_handler(OsTimerPtr timer, CARD32 time, void *arg)
381
+{
738
+{
382
+	int newsock;
739
+	devd_buf_used = 0;
383
+
740
+	devd_skt = connect_devd();
384
+	if ((newsock = connect_devd()) > 0) {
741
+	if (devd_skt < 0) /* Try again after RECONNECT_DELAY */
385
+		sock_devd = newsock;
742
+		return RECONNECT_DELAY;
386
+		TimerFree(rtimer);
743
+	TimerFree(rtimer);
387
+		rtimer = NULL;
744
+	rtimer = NULL;
388
+		LogMessage(X_INFO, "config/devd: reopening devd socket\n");
745
+	LogMessage(X_INFO, "config/devd: reopened devd socket\n");
389
+		return 0;
746
+	return 0;
390
+	}
391
+
392
+	/* Try again after RECONNECT_DELAY */
393
+	return RECONNECT_DELAY;
394
+}
747
+}
395
+
748
+
396
+static ssize_t
749
+static void
397
+socket_getline(int fd, char **out)
750
+socket_handler(int fd, int ready, void *data)
398
+{
751
+{
399
+	char *buf, *newbuf;
752
+	/* Read new data. */
400
+	ssize_t ret, cap, sz = 0;
753
+	while (1) {
401
+	char c;
754
+		ssize_t ios = recv(devd_skt, (devd_buf + devd_buf_used), (sizeof(devd_buf) - devd_buf_used), MSG_DONTWAIT);
402
+
755
+		if (ios > 0) { /* Read OK. */
403
+	cap = 1024;
756
+			devd_buf_used += ios;
404
+	buf = malloc(cap * sizeof(char));
757
+			continue; /* Try to read more. */
405
+	if (!buf)
406
+		return -1;
407
+
408
+	for (;;) {
409
+		ret = read(sock_devd, &c, 1);
410
+		if (ret < 0) {
411
+			if (errno == EINTR)
412
+				continue;
413
+			free(buf);
414
+			return -1;
415
+		/* EOF - devd socket is lost */
416
+		} else if (ret == 0) {
417
+			disconnect_devd(sock_devd);
418
+			rtimer = TimerSet(NULL, 0, 1, reconnect_handler, NULL);
419
+			LogMessage(X_WARNING, "config/devd: devd socket is lost\n");
420
+			free(buf);
421
+			return -1;
422
+		}
758
+		}
423
+		if (c == '\n')
759
+		/* Something wrong. */
424
+			break;
760
+		int error = errno;
425
+
761
+		if (error == EAGAIN)
426
+		if (sz + 1 >= cap) {
762
+			break; /* All available data read. */
427
+			cap *= 2;
763
+		if (error == EINTR)
428
+			newbuf = realloc(buf, cap * sizeof(char));
764
+			continue;
429
+			if (!newbuf) {
765
+		if (devd_buf_used >= sizeof(devd_buf)) {
430
+				free(buf);
766
+			devd_buf_used = 0; /* Message too long, reset buf. */
431
+				return -1;
767
+			continue;
432
+			}
433
+			buf = newbuf;
434
+		}
768
+		}
435
+		buf[sz] = c;
769
+		/* devd socket is lost */
436
+		sz++;
770
+		disconnect_devd(devd_skt);
771
+		rtimer = TimerSet(NULL, 0, 1, reconnect_handler, NULL);
772
+		LogMessage(X_WARNING, "config/devd: devd socket read error: %s\n", strerror(error));
773
+		return;
437
+	}
774
+	}
438
+
775
+
439
+	buf[sz] = '\0';
776
+	/* Process data. */
440
+	if (sz >= 0)
777
+	char *ptr, *line = (devd_buf + 1);
441
+		*out = buf;
778
+	size_t line_size = 0;
442
+	else
779
+	while((ptr = memchr(line, '\n', (devd_buf_used - line_size)))) {
443
+		free(buf);
780
+		line_size = (ptr - line);
781
+		do {
782
+			if (*(line - 1) != DEVD_EVENT_NOTIFY)
783
+				break; /* Handle only notify. */
784
+			/* Check: is system=DEVFS. */
785
+			size_t val_size;
786
+			char* val = devd_get_val_cstr("system", line, line_size, &val_size);
787
+			if (!is_meuqual_cstr("DEVFS", val, val_size))
788
+				break;
789
+			/* Check: is subsystem=CDEV. */
790
+			val = devd_get_val_cstr("subsystem", line, line_size, &val_size);
791
+			if (!is_meuqual_cstr("CDEV", val, val_size))
792
+				break;
793
+			/* Get device name. */
794
+			size_t cdev_size;
795
+			char* cdev = devd_get_val_cstr("cdev", line, line_size, &cdev_size);
796
+			if (!cdev)
797
+				break;
798
+			/* Get event type. */
799
+			val = devd_get_val_cstr("type", line, line_size, &val_size);
800
+			if (is_meuqual_cstr("CREATE", val, val_size)) {
801
+				device_added(cdev, cdev_size, 0);
802
+			} else if (is_meuqual_cstr("DESTROY", val, val_size)) {
803
+				device_removed(cdev, cdev_size);
804
+			}
805
+		} while(0);
444
+
806
+
445
+	/* Number of bytes in the line, not counting the line break */
807
+		line += (line_size + 2); /* Skip '\n' and event type byte. */
446
+	return sz;
808
+		line_size = (line - devd_buf);
447
+}
809
+		if (devd_buf_used <= line_size) {
448
+
810
+			devd_buf_used = 0;
449
+static void
450
+wakeup_handler(void *data, int err, void *read_mask)
451
+{
452
+	char *line = NULL;
453
+	char *walk;
454
+
455
+	if (err < 0)
456
+		return;
457
+
458
+	if (FD_ISSET(sock_devd, (fd_set *) read_mask)) {
459
+		if (socket_getline(sock_devd, &line) < 0)
460
+			return;
811
+			return;
461
+
462
+		walk = strchr(line + 1, ' ');
463
+		if (walk != NULL)
464
+			walk[0] = '\0';
465
+
466
+		switch (*line) {
467
+		case DEVD_EVENT_ADD:
468
+			device_added(line + 1);
469
+			break;
470
+		case DEVD_EVENT_REMOVE:
471
+			device_removed(line + 1);
472
+			break;
473
+		default:
474
+			break;
475
+		}
812
+		}
476
+		free(line);
477
+	}
813
+	}
814
+	/* Save line without end marker. */
815
+	if (line_size) {
816
+		devd_buf_used -= (line_size - 1);
817
+		memmove(devd_buf, (line - 1), devd_buf_used);
818
+	}
819
+	return;
478
+}
820
+}
479
+
821
+
480
+static void
481
+block_handler(void *data, struct timeval **tv, void *read_mask)
482
+{
483
+}
484
+
485
+int
822
+int
486
+config_devd_init(void)
823
+config_devd_init(void)
487
+{
824
+{
488
+	char devicename[1024];
489
+	int i, j;
490
+
491
+	LogMessage(X_INFO, "config/devd: probing input devices...\n");
825
+	LogMessage(X_INFO, "config/devd: probing input devices...\n");
492
+
826
+
493
+	/*
827
+	/*
Lines 494-520 Link Here
494
+	 * Add fake keyboard and give up on keyboards management
828
+	 * Add fake keyboard and give up on keyboards management
495
+	 * if kbdmux is enabled
829
+	 * if kbdmux is enabled
496
+	 */
830
+	 */
497
+	if ((is_kbdmux = is_kbdmux_enabled()) == true)
831
+	is_kbdmux = is_kbdmux_enabled();
498
+		device_added("kbdmux");
832
+	if (is_kbdmux)
833
+		device_added("kbdmux0", 7, 1);
499
+
834
+
500
+	for (i = 0; hw_types[i].driver != NULL; i++) {
835
+	/* Scan /dev/ for devices. */
501
+		/* First scan the sysctl to determine the hardware */
836
+	struct dirent** namelist;
502
+		for (j = 0; j < 16; j++) {
837
+	size_t dir_cnt = scandir(_PATH_DEV, &namelist, 0, alphasort);
503
+			if (sysctl_exists(&hw_types[i], j,
838
+	for (size_t i = 0; i < dir_cnt; ++i) {
504
+					devicename, sizeof(devicename)) != 0)
839
+		struct dirent* de = namelist[i];
505
+				device_added(devicename);
840
+		if (is_de_euqual_cstr(de, ".") ||
841
+		    is_de_euqual_cstr(de, "..")) {
842
+			free(de);
843
+			continue;
506
+		}
844
+		}
507
+
845
+		if (de->d_type != DT_DIR) {
508
+		if (devpath_exists(&hw_types[i], devicename, sizeof(devicename)) != 0)
846
+			device_added(de->d_name, de->d_namlen, 0);
509
+			device_added(devicename);
847
+		} else { /* Sub folder. */
848
+			char devicename[PATH_MAX];
849
+			snprintf(devicename, sizeof(devicename), _PATH_DEV "%s", de->d_name);
850
+			struct dirent** snamelist;
851
+			size_t sdir_cnt = scandir(devicename, &snamelist, 0, alphasort);
852
+			for (size_t j = 0; j < sdir_cnt; ++j) {
853
+				struct dirent* sde = snamelist[j];
854
+				if (!is_de_euqual_cstr(sde, ".") &&
855
+				    !is_de_euqual_cstr(sde, "..") &&
856
+				    sde->d_type != DT_DIR) {
857
+					size_t tm = snprintf(devicename, sizeof(devicename), "%s/%s", de->d_name, sde->d_name);
858
+					device_added(devicename, tm, 0);
859
+				}
860
+				free(sde);
861
+			}
862
+			free(snamelist);
863
+		}
864
+		free(de);
510
+	}
865
+	}
866
+	free(namelist);
511
+
867
+
512
+	if ((sock_devd = connect_devd()) < 0)
868
+	devd_buf_used = 0;
513
+		return 0;
869
+	devd_skt = connect_devd();
514
+
870
+	return (devd_skt < 0) ? 0 : 1;
515
+	RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL);
516
+
517
+	return 1;
518
+}
871
+}
519
+
872
+
520
+void
873
+void
Lines 527-535 Link Here
527
+		rtimer = NULL;
880
+		rtimer = NULL;
528
+	}
881
+	}
529
+
882
+
530
+	disconnect_devd(sock_devd);
883
+	disconnect_devd(devd_skt);
531
+
884
+	return;
532
+	RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL);
533
+
534
+	is_console_kbd = false;
535
+}
885
+}
(-)x11-servers/xorg-server/files/patch-config_udev.c (+53 lines)
Line 0 Link Here
1
* Don't pass the device parameter when using kbdmux to prevent conflict
2
*
3
* Specify a driver to use for basic devices (keyboard and mouse), otherwise none attaches
4
*
5
--- config/udev.c.orig	2017-03-15 18:05:25 UTC
6
+++ config/udev.c
7
@@ -29,6 +29,7 @@
8
 
9
 #include <libudev.h>
10
 #include <ctype.h>
11
+#include <fcntl.h>
12
 #include <unistd.h>
13
 
14
 #include "input.h"
15
@@ -188,7 +189,21 @@ device_added(struct udev_device *udev_de
16
         attrs.product = strdup(name);
17
     input_options = input_option_new(input_options, "name", name);
18
     input_options = input_option_new(input_options, "path", path);
19
-    input_options = input_option_new(input_options, "device", path);
20
+    if(strstr(path, "kbdmux") != NULL) {
21
+        /*
22
+         * Don't pass "device" option if the keyboard is already attached
23
+         * to the console (ie. open() fails). This would activate a special
24
+         * logic in xf86-input-keyboard. Prevent any other attached to console
25
+         * keyboards being processed. There can be only one such device.
26
+         */
27
+        int fd = open(path, O_RDONLY);
28
+        if (fd > -1) {
29
+            close(fd);
30
+            input_options = input_option_new(input_options, "device", path);
31
+        }
32
+    }
33
+    else
34
+        input_options = input_option_new(input_options, "device", path);
35
     input_options = input_option_new(input_options, "major", itoa(major(devnum)));
36
     input_options = input_option_new(input_options, "minor", itoa(minor(devnum)));
37
     if (path)
38
@@ -272,6 +287,15 @@ device_added(struct udev_device *udev_de
39
         }
40
     }
41
 
42
+    if (attrs.flags & (ATTR_KEY | ATTR_KEYBOARD))
43
+        input_options = input_option_new(input_options, "driver", "kbd");
44
+    else if (attrs.flags & ATTR_POINTER) {
45
+        if (strstr(path, "vbox"))
46
+            input_options = input_option_new(input_options, "driver", "vboxmouse");
47
+        else
48
+            input_options = input_option_new(input_options, "driver", "mouse");
49
+    }
50
+
51
     input_options = input_option_new(input_options, "config_info", config_info);
52
 
53
     /* Default setting needed for non-seat0 seats */
(-)x11-servers/xorg-server/files/patch-configure (-14 / +152 lines)
Lines 1-6 Link Here
1
--- configure.orig	2016-07-19 17:27:31 UTC
1
* generated from patched configure.ac; revise and regen instead of editing
2
*
3
* Plumb the devd config backend into configure
4
*
5
* define USE_DEV_IO for ARM platforms
6
*
7
* Only run pkg-config for udev if it is not disabled to prevent over-linking
8
*
9
* Automatically use systemd/logind only on Linux
10
*
11
--- configure.orig	2017-03-15 18:05:39 UTC
2
+++ configure
12
+++ configure
3
@@ -23168,9 +23168,14 @@ $as_echo "#define USE_ALPHA_PIO 1" >>con
13
@@ -1032,6 +1032,8 @@ CONFIG_UDEV_FALSE
14
 CONFIG_UDEV_TRUE
15
 UDEV_LIBS
16
 UDEV_CFLAGS
17
+CONFIG_DEVD_FALSE
18
+CONFIG_DEVD_TRUE
19
 HAVE_SYSTEMD_DAEMON_FALSE
20
 HAVE_SYSTEMD_DAEMON_TRUE
21
 SYSTEMD_DAEMON_LIBS
22
@@ -1367,6 +1369,7 @@ enable_tslib
23
 enable_dbe
24
 enable_xf86bigfont
25
 enable_dpms
26
+enable_config_devd
27
 enable_config_udev
28
 enable_config_udev_kms
29
 enable_config_hal
30
@@ -2191,6 +2194,7 @@ Optional Features:
31
   --disable-dbe           Build DBE extension (default: enabled)
32
   --enable-xf86bigfont    Build XF86 Big Font extension (default: disabled)
33
   --disable-dpms          Build DPMS extension (default: enabled)
34
+  --enable-config-devd    Build devd support (default: auto)
35
   --enable-config-udev    Build udev support (default: auto)
36
   --enable-config-udev-kms
37
                           Build udev kms support (default: auto)
38
@@ -23280,9 +23284,13 @@ $as_echo "#define USE_ALPHA_PIO 1" >>con
4
 	esac
39
 	esac
5
 	GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee"
40
 	GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee"
6
 	;;
41
 	;;
Lines 9-27 Link Here
9
 	ARM_VIDEO=yes
44
 	ARM_VIDEO=yes
10
 	DEFAULT_INT10="stub"
45
 	DEFAULT_INT10="stub"
11
+	case $host_os in
46
+	case $host_os in
12
+		*freebsd*)
47
+		*freebsd*)	$as_echo "#define USE_DEV_IO 1" >>confdefs.h
13
+			$as_echo "#define USE_DEV_IO 1" >>confdefs.h
48
+ ;;
14
+		 ;;
15
+	esac
49
+	esac
16
 	;;
50
 	;;
17
   i*86)
51
   i*86)
18
 	I386_VIDEO=yes
52
 	I386_VIDEO=yes
19
@@ -26057,7 +26062,7 @@ fi
53
@@ -24053,6 +24061,13 @@ else
20
 case "x$XTRANS_SEND_FDS" in
54
   DPMSExtension=yes
21
 xauto)
55
 fi
22
 	case "$host_os" in
56
 
23
-	linux*|solaris*)
57
+# Check whether --enable-config-devd was given.
24
+	linux*|solaris*|freebsd*|dragonfly*|openbsd*)
58
+if test "${enable_config_devd+set}" = set; then :
25
 		XTRANS_SEND_FDS=yes
59
+  enableval=$enable_config_devd; CONFIG_DEVD=$enableval
26
 		;;
60
+else
27
 	*)
61
+  CONFIG_DEVD=auto
62
+fi
63
+
64
 # Check whether --enable-config-udev was given.
65
 if test "${enable_config_udev+set}" = set; then :
66
   enableval=$enable_config_udev; CONFIG_UDEV=$enableval
67
@@ -25813,6 +25828,31 @@ if test "x$CONFIG_UDEV" = xyes && test "
68
 	as_fn_error $? "Hotplugging through both libudev and hal not allowed" "$LINENO" 5
69
 fi
70
 
71
+if test "x$CONFIG_DEVD" = xauto; then
72
+	case $host_os in
73
+		*freebsd*)
74
+			CONFIG_DEVD=yes
75
+			;;
76
+		*)
77
+			CONFIG_DEVD=no
78
+			;;
79
+	esac
80
+fi
81
+ if test "x$CONFIG_DEVD" = xyes; then
82
+  CONFIG_DEVD_TRUE=
83
+  CONFIG_DEVD_FALSE='#'
84
+else
85
+  CONFIG_DEVD_TRUE='#'
86
+  CONFIG_DEVD_FALSE=
87
+fi
88
+
89
+if test "x$CONFIG_DEVD" = xyes; then
90
+
91
+$as_echo "#define CONFIG_DEVD 1" >>confdefs.h
92
+
93
+fi
94
+
95
+if test "x$CONFIG_UDEV" != xno; then
96
 
97
 pkg_failed=no
98
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UDEV" >&5
99
@@ -25884,11 +25924,12 @@ else
100
 $as_echo "yes" >&6; }
101
 	HAVE_LIBUDEV=yes
102
 fi
103
-if test "x$CONFIG_UDEV" = xauto; then
104
-	CONFIG_UDEV="$HAVE_LIBUDEV"
105
+	if test "x$CONFIG_UDEV" = xauto; then
106
+		CONFIG_UDEV="$HAVE_LIBUDEV"
107
 
108
 $as_echo "#define HAVE_LIBUDEV 1" >>confdefs.h
109
 
110
+	fi
111
 fi
112
  if test "x$CONFIG_UDEV" = xyes; then
113
   CONFIG_UDEV_TRUE=
114
@@ -26132,7 +26173,14 @@ fi
115
 
116
 if test "x$SYSTEMD_LOGIND" = xauto; then
117
         if test "x$HAVE_DBUS" = xyes -a "x$CONFIG_UDEV" = xyes ; then
118
-                SYSTEMD_LOGIND=yes
119
+            case $host_os in
120
+                *linux*)
121
+                        SYSTEMD_LOGIND=yes
122
+                        ;;
123
+                *)
124
+                        SYSTEMD_LOGIND=no
125
+                        ;;
126
+            esac
127
         else
128
                 SYSTEMD_LOGIND=no
129
         fi
130
@@ -32849,17 +32897,17 @@ DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER
131
 ac_config_commands="$ac_config_commands sdksyms"
132
 
133
 
134
-if test "x$CONFIG_HAL" = xno && test "x$CONFIG_UDEV" = xno; then
135
+if test "x$CONFIG_HAL" = xno && test "x$CONFIG_UDEV" = xno && test "x$CONFIG_DEVD" = xno; then
136
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
137
-             ***********************************************
138
-             Neither HAL nor udev backend will be enabled.
139
+             *****************************************************
140
+             Neither HAL, devd, nor udev backend will be enabled.
141
              Input device hotplugging will not be available!
142
-             ***********************************************" >&5
143
+             *****************************************************" >&5
144
 $as_echo "$as_me: WARNING:
145
-             ***********************************************
146
-             Neither HAL nor udev backend will be enabled.
147
+             *****************************************************
148
+             Neither HAL, devd, nor udev backend will be enabled.
149
              Input device hotplugging will not be available!
150
-             ***********************************************" >&2;}
151
+             *****************************************************" >&2;}
152
 fi
153
 
154
 ac_config_files="$ac_config_files Makefile glx/Makefile include/Makefile composite/Makefile damageext/Makefile dbe/Makefile dix/Makefile doc/Makefile doc/dtrace/Makefile man/Makefile fb/Makefile glamor/Makefile record/Makefile config/Makefile mi/Makefile miext/Makefile miext/sync/Makefile miext/damage/Makefile miext/shadow/Makefile miext/rootless/Makefile os/Makefile pseudoramiX/Makefile randr/Makefile render/Makefile xkb/Makefile Xext/Makefile Xi/Makefile xfixes/Makefile exa/Makefile dri3/Makefile present/Makefile hw/Makefile hw/xfree86/Makefile hw/xfree86/Xorg.sh hw/xfree86/common/Makefile hw/xfree86/common/xf86Build.h hw/xfree86/ddc/Makefile hw/xfree86/dixmods/Makefile hw/xfree86/doc/Makefile hw/xfree86/dri/Makefile hw/xfree86/dri2/Makefile hw/xfree86/dri2/pci_ids/Makefile hw/xfree86/drivers/Makefile hw/xfree86/drivers/modesetting/Makefile hw/xfree86/exa/Makefile hw/xfree86/exa/man/Makefile hw/xfree86/fbdevhw/Makefile hw/xfree86/fbdevhw/man/Makefile hw/xfree86/glamor_egl/Makefile hw/xfree86/i2c/Makefile hw/xfree86/int10/Makefile hw/xfree86/loader/Makefile hw/xfree86/man/Makefile hw/xfree86/modes/Makefile hw/xfree86/os-support/Makefile hw/xfree86/os-support/bsd/Makefile hw/xfree86/os-support/bus/Makefile hw/xfree86/os-support/hurd/Makefile hw/xfree86/os-support/misc/Makefile hw/xfree86/os-support/linux/Makefile hw/xfree86/os-support/solaris/Makefile hw/xfree86/os-support/stub/Makefile hw/xfree86/parser/Makefile hw/xfree86/ramdac/Makefile hw/xfree86/shadowfb/Makefile hw/xfree86/vbe/Makefile hw/xfree86/vgahw/Makefile hw/xfree86/x86emu/Makefile hw/xfree86/utils/Makefile hw/xfree86/utils/man/Makefile hw/xfree86/utils/cvt/Makefile hw/xfree86/utils/gtf/Makefile hw/dmx/config/Makefile hw/dmx/config/man/Makefile hw/dmx/doc/Makefile hw/dmx/doxygen/doxygen.conf hw/dmx/doxygen/Makefile hw/dmx/examples/Makefile hw/dmx/input/Makefile hw/dmx/glxProxy/Makefile hw/dmx/Makefile hw/dmx/man/Makefile hw/vfb/Makefile hw/vfb/man/Makefile hw/xnest/Makefile hw/xnest/man/Makefile hw/xwin/Makefile hw/xwin/dri/Makefile hw/xwin/glx/Makefile hw/xwin/man/Makefile hw/xwin/winclipboard/Makefile hw/xquartz/Makefile hw/xquartz/GL/Makefile hw/xquartz/bundle/Makefile hw/xquartz/man/Makefile hw/xquartz/mach-startup/Makefile hw/xquartz/pbproxy/Makefile hw/xquartz/xpr/Makefile hw/kdrive/Makefile hw/kdrive/ephyr/Makefile hw/kdrive/ephyr/man/Makefile hw/kdrive/fake/Makefile hw/kdrive/fbdev/Makefile hw/kdrive/linux/Makefile hw/kdrive/src/Makefile hw/xwayland/Makefile test/Makefile test/xi1/Makefile test/xi2/Makefile xserver.ent xorg-server.pc"
155
@@ -33122,6 +33170,10 @@ if test -z "${HAVE_SYSTEMD_DAEMON_TRUE}"
156
   as_fn_error $? "conditional \"HAVE_SYSTEMD_DAEMON\" was never defined.
157
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
158
 fi
159
+if test -z "${CONFIG_DEVD_TRUE}" && test -z "${CONFIG_DEVD_FALSE}"; then
160
+  as_fn_error $? "conditional \"CONFIG_DEVD\" was never defined.
161
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
162
+fi
163
 if test -z "${CONFIG_UDEV_TRUE}" && test -z "${CONFIG_UDEV_FALSE}"; then
164
   as_fn_error $? "conditional \"CONFIG_UDEV\" was never defined.
165
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
(-)x11-servers/xorg-server/files/patch-hw_xfree86_Makefile.in (+14 lines)
Line 0 Link Here
1
* Don't overwrite Xorg binary with Xorg.sh when SUID_WRAPPER_DIR == bindir
2
* Instead, relink bin/X to Xorg.wrap rather than to Xorg (which isn't Xorg.sh)
3
*
4
--- hw/xfree86/Makefile.in.orig	2017-03-16 05:24:43 UTC
5
+++ hw/xfree86/Makefile.in
6
@@ -1149,7 +1149,7 @@ install-exec-hook:
7
 @INSTALL_SETUID_TRUE@	chmod u+s $(DESTDIR)$(bindir)/Xorg
8
 @SUID_WRAPPER_TRUE@	$(MKDIR_P) $(DESTDIR)$(SUID_WRAPPER_DIR)
9
 @SUID_WRAPPER_TRUE@	mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg
10
-@SUID_WRAPPER_TRUE@	${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg
11
+@SUID_WRAPPER_TRUE@	(test ! -f $(DESTDIR)$(bindir)/Xorg && ${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg || cd $(DESTDIR)$(bindir) && rm -f X && $(LN_S) Xorg.wrap$(EXEEXT) X)
12
 @SUID_WRAPPER_TRUE@	-chown root $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap
13
 
14
 uninstall-local:
(-)x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86AutoConfig.c (-1 / +5 lines)
Lines 1-4 Link Here
1
--- hw/xfree86/common/xf86AutoConfig.c.orig	2017-01-11 20:00:58 UTC
1
* Try using modesetting driver before falling back to scfb or vesa
2
*
3
* Use our scfb driver as fallback instead of Linux's fbdev
4
*
5
--- hw/xfree86/common/xf86AutoConfig.c.orig	2017-03-15 18:05:25 UTC
2
+++ hw/xfree86/common/xf86AutoConfig.c
6
+++ hw/xfree86/common/xf86AutoConfig.c
3
@@ -276,7 +276,7 @@ listPossibleVideoDrivers(char *matches[]
7
@@ -276,7 +276,7 @@ listPossibleVideoDrivers(char *matches[]
4
         i += xf86PciMatchDriver(&matches[i], nmatches - i);
8
         i += xf86PciMatchDriver(&matches[i], nmatches - i);
(-)x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Config.c (-3 / +5 lines)
Lines 1-12 Link Here
1
--- hw/xfree86/common/xf86Config.c.orig	2016-07-19 17:14:30 UTC
1
* Select the devd config backend if it is activated
2
*
3
--- hw/xfree86/common/xf86Config.c.orig	2017-03-15 18:05:25 UTC
2
+++ hw/xfree86/common/xf86Config.c
4
+++ hw/xfree86/common/xf86Config.c
3
@@ -1410,13 +1410,16 @@ checkCoreInputDevices(serverLayoutPtr se
5
@@ -1375,13 +1375,16 @@ checkCoreInputDevices(serverLayoutPtr se
4
     }
6
     }
5
 
7
 
6
     if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) {
8
     if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) {
7
-#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
9
-#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
8
+#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) || \
10
+#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) || \
9
+		defined(CONFIG_DEVD)
11
+	defined(CONFIG_DEVD)
10
         const char *config_backend;
12
         const char *config_backend;
11
 
13
 
12
 #if defined(CONFIG_HAL)
14
 #if defined(CONFIG_HAL)
(-)x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Globals.c (-1 / +3 lines)
Lines 1-4 Link Here
1
--- hw/xfree86/common/xf86Globals.c.orig	2016-07-19 17:07:29 UTC
1
* Include devd in the set of config backends
2
*
3
--- hw/xfree86/common/xf86Globals.c.orig	2017-03-15 18:05:25 UTC
2
+++ hw/xfree86/common/xf86Globals.c
4
+++ hw/xfree86/common/xf86Globals.c
3
@@ -122,7 +122,8 @@ xf86InfoRec xf86Info = {
5
@@ -122,7 +122,8 @@ xf86InfoRec xf86Info = {
4
     .pmFlag = TRUE,
6
     .pmFlag = TRUE,
(-)x11-servers/xorg-server/files/patch-hw_xfree86_common_xf86Xinput.c (-3 / +5 lines)
Lines 1-6 Link Here
1
--- hw/xfree86/common/xf86Xinput.c.orig	2016-07-19 17:07:29 UTC
1
* Recognize devd backend as a source of auto-configured devices
2
*
3
--- hw/xfree86/common/xf86Xinput.c.orig	2017-03-15 18:05:25 UTC
2
+++ hw/xfree86/common/xf86Xinput.c
4
+++ hw/xfree86/common/xf86Xinput.c
3
@@ -841,7 +841,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, D
5
@@ -871,7 +871,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, D
4
 {
6
 {
5
     InputDriverPtr drv = NULL;
7
     InputDriverPtr drv = NULL;
6
     DeviceIntPtr dev = NULL;
8
     DeviceIntPtr dev = NULL;
Lines 9-15 Link Here
9
     int rval;
11
     int rval;
10
     char *path = NULL;
12
     char *path = NULL;
11
 
13
 
12
@@ -996,6 +996,7 @@ NewInputDeviceRequest(InputOption *optio
14
@@ -1034,6 +1034,7 @@ NewInputDeviceRequest(InputOption *optio
13
         if (strcmp(key, "_source") == 0 &&
15
         if (strcmp(key, "_source") == 0 &&
14
             (strcmp(value, "server/hal") == 0 ||
16
             (strcmp(value, "server/hal") == 0 ||
15
              strcmp(value, "server/udev") == 0 ||
17
              strcmp(value, "server/udev") == 0 ||
(-)x11-servers/xorg-server/files/patch-hw_xfree86_os-support_bsd_bsd__init.c (-1 / +1 lines)
Lines 1-4 Link Here
1
--- hw/xfree86/os-support/bsd/bsd_init.c.orig	2016-07-19 17:07:29 UTC
1
--- hw/xfree86/os-support/bsd/bsd_init.c.orig	2017-03-15 18:05:25 UTC
2
+++ hw/xfree86/os-support/bsd/bsd_init.c
2
+++ hw/xfree86/os-support/bsd/bsd_init.c
3
@@ -230,6 +230,9 @@ xf86OpenConsole()
3
@@ -230,6 +230,9 @@ xf86OpenConsole()
4
              * Add cases for other *BSD that behave the same.
4
              * Add cases for other *BSD that behave the same.
(-)x11-servers/xorg-server/files/patch-hw_xfree86_os-support_bsd_i386__video.c (-1 / +1 lines)
Lines 1-5 Link Here
1
Index: programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c
1
Index: programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c
2
--- hw/xfree86/os-support/bsd/i386_video.c.orig	2016-07-15 16:18:11 UTC
2
--- hw/xfree86/os-support/bsd/i386_video.c.orig	2017-03-15 18:05:25 UTC
3
+++ hw/xfree86/os-support/bsd/i386_video.c
3
+++ hw/xfree86/os-support/bsd/i386_video.c
4
@@ -32,6 +32,7 @@
4
@@ -32,6 +32,7 @@
5
 #include "xf86Priv.h"
5
 #include "xf86Priv.h"
(-)x11-servers/xorg-server/files/patch-hw_xfree86_os-support_bsd_ppc__video.c (-1 / +1 lines)
Lines 1-4 Link Here
1
--- hw/xfree86/os-support/bsd/ppc_video.c.orig	2016-07-15 16:18:11 UTC
1
--- hw/xfree86/os-support/bsd/ppc_video.c.orig	2017-03-15 18:05:25 UTC
2
+++ hw/xfree86/os-support/bsd/ppc_video.c
2
+++ hw/xfree86/os-support/bsd/ppc_video.c
3
@@ -79,7 +79,11 @@ xf86DisableIO()
3
@@ -79,7 +79,11 @@ xf86DisableIO()
4
 {
4
 {
(-)x11-servers/xorg-server/files/patch-hw_xfree86_xorg-wrapper.c (+27 lines)
Line 0 Link Here
1
* Skip the detection of root rights requirement, the assumption that presence
2
* of KMS drivers removes the root requirement is only valid for Linux
3
*
4
--- hw/xfree86/xorg-wrapper.c.orig	2017-03-15 18:05:25 UTC
5
+++ hw/xfree86/xorg-wrapper.c
6
@@ -188,9 +188,6 @@ static int on_console(int fd)
7
 
8
 int main(int argc, char *argv[])
9
 {
10
-#ifdef WITH_LIBDRM
11
-    struct drm_mode_card_res res;
12
-#endif
13
     char buf[PATH_MAX];
14
     int i, r, fd;
15
     int kms_cards = 0;
16
@@ -227,9 +224,10 @@ int main(int argc, char *argv[])
17
         }
18
     }
19
 
20
-#ifdef WITH_LIBDRM
21
+#if defined(WITH_LIBDRM) && defined(__linux__)
22
     /* Detect if we need root rights, except when overriden by the config */
23
     if (needs_root_rights == -1) {
24
+        struct drm_mode_card_res res;
25
         for (i = 0; i < 16; i++) {
26
             snprintf(buf, sizeof(buf), DRM_DEV_NAME, DRM_DIR_NAME, i);
27
             fd = open(buf, O_RDWR);
(-)x11-servers/xorg-server/files/patch-include_dix-config.h.in (+14 lines)
Line 0 Link Here
1
* Add a define which will be toggled by configure when devd backend is activated
2
*
3
--- include/dix-config.h.in.orig	2017-03-15 18:05:25 UTC
4
+++ include/dix-config.h.in
5
@@ -433,6 +433,9 @@
6
 /* Support D-Bus */
7
 #undef HAVE_DBUS
8
 
9
+/* Use devd for input hotplug */
10
+#undef CONFIG_DEVD
11
+
12
 /* Use libudev for input hotplug */
13
 #undef CONFIG_UDEV
14
 
(-)x11-servers/xorg-server/files/patch-xkb_Makefile.in (-2 / +7 lines)
Lines 1-6 Link Here
1
--- xkb/Makefile.in.orig	2017-01-19 15:20:42 UTC
1
* Skip installing a README into a directory which is actually a symlink created
2
* by another port. If this file is installed, then upon uninstall pkg will
3
* delete the directory under the symlink, which would cause a reinstall to fail
4
* as the target directory is not remade until reinstalling the other port
5
*
6
--- xkb/Makefile.in.orig	2017-03-16 05:24:43 UTC
2
+++ xkb/Makefile.in
7
+++ xkb/Makefile.in
3
@@ -878,7 +878,7 @@ info: info-am
8
@@ -886,7 +886,7 @@ info: info-am
4
 
9
 
5
 info-am:
10
 info-am:
6
 
11
 
(-)x11-servers/xorg-server/files/xkb_Makefile.am (+13 lines)
Line 0 Link Here
1
* Skip installing a README into a directory which is actually a symlink created
2
* by another port. If this file is installed, then upon uninstall pkg will
3
* delete the directory under the symlink, which would cause a reinstall to fail
4
* as the target directory is not remade until reinstalling the other port
5
*
6
--- xkb/Makefile.am.orig	2017-03-16 05:24:43 UTC
7
+++ xkb/Makefile.am
8
@@ -39,4 +39,4 @@ libxkbstubs_la_SOURCES = ddxVT.c ddxPriv
9
 EXTRA_DIST = xkbDflts.h xkbgeom.h xkb.h
10
 
11
 xkbcompileddir = $(XKB_COMPILED_DIR)
12
-dist_xkbcompiled_DATA = README.compiled
13
+#dist_xkbcompiled_DATA = README.compiled
(-)x11-servers/xorg-server/pkg-plist (-3 / +6 lines)
Lines 1-6 Link Here
1
bin/X
1
bin/X
2
%%SUID%%@(,,4555) bin/Xorg
2
bin/Xorg
3
%%NO_SUID%%bin/Xorg
3
%%SUID%%@(,,4555) bin/Xorg.wrap
4
bin/cvt
4
bin/cvt
5
bin/gtf
5
bin/gtf
6
include/xorg/BT.h
6
include/xorg/BT.h
Lines 159-165 Link Here
159
include/xorg/xorg-server.h
159
include/xorg/xorg-server.h
160
include/xorg/xorgVersion.h
160
include/xorg/xorgVersion.h
161
include/xorg/xserver-properties.h
161
include/xorg/xserver-properties.h
162
@comment include/xorg/xserver_poll.h
162
include/xorg/xserver_poll.h
163
include/xorg/xvdix.h
163
include/xorg/xvdix.h
164
include/xorg/xvmcext.h
164
include/xorg/xvmcext.h
165
lib/xorg/modules/drivers/modesetting_drv.so
165
lib/xorg/modules/drivers/modesetting_drv.so
Lines 177-182 Link Here
177
lib/xorg/protocol.txt
177
lib/xorg/protocol.txt
178
libdata/pkgconfig/xorg-server.pc
178
libdata/pkgconfig/xorg-server.pc
179
man/man1/Xorg.1.gz
179
man/man1/Xorg.1.gz
180
%%SUID%%man/man1/Xorg.wrap.1.gz
180
man/man1/Xserver.1.gz
181
man/man1/Xserver.1.gz
181
man/man1/cvt.1.gz
182
man/man1/cvt.1.gz
182
man/man1/gtf.1.gz
183
man/man1/gtf.1.gz
Lines 183-189 Link Here
183
man/man4/exa.4.gz
184
man/man4/exa.4.gz
184
man/man4/fbdevhw.4.gz
185
man/man4/fbdevhw.4.gz
185
man/man4/modesetting.4.gz
186
man/man4/modesetting.4.gz
187
%%SUID%%man/man5/Xwrapper.config.5.gz
186
man/man5/xorg.conf.5.gz
188
man/man5/xorg.conf.5.gz
187
man/man5/xorg.conf.d.5.gz
189
man/man5/xorg.conf.d.5.gz
190
%%UDEV%%share/X11/xorg.conf.d/10-quirks.conf
188
share/aclocal/xorg-server.m4
191
share/aclocal/xorg-server.m4
189
@dir etc/X11/xorg.conf.d
192
@dir etc/X11/xorg.conf.d
(-)x11-servers/xorg-vfbserver/Makefile (-6 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	xorg-vfbserver
4
PORTNAME=	xorg-vfbserver
5
PORTVERSION=	1.19.1
6
PORTEPOCH=	1
5
PORTEPOCH=	1
7
6
8
COMMENT=	X virtual framebuffer server from X.Org
7
COMMENT=	X virtual framebuffer server from X.Org
Lines 11-24 Link Here
11
10
12
MASTERDIR=	${.CURDIR}/../xorg-server
11
MASTERDIR=	${.CURDIR}/../xorg-server
13
DESCR=		${.CURDIR}/pkg-descr
12
DESCR=		${.CURDIR}/pkg-descr
14
DISTINFO_FILE=	${.CURDIR}/distinfo
15
PATCHDIR=	${.CURDIR}/files
16
13
17
SLAVE_PORT=	yes
14
SLAVE_PORT=	yes
18
OPTIONS_EXCLUDE=DEVD HAL SUID
19
15
20
USE_XORG=	xfont2
21
22
CONFIGURE_ARGS+=--enable-xvfb --disable-dmx --disable-xephyr --disable-xnest \
16
CONFIGURE_ARGS+=--enable-xvfb --disable-dmx --disable-xephyr --disable-xnest \
23
		--disable-xwayland
17
		--disable-xwayland
24
18
(-)x11-servers/xorg-vfbserver/distinfo (-3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1484389062
2
SHA256 (xorg/xserver/xorg-server-1.19.1.tar.bz2) = 79ae2cf39d3f6c4a91201d8dad549d1d774b3420073c5a70d390040aa965a7fb
3
SIZE (xorg/xserver/xorg-server-1.19.1.tar.bz2) = 6041792
(-)x11-servers/xwayland/Makefile (-9 / +3 lines)
Lines 1-7 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTNAME=	xwayland
3
PORTNAME=	xwayland
4
PORTVERSION=	1.19.1
5
4
6
COMMENT=	X Clients under Wayland
5
COMMENT=	X Clients under Wayland
7
6
Lines 13-30 Link Here
13
12
14
MASTERDIR=	${.CURDIR}/../xorg-server
13
MASTERDIR=	${.CURDIR}/../xorg-server
15
DESCR=		${.CURDIR}/pkg-descr
14
DESCR=		${.CURDIR}/pkg-descr
16
DISTINFO_FILE=	${.CURDIR}/distinfo
17
PATCHDIR=	${.CURDIR}/files
18
15
19
SLAVE_PORT=	yes
16
SLAVE_PORT=	yes
20
OPTIONS_EXCLUDE=DEVD HAL SUID
17
USE_XORG=	x11 xext
21
22
USE_XORG=	x11 xext xfont2
23
USE_GL+=	egl gbm
18
USE_GL+=	egl gbm
24
19
25
CONFIGURE_ARGS+=	--disable-docs --disable-devel-docs \
20
CONFIGURE_ARGS+=--disable-dmx --disable-xephyr --disable-xnest --disable-xvfb \
26
			--enable-xwayland --disable-xorg --disable-xvfb --disable-xnest \
21
		--enable-xwayland 
27
			--disable-xquartz --disable-xwin
28
22
29
PLIST_FILES=	bin/Xwayland
23
PLIST_FILES=	bin/Xwayland
30
24
(-)x11-servers/xwayland/distinfo (-3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1484388904
2
SHA256 (xorg/xserver/xorg-server-1.19.1.tar.bz2) = 79ae2cf39d3f6c4a91201d8dad549d1d774b3420073c5a70d390040aa965a7fb
3
SIZE (xorg/xserver/xorg-server-1.19.1.tar.bz2) = 6041792

Return to bug 196678