eee5ef9
From ad6c5e450cacee3777e7c541d4841ee580339a5d Mon Sep 17 00:00:00 2001
eee5ef9
From: Peter Hutterer <peter.hutterer@who-t.net>
eee5ef9
Date: Wed, 7 Apr 2010 10:04:38 +1000
eee5ef9
Subject: [PATCH 1/6] config: only match sane devices in 10-evdev.conf
eee5ef9
eee5ef9
Having a generic catchall also adds devices like accelerometers. These
eee5ef9
devices make X unusable, hence restrict matching to "known sane" devices
eee5ef9
like pointers, touchpads, keyboards, tablets and touchscreens.
eee5ef9
eee5ef9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
eee5ef9
Acked-by: Julien Cristau <jcristau@debian.org>
eee5ef9
Acked-by: Dan Nicholson <dbn.lists@gmail.com>
eee5ef9
Acked-by: James Cloos <cloos@jhcloos.com>
eee5ef9
(cherry picked from commit c8a608cb6ce8f9c86258c1ab49084f691fa9cc51)
eee5ef9
eee5ef9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
eee5ef9
---
eee5ef9
 config/10-evdev.conf |   36 ++++++++++++++++++++++++++++++++++--
eee5ef9
 1 files changed, 34 insertions(+), 2 deletions(-)
eee5ef9
eee5ef9
diff --git a/config/10-evdev.conf b/config/10-evdev.conf
eee5ef9
index 7406f4e..cc83ab2 100644
eee5ef9
--- a/config/10-evdev.conf
eee5ef9
+++ b/config/10-evdev.conf
eee5ef9
@@ -1,8 +1,40 @@
eee5ef9
 #
eee5ef9
 # Catch-all evdev loader for udev-based systems
eee5ef9
-#
eee5ef9
+# We don't simply match on any device since that also adds accelerometers
eee5ef9
+# and other devices that we don't really want to use. The list below
eee5ef9
+# matches everything but joysticks.
eee5ef9
+
eee5ef9
 Section "InputClass"
eee5ef9
-        Identifier "evdev-catchall"
eee5ef9
+        Identifier "evdev pointer catchall"
eee5ef9
+        MatchIsPointer "on"
eee5ef9
+        MatchDevicePath "/dev/input/event*"
eee5ef9
         Driver "evdev"
eee5ef9
+EndSection
eee5ef9
+
eee5ef9
+Section "InputClass"
eee5ef9
+        Identifier "evdev keyboard catchall"
eee5ef9
+        MatchIsKeyboard "on"
eee5ef9
         MatchDevicePath "/dev/input/event*"
eee5ef9
+        Driver "evdev"
eee5ef9
+EndSection
eee5ef9
+
eee5ef9
+Section "InputClass"
eee5ef9
+        Identifier "evdev touchpad catchall"
eee5ef9
+        MatchIsTouchpad "on"
eee5ef9
+        MatchDevicePath "/dev/input/event*"
eee5ef9
+        Driver "evdev"
eee5ef9
+EndSection
eee5ef9
+
eee5ef9
+Section "InputClass"
eee5ef9
+        Identifier "evdev tablet catchall"
eee5ef9
+        MatchIsTablet "on"
eee5ef9
+        MatchDevicePath "/dev/input/event*"
eee5ef9
+        Driver "evdev"
eee5ef9
+EndSection
eee5ef9
+
eee5ef9
+Section "InputClass"
eee5ef9
+        Identifier "evdev touchscreen catchall"
eee5ef9
+        MatchIsTouchscreen "on"
eee5ef9
+        MatchDevicePath "/dev/input/event*"
eee5ef9
+        Driver "evdev"
eee5ef9
 EndSection
