Name
getconfig - meta configuration files for getconfig(1)
Synopsis
*.cfg
Description
getconfig is a programmatic interface used by the XFree86® server to get configuration information about video hardware when operating without an XF86Config file.
This implementation of getconfig is written in perl and processes rules from meta-configuration files. All meta-configuration files have a .cfg suffix.
Comments can be specified in two (2) ways and in both cases, these lines are ignored:
- lines starting with a pound-sign (#)
- blank lines that consist wholly of white space
Commands:
Commands must be presented in a certain order otherwise they will either be ignored or incorrectly implemented. To ensure that you have specified the correct syntax, the following is the correct structure for issuing commands:
-
The first non-comment line must be a signature
string followed by the file format version number.
-
The signature string is:
"XFree86 Project getconfig rules file. Version: "
-
The version number is:
The currently defined version is "1.0".
-
The signature string is:
- Files that do not have the correct signature string are ignored.
The non-comment lines define rules. The start of a new rule is indicated by a line with no leading white space. Subsequent lines making up a rule must be indented with white space. Logical lines within a rule may be split over multiple physical lines by using the usual continuation convention ('\' at the end of the line).
The first logical line of each rule is a perl expression. It may be any valid perl expression whose evaluated (with 'eval') result may be used as the argument to a perl 'if' statement.
The second logical line should be the name of the XFree86 video driver to use when the rule is true, and the subsequent logical lines of each rule, if present, are additional configuration output for the video device's XF86Config Device section.
The driver name and additional lines of configuration information are written to standard output when the rule is chosen as the successful rule.
Pseudo-Rules
Pseudo rules consisting of perl expressions may be present in the file for allowing custom perl variables or setting the weight to use for the following rules.
Pseudo rules are rules that consist of a single logical line only, and the are never themselves candidates for a successful rule.
Pre-defined Rules
Several perl variables are pre-defined, and may be used within rules. They include:
$vendor PCI vendor ID $device PCI device ID $revision PCI revision ID $subsys PCI subsystem ID $subsysVendor PCI subsystem vendor ID $class PCI class $XFree86Version XFree86 version, as a 'v' string $XFree86VersionNumeric XFree86 numeric version $XFree86VersionMajor XFree86 major version $XFree86VersionMinor XFree86 minor version $XFree86VersionPatch XFree86 patch version $XFree86VersionSnap XFree86 snap version $weight current rule weight
Rule Weighting
The $weight variable determines the weight of the rules as they are processed. The weight for subsequent rules may be set with a pseudo rule that sets or changes the value of $weight. The default weight, and the weight used for built-in rules is 500, you can set your rules with either higher or lower weights.
As the meta-configuration files are processed in an unpredictable order, the weighting of the rules is used to determine their relative priority.
After processing all of the rules, both built-in and those read from the meta-configuration files, the getconfig program chooses as the successful rule the last and highest weighted rule that evaluates to true.
Files
The .cfg files must be located in the search path which is typically specified as:
etc/X11
/usr/X11R6/etc/X11
<modulepath>
/usr/X11R6/lib/X11/getconfig
where <modulepath> is the X server's module's search path.
- /usr/X11R6/lib/X11/getconfig/xfree86.cfg
- this is the default rules file that originally gets installed and does not contain any rules.
- /usr/X11R6/lib/X11/getconfig/cfg.sample
- this is a sample rules file that gives several examples of what types of rules can appear in rules files.
See Also
getconfig(1), XFree86(1), XF86Config(5).
Authors
The XFree86 automatic configuration program support and integration was done by David H. Dawes. The getconfig interface was written by David H. Dawes, with the support of X-Oz Technologies.