xfree86: Search for a system xorg.conf.d
In addition to the conf files found in /etc/X11 or $sysconfdir/X11 used for local administration, we also reserve a system directory for vendor and package usage. The simple search path is: /usr/share/X11/xorg.conf.d $datadir/X11/xorg.conf.d Files from these directories will have the lowest config priority. The directory $datadir/X11/xorg.conf.d is exported from xorg-server.pc in the variable "sysconfigdir". Packages should install their .conf files to the directory specified by: `pkg-config --variable=sysconfigdir xorg-server` Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
a1bae63dc6
commit
95f01bdfee
|
@ -1792,8 +1792,10 @@ if test "x$XORG" = xyes; then
|
||||||
AC_SUBST([driverdir])
|
AC_SUBST([driverdir])
|
||||||
sdkdir="$includedir/xorg"
|
sdkdir="$includedir/xorg"
|
||||||
extdir="$includedir/X11/extensions"
|
extdir="$includedir/X11/extensions"
|
||||||
|
sysconfigdir="$datadir/X11/$XF86CONFIGDIR"
|
||||||
AC_SUBST([sdkdir])
|
AC_SUBST([sdkdir])
|
||||||
AC_SUBST([extdir])
|
AC_SUBST([extdir])
|
||||||
|
AC_SUBST([sysconfigdir])
|
||||||
AC_SUBST([logdir])
|
AC_SUBST([logdir])
|
||||||
|
|
||||||
# stuff the ABI versions into the pc file too
|
# stuff the ABI versions into the pc file too
|
||||||
|
|
|
@ -104,6 +104,9 @@ extern DeviceAssocRec mouse_assoc;
|
||||||
#define USER_CONFIGDIRPATH "/etc/X11/%R," "%C/X11/%R," \
|
#define USER_CONFIGDIRPATH "/etc/X11/%R," "%C/X11/%R," \
|
||||||
"/etc/X11/%X," "%C/X11/%X"
|
"/etc/X11/%X," "%C/X11/%X"
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef SYS_CONFIGDIRPATH
|
||||||
|
#define SYS_CONFIGDIRPATH "/usr/share/X11/%X," "%D/X11/%X"
|
||||||
|
#endif
|
||||||
#ifndef PROJECTROOT
|
#ifndef PROJECTROOT
|
||||||
#define PROJECTROOT "/usr/X11R6"
|
#define PROJECTROOT "/usr/X11R6"
|
||||||
#endif
|
#endif
|
||||||
|
@ -2421,7 +2424,7 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout) {
|
||||||
ConfigStatus
|
ConfigStatus
|
||||||
xf86HandleConfigFile(Bool autoconfig)
|
xf86HandleConfigFile(Bool autoconfig)
|
||||||
{
|
{
|
||||||
const char *filename, *dirname;
|
const char *filename, *dirname, *sysdirname;
|
||||||
char *filesearch, *dirsearch;
|
char *filesearch, *dirsearch;
|
||||||
MessageType filefrom = X_DEFAULT;
|
MessageType filefrom = X_DEFAULT;
|
||||||
MessageType dirfrom = X_DEFAULT;
|
MessageType dirfrom = X_DEFAULT;
|
||||||
|
@ -2444,6 +2447,8 @@ xf86HandleConfigFile(Bool autoconfig)
|
||||||
dirfrom = X_CMDLINE;
|
dirfrom = X_CMDLINE;
|
||||||
|
|
||||||
xf86initConfigFiles();
|
xf86initConfigFiles();
|
||||||
|
sysdirname = xf86openConfigDirFiles(SYS_CONFIGDIRPATH, NULL,
|
||||||
|
PROJECTROOT);
|
||||||
dirname = xf86openConfigDirFiles(dirsearch, xf86ConfigDir, PROJECTROOT);
|
dirname = xf86openConfigDirFiles(dirsearch, xf86ConfigDir, PROJECTROOT);
|
||||||
filename = xf86openConfigFile(filesearch, xf86ConfigFile, PROJECTROOT);
|
filename = xf86openConfigFile(filesearch, xf86ConfigFile, PROJECTROOT);
|
||||||
if (filename) {
|
if (filename) {
|
||||||
|
@ -2464,7 +2469,10 @@ xf86HandleConfigFile(Bool autoconfig)
|
||||||
"Unable to locate/open config directory: \"%s\"\n",
|
"Unable to locate/open config directory: \"%s\"\n",
|
||||||
xf86ConfigDir);
|
xf86ConfigDir);
|
||||||
}
|
}
|
||||||
if (!filename && !dirname)
|
if (sysdirname)
|
||||||
|
xf86MsgVerb(X_DEFAULT, 0, "Using system config directory \"%s\"\n",
|
||||||
|
sysdirname);
|
||||||
|
if (!filename && !dirname && !sysdirname)
|
||||||
return CONFIG_NOFILE;
|
return CONFIG_NOFILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,18 @@ is the path specified with the
|
||||||
.B \-configdir
|
.B \-configdir
|
||||||
command line option (which may be absolute or relative).
|
command line option (which may be absolute or relative).
|
||||||
.PP
|
.PP
|
||||||
|
Finally, configuration files will also be searched for in directories
|
||||||
|
reserved for system use. These are to separate configuration files from
|
||||||
|
the vendor or 3rd party packages from those of local administration.
|
||||||
|
These files are found in the following directories:
|
||||||
|
.PP
|
||||||
|
.RS 4
|
||||||
|
.nf
|
||||||
|
.I /usr/share/X11/__xconfigdir__
|
||||||
|
.I __datadir__/X11/__xconfigdir__
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
The
|
The
|
||||||
.I __xconfigfile__
|
.I __xconfigfile__
|
||||||
and
|
and
|
||||||
|
|
|
@ -2,8 +2,10 @@ prefix=@prefix@
|
||||||
exec_prefix=@exec_prefix@
|
exec_prefix=@exec_prefix@
|
||||||
libdir=@libdir@
|
libdir=@libdir@
|
||||||
includedir=@includedir@
|
includedir=@includedir@
|
||||||
|
datarootdir=@datarootdir@
|
||||||
moduledir=@moduledir@
|
moduledir=@moduledir@
|
||||||
sdkdir=@sdkdir@
|
sdkdir=@sdkdir@
|
||||||
|
sysconfigdir=@sysconfigdir@
|
||||||
|
|
||||||
abi_ansic=@abi_ansic@
|
abi_ansic=@abi_ansic@
|
||||||
abi_videodrv=@abi_videodrv@
|
abi_videodrv=@abi_videodrv@
|
||||||
|
|
Loading…
Reference in New Issue
Block a user