eee5ef9
-- 
eee5ef9
1.6.6.1
eee5ef9
eee5ef9
From eb07b8606f9a1349baf8114bb36dc2712e5d3419 Mon Sep 17 00:00:00 2001
eee5ef9
From: Dan Nicholson <dbn.lists@gmail.com>
eee5ef9
Date: Sat, 3 Apr 2010 09:33:47 -0700
eee5ef9
Subject: [PATCH 2/6] xfree86: Allow adding sysconfdir and datadir to config search paths
eee5ef9
eee5ef9
We could just use $projectroot/etc and $projectroot/share, but the user
eee5ef9
might have other plans for them.
eee5ef9
eee5ef9
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
eee5ef9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
eee5ef9
(cherry picked from commit 2460e921d18fd264e6f6374be0908f4100442650)
eee5ef9
eee5ef9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
eee5ef9
---
eee5ef9
 hw/xfree86/parser/Makefile.am |    4 +++-
eee5ef9
 hw/xfree86/parser/scan.c      |   14 ++++++++++++++
eee5ef9
 2 files changed, 17 insertions(+), 1 deletions(-)
eee5ef9
eee5ef9
diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am
eee5ef9
index 49c191f..caf7079 100644
eee5ef9
--- a/hw/xfree86/parser/Makefile.am
eee5ef9
+++ b/hw/xfree86/parser/Makefile.am
eee5ef9
@@ -34,7 +34,9 @@ libxf86config_a_SOURCES = \
eee5ef9
 	$(INTERNAL_SOURCES)
eee5ef9
 libxf86config_a_CFLAGS = $(AM_CFLAGS) -fPIC -fvisibility=hidden
eee5ef9
 
eee5ef9
-AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
eee5ef9
+AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) \
eee5ef9
+	-DSYSCONFDIR=\"$(sysconfdir)\" \
eee5ef9
+	-DDATADIR=\"$(datadir)\"
eee5ef9
 
eee5ef9
 EXTRA_DIST = \
eee5ef9
 	Configint.h \
eee5ef9
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
eee5ef9
index cdca9ca..8aab0cf 100644
eee5ef9
--- a/hw/xfree86/parser/scan.c
eee5ef9
+++ b/hw/xfree86/parser/scan.c
eee5ef9
@@ -599,6 +599,8 @@ xf86pathIsSafe(const char *path)
eee5ef9
  *    %F    config file environment ($XORGCONFIG) as a relative path
eee5ef9
  *    %G    config file environment ($XORGCONFIG) as a safe path
eee5ef9
  *    %P    projroot
eee5ef9
+ *    %C    sysconfdir
eee5ef9
+ *    %D    datadir
eee5ef9
  *    %M    major version number
eee5ef9
  *    %%    %
eee5ef9
  */
eee5ef9
@@ -615,6 +617,12 @@ xf86pathIsSafe(const char *path)
eee5ef9
 #ifndef PROJECTROOT
eee5ef9
 #define PROJECTROOT	"/usr/X11R6"
eee5ef9
 #endif
eee5ef9
+#ifndef SYSCONFDIR
eee5ef9
+#define SYSCONFDIR	PROJECTROOT "/etc"
eee5ef9
+#endif
eee5ef9
+#ifndef DATADIR
eee5ef9
+#define DATADIR		PROJECTROOT "/share"
eee5ef9
+#endif
eee5ef9
 #ifndef XCONFENV
eee5ef9
 #define XCONFENV	"XORGCONFIG"
eee5ef9
 #endif
eee5ef9
@@ -755,6 +763,12 @@ DoSubstitution(const char *template, const char *cmdline, const char *projroot,
eee5ef9
 				else
eee5ef9
 					BAIL_OUT;
eee5ef9
 				break;
eee5ef9
+			case 'C':
eee5ef9
+				APPEND_STR(SYSCONFDIR);
eee5ef9
+				break;
eee5ef9
+			case 'D':
eee5ef9
+				APPEND_STR(DATADIR);
eee5ef9
+				break;
eee5ef9
 			case 'M':
eee5ef9
 				if (!majorvers[0]) {
eee5ef9
 					if (XF86_VERSION_MAJOR < 0 || XF86_VERSION_MAJOR > 99) {
eee5ef9
-- 
eee5ef9
1.6.6.1
eee5ef9
eee5ef9
From a4516965de447332794ee0afb9503c351fff6fe8 Mon Sep 17 00:00:00 2001
eee5ef9
From: Dan Nicholson <dbn.lists@gmail.com>
eee5ef9
Date: Sat, 3 Apr 2010 09:33:48 -0700
eee5ef9
Subject: [PATCH 3/6] xfree86: Document how -configdir affects the xorg.conf.d search path
eee5ef9
eee5ef9
Explain the "safe" path dance for -configdir, too.
eee5ef9
eee5ef9
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
eee5ef9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
eee5ef9
(cherry picked from commit 2ac33888a9a5766aaf88bc92a8bd1d489873524c)
eee5ef9
eee5ef9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
eee5ef9
---
eee5ef9
 hw/xfree86/doc/man/xorg.conf.man.pre |   36 +++++++++++++++++++++++++++++++++-
eee5ef9
 1 files changed, 35 insertions(+), 1 deletions(-)
eee5ef9
eee5ef9
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
eee5ef9
index 93c8ac4..9a40ce3 100644
eee5ef9
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
eee5ef9
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
eee5ef9
@@ -102,10 +102,12 @@ is the machine's hostname as reported by
eee5ef9
 .BR gethostname (__libmansuffix__).
eee5ef9
 .PP
eee5ef9
 Additional configuration files are searched for in the following
eee5ef9
-directories:
eee5ef9
+directories when the server is started as a normal user:
eee5ef9
 .PP
eee5ef9
 .RS 4
eee5ef9
 .nf
eee5ef9
+.IR /etc/X11/ <cmdline>
eee5ef9
+.IR __projectroot__/etc/X11/ <cmdline>
eee5ef9
 .I /etc/X11/__xconfigdir__\-4
eee5ef9
 .I /etc/X11/__xconfigdir__
eee5ef9
 .I /etc/__xconfigdir__
eee5ef9
@@ -118,6 +120,38 @@ directories:
eee5ef9
 .fi
eee5ef9
 .RE
eee5ef9
 .PP
eee5ef9
+where
eee5ef9
+.I <cmdline>
eee5ef9
+is a relative path (with no \(lq..\(rq components) specified with the
eee5ef9
+.B \-configdir
eee5ef9
+command line option.
eee5ef9
+.PP
eee5ef9
+When the __xservername__ server is started by the \(lqroot\(rq user, the
eee5ef9
+config directory search locations are as follows:
eee5ef9
+.PP
eee5ef9
+.RS 4
eee5ef9
+.nf
eee5ef9
+<cmdline>
eee5ef9
+.IR /etc/X11/ <cmdline>
eee5ef9
+.IR __projectroot__/etc/X11/ <cmdline>
eee5ef9
+.I /etc/X11/__xconfigdir__\-4
eee5ef9
+.I /etc/X11/__xconfigdir__
eee5ef9
+.I /etc/__xconfigdir__
eee5ef9
+.IR __projectroot__/etc/X11/__xconfigdir__. <hostname>
eee5ef9
+.I __projectroot__/etc/X11/__xconfigdir__\-4
eee5ef9
+.I __projectroot__/etc/X11/__xconfigdir__
eee5ef9
+.IR __projectroot__/lib/X11/__xconfigdir__. <hostname>
eee5ef9
+.I __projectroot__/lib/X11/__xconfigdir__\-4
eee5ef9
+.I __projectroot__/lib/X11/__xconfigdir__
eee5ef9
+.fi
eee5ef9
+.RE
eee5ef9
+.PP
eee5ef9
+where
eee5ef9
+.I <cmdline>
eee5ef9
+is the path specified with the
eee5ef9
+.B \-configdir
eee5ef9
+command line option (which may be absolute or relative).
eee5ef9
+.PP
eee5ef9
 The
eee5ef9
 .I __xconfigfile__
eee5ef9
 and
eee5ef9
-- 
eee5ef9
1.6.6.1
eee5ef9
eee5ef9
From 0c4a358eae0e77f389380bbbf39d4419f2dd6dcd Mon Sep 17 00:00:00 2001
eee5ef9
From: Dan Nicholson <dbn.lists@gmail.com>
eee5ef9
Date: Sat, 3 Apr 2010 09:33:49 -0700
eee5ef9
Subject: [PATCH 4/6] xfree86: Set a saner search path for xorg.conf.d
eee5ef9
eee5ef9
There's no reason to carry all the oddities from xorg.conf like appended
eee5ef9
hostname to the search path for xorg.conf.d. This changes it to something
eee5ef9
very simple:
eee5ef9
eee5ef9
	/etc/X11/<cmdline>
eee5ef9
	$sysconfdir/X11/<cmdline>
eee5ef9
	/etc/X11/xorg.conf.d
eee5ef9
	$sysconfdir/X11/xorg.conf.d
eee5ef9
eee5ef9
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
eee5ef9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
eee5ef9
(cherry picked from commit a1bae63dc634a5a79861eab128c63506081f7ed9)
eee5ef9
eee5ef9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
eee5ef9
---
eee5ef9
 cpprules.in                          |    1 +
eee5ef9
 hw/xfree86/common/xf86Config.c       |   16 ++++------------
eee5ef9
 hw/xfree86/doc/man/xorg.conf.man.pre |   22 ++++------------------
eee5ef9
 3 files changed, 9 insertions(+), 30 deletions(-)
eee5ef9
eee5ef9
diff --git a/cpprules.in b/cpprules.in
eee5ef9
index 301305e..6e43578 100644
eee5ef9
--- a/cpprules.in
eee5ef9
+++ b/cpprules.in
eee5ef9
@@ -34,6 +34,7 @@ MANDEFS = \
eee5ef9
 	-D__adminmansuffix__=$(ADMIN_MAN_SUFFIX) \
eee5ef9
 	-D__mandir__=$(mandir) \
eee5ef9
 	-D__projectroot__=$(prefix) \
eee5ef9
+	-D__sysconfdir__=$(sysconfdir) \
eee5ef9
 	-D__datadir__=$(datadir) \
eee5ef9
 	-D__xconfigfile__=$(__XCONFIGFILE__) \
eee5ef9
 	-D__xconfigdir__=$(__XCONFIGDIR__) \
eee5ef9
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
eee5ef9
index 718a078..d02c22a 100644
eee5ef9
--- a/hw/xfree86/common/xf86Config.c
eee5ef9
+++ b/hw/xfree86/common/xf86Config.c
eee5ef9
@@ -97,20 +97,12 @@ extern DeviceAssocRec mouse_assoc;
eee5ef9
 #endif
eee5ef9
 #ifndef ROOT_CONFIGDIRPATH
eee5ef9
 #define ROOT_CONFIGDIRPATH	"%A," "%R," \
eee5ef9
-				"/etc/X11/%R," "%P/etc/X11/%R," \
eee5ef9
-				"/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
eee5ef9
-				"%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
eee5ef9
-				"%P/etc/X11/%X," \
eee5ef9
-				"%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
eee5ef9
-				"%P/lib/X11/%X"
eee5ef9
+				"/etc/X11/%R," "%C/X11/%R," \
eee5ef9
+				"/etc/X11/%X," "%C/X11/%X"
eee5ef9
 #endif
eee5ef9
 #ifndef USER_CONFIGDIRPATH
eee5ef9
-#define USER_CONFIGDIRPATH	"/etc/X11/%S," "%P/etc/X11/%S," \
eee5ef9
-				"/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
eee5ef9
-				"%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
eee5ef9
-				"%P/etc/X11/%X," \
eee5ef9
-				"%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
eee5ef9
-				"%P/lib/X11/%X"
eee5ef9
+#define USER_CONFIGDIRPATH	"/etc/X11/%R," "%C/X11/%R," \
eee5ef9
+				"/etc/X11/%X," "%C/X11/%X"
eee5ef9
 #endif
eee5ef9
 #ifndef PROJECTROOT
eee5ef9
 #define PROJECTROOT	"/usr/X11R6"
eee5ef9
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
eee5ef9
index 9a40ce3..acfa1ca 100644
eee5ef9
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
eee5ef9
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
eee5ef9
@@ -107,16 +107,9 @@ directories when the server is started as a normal user:
eee5ef9
 .RS 4
eee5ef9
 .nf
eee5ef9
 .IR /etc/X11/ <cmdline>
eee5ef9
-.IR __projectroot__/etc/X11/ <cmdline>
eee5ef9
-.I /etc/X11/__xconfigdir__\-4
eee5ef9
+.IR __sysconfdir__/X11/ <cmdline>
eee5ef9
 .I /etc/X11/__xconfigdir__
eee5ef9
-.I /etc/__xconfigdir__
eee5ef9
-.IR __projectroot__/etc/X11/__xconfigdir__. <hostname>
eee5ef9
-.I __projectroot__/etc/X11/__xconfigdir__\-4
eee5ef9
-.I __projectroot__/etc/X11/__xconfigdir__
eee5ef9
-.IR __projectroot__/lib/X11/__xconfigdir__. <hostname>
eee5ef9
-.I __projectroot__/lib/X11/__xconfigdir__\-4
eee5ef9
-.I __projectroot__/lib/X11/__xconfigdir__
eee5ef9
+.I __sysconfdir__/X11/__xconfigdir__
eee5ef9
 .fi
eee5ef9
 .RE
eee5ef9
 .PP
eee5ef9
@@ -133,16 +126,9 @@ config directory search locations are as follows:
eee5ef9
 .nf
eee5ef9
 <cmdline>
eee5ef9
 .IR /etc/X11/ <cmdline>
eee5ef9
-.IR __projectroot__/etc/X11/ <cmdline>
eee5ef9
-.I /etc/X11/__xconfigdir__\-4
eee5ef9
+.IR __sysconfdir__/X11/ <cmdline>
eee5ef9
 .I /etc/X11/__xconfigdir__
eee5ef9
-.I /etc/__xconfigdir__
eee5ef9
-.IR __projectroot__/etc/X11/__xconfigdir__. <hostname>
eee5ef9
-.I __projectroot__/etc/X11/__xconfigdir__\-4
eee5ef9
-.I __projectroot__/etc/X11/__xconfigdir__
eee5ef9
-.IR __projectroot__/lib/X11/__xconfigdir__. <hostname>
eee5ef9
-.I __projectroot__/lib/X11/__xconfigdir__\-4
eee5ef9
-.I __projectroot__/lib/X11/__xconfigdir__
eee5ef9
+.I __sysconfdir__/X11/__xconfigdir__
eee5ef9
 .fi
eee5ef9
 .RE
eee5ef9
 .PP
eee5ef9
-- 
eee5ef9
1.6.6.1
eee5ef9
eee5ef9
From 59f96734633fce3c2bee62bce860aed33033ce3e Mon Sep 17 00:00:00 2001
eee5ef9
From: Dan Nicholson <dbn.lists@gmail.com>
eee5ef9
Date: Sat, 3 Apr 2010 10:08:25 -0700
eee5ef9
Subject: [PATCH 5/6] xfree86: Search for a system xorg.conf.d
eee5ef9
eee5ef9
In addition to the conf files found in /etc/X11 or $sysconfdir/X11 used
eee5ef9
for local administration, we also reserve a system directory for vendor
eee5ef9
and package usage. The simple search path is:
eee5ef9
eee5ef9
	/usr/share/X11/xorg.conf.d
eee5ef9
	$datadir/X11/xorg.conf.d
eee5ef9
eee5ef9
Files from these directories will have the lowest config priority. The
eee5ef9
directory $datadir/X11/xorg.conf.d is exported from xorg-server.pc in
eee5ef9
the variable "sysconfigdir". Packages should install their .conf files
eee5ef9
to the directory specified by:
eee5ef9
eee5ef9
	`pkg-config --variable=sysconfigdir xorg-server`
eee5ef9
eee5ef9
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
eee5ef9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
eee5ef9
(cherry picked from commit 95f01bdfee8241371675f0089170fa6b2908d815)
eee5ef9
eee5ef9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
eee5ef9
---
eee5ef9
 configure.ac                         |    2 ++
eee5ef9
 hw/xfree86/common/xf86Config.c       |   12 ++++++++++--
eee5ef9
 hw/xfree86/doc/man/xorg.conf.man.pre |   12 ++++++++++++
eee5ef9
 xorg-server.pc.in                    |    2 ++
eee5ef9
 4 files changed, 26 insertions(+), 2 deletions(-)
eee5ef9
eee5ef9
diff --git a/configure.ac b/configure.ac
eee5ef9
index a76eda3..48cb724 100644
eee5ef9
--- a/configure.ac
eee5ef9
+++ b/configure.ac
eee5ef9
@@ -1792,8 +1792,10 @@ if test "x$XORG" = xyes; then
eee5ef9
 	AC_SUBST([driverdir])
eee5ef9
 	sdkdir="$includedir/xorg"
eee5ef9
 	extdir="$includedir/X11/extensions"
eee5ef9
+	sysconfigdir="$datadir/X11/$XF86CONFIGDIR"
eee5ef9
 	AC_SUBST([sdkdir])
eee5ef9
 	AC_SUBST([extdir])
eee5ef9
+	AC_SUBST([sysconfigdir])
eee5ef9
 	AC_SUBST([logdir])
eee5ef9
 
eee5ef9
 	# stuff the ABI versions into the pc file too
eee5ef9
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
eee5ef9
index d02c22a..1e9543f 100644
eee5ef9
--- a/hw/xfree86/common/xf86Config.c
eee5ef9
+++ b/hw/xfree86/common/xf86Config.c
eee5ef9
@@ -104,6 +104,9 @@ extern DeviceAssocRec mouse_assoc;
eee5ef9
 #define USER_CONFIGDIRPATH	"/etc/X11/%R," "%C/X11/%R," \
eee5ef9
 				"/etc/X11/%X," "%C/X11/%X"
eee5ef9
 #endif
eee5ef9
+#ifndef SYS_CONFIGDIRPATH
eee5ef9
+#define SYS_CONFIGDIRPATH	"/usr/share/X11/%X," "%D/X11/%X"
eee5ef9
+#endif
eee5ef9
 #ifndef PROJECTROOT
eee5ef9
 #define PROJECTROOT	"/usr/X11R6"
eee5ef9
 #endif
eee5ef9
@@ -2421,7 +2424,7 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout) {
eee5ef9
 ConfigStatus
eee5ef9
 xf86HandleConfigFile(Bool autoconfig)
eee5ef9
 {
eee5ef9
-    const char *filename, *dirname;
eee5ef9
+    const char *filename, *dirname, *sysdirname;
eee5ef9
     char *filesearch, *dirsearch;
eee5ef9
     MessageType filefrom = X_DEFAULT;
eee5ef9
     MessageType dirfrom = X_DEFAULT;
eee5ef9
@@ -2444,6 +2447,8 @@ xf86HandleConfigFile(Bool autoconfig)
eee5ef9
 	    dirfrom = X_CMDLINE;
eee5ef9
 
eee5ef9
 	xf86initConfigFiles();
eee5ef9
+	sysdirname = xf86openConfigDirFiles(SYS_CONFIGDIRPATH, NULL,
eee5ef9
+					    PROJECTROOT);
eee5ef9
 	dirname = xf86openConfigDirFiles(dirsearch, xf86ConfigDir, PROJECTROOT);
eee5ef9
 	filename = xf86openConfigFile(filesearch, xf86ConfigFile, PROJECTROOT);
eee5ef9
 	if (filename) {
eee5ef9
@@ -2464,7 +2469,10 @@ xf86HandleConfigFile(Bool autoconfig)
eee5ef9
 			"Unable to locate/open config directory: \"%s\"\n",
eee5ef9
 			xf86ConfigDir);
eee5ef9
 	}
eee5ef9
-	if (!filename && !dirname)
eee5ef9
+	if (sysdirname)
eee5ef9
+	    xf86MsgVerb(X_DEFAULT, 0, "Using system config directory \"%s\"\n",
eee5ef9
+			sysdirname);
eee5ef9
+	if (!filename && !dirname && !sysdirname)
eee5ef9
 	    return CONFIG_NOFILE;
eee5ef9
     }
eee5ef9
 
eee5ef9
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
eee5ef9
index acfa1ca..4782d61 100644
eee5ef9
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
eee5ef9
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
eee5ef9
@@ -138,6 +138,18 @@ is the path specified with the
eee5ef9
 .B \-configdir
eee5ef9
 command line option (which may be absolute or relative).
eee5ef9
 .PP
eee5ef9
+Finally, configuration files will also be searched for in directories
eee5ef9
+reserved for system use. These are to separate configuration files from
eee5ef9
+the vendor or 3rd party packages from those of local administration.
eee5ef9
+These files are found in the following directories:
eee5ef9
+.PP
eee5ef9
+.RS 4
eee5ef9
+.nf
eee5ef9
+.I /usr/share/X11/__xconfigdir__
eee5ef9
+.I __datadir__/X11/__xconfigdir__
eee5ef9
+.fi
eee5ef9
+.RE
eee5ef9
+.PP
eee5ef9
 The
eee5ef9
 .I __xconfigfile__
eee5ef9
 and
eee5ef9
diff --git a/xorg-server.pc.in b/xorg-server.pc.in
eee5ef9
index 3d58dab..376cb93 100644
eee5ef9
--- a/xorg-server.pc.in
eee5ef9
+++ b/xorg-server.pc.in
eee5ef9
@@ -2,8 +2,10 @@ prefix=@prefix@
eee5ef9
 exec_prefix=@exec_prefix@
eee5ef9
 libdir=@libdir@
eee5ef9
 includedir=@includedir@
eee5ef9
+datarootdir=@datarootdir@
eee5ef9
 moduledir=@moduledir@
eee5ef9
 sdkdir=@sdkdir@
eee5ef9
+sysconfigdir=@sysconfigdir@
eee5ef9
 
eee5ef9
 abi_ansic=@abi_ansic@
eee5ef9
 abi_videodrv=@abi_videodrv@
eee5ef9
-- 
eee5ef9
1.6.6.1
eee5ef9
eee5ef9
From 3e2ab9139b12b1239eebcbb6c6a23e7284dd7b44 Mon Sep 17 00:00:00 2001
eee5ef9
From: Dan Nicholson <dbn.lists@gmail.com>
eee5ef9
Date: Sat, 3 Apr 2010 09:33:51 -0700
eee5ef9
Subject: [PATCH 6/6] Move 10-evdev.conf to system config dir $datadir/X11/xorg.conf.d
eee5ef9
eee5ef9
Since the server searches in a vendor specific path now, we can install
eee5ef9
the evdev catchall there without disturbing local administration files.
eee5ef9
eee5ef9
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
eee5ef9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
eee5ef9
(cherry picked from commit d4dd3d0085f8eaca8c989aaeace1a1a24c5ebf49)
eee5ef9
eee5ef9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
eee5ef9
---
eee5ef9
 config/Makefile.am |    2 +-
eee5ef9
 1 files changed, 1 insertions(+), 1 deletions(-)
eee5ef9
eee5ef9
diff --git a/config/Makefile.am b/config/Makefile.am
eee5ef9
index eed7454..675a3b2 100644
eee5ef9
--- a/config/Makefile.am
eee5ef9
+++ b/config/Makefile.am
eee5ef9
@@ -9,7 +9,7 @@ AM_CFLAGS += $(UDEV_CFLAGS)
eee5ef9
 libconfig_la_SOURCES += udev.c
eee5ef9
 libconfig_la_LIBADD = $(UDEV_LIBS)
eee5ef9
 
eee5ef9
-xorgconfddir = $(prefix)/etc/X11/$(XF86CONFIGDIR)
eee5ef9
+xorgconfddir = $(datadir)/X11/$(XF86CONFIGDIR)
eee5ef9
 xorgconfd_DATA = 10-evdev.conf
eee5ef9
 
eee5ef9
 else
eee5ef9
-- 
eee5ef9
1.6.6.1
eee5ef9