source: x/installing/xorg-config.xml@ 5287b7c

10.0 10.1 11.0 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 ken/refactor-virt krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 5287b7c was 5287b7c, checked in by DJ Lucas <dj@…>, 9 years ago

Removed external Xorg wget and md5sums files, and included for-in-do loops.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@10477 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 15.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="xorg-config">
9 <?dbhtml filename="xorg-config.html"?>
10
11 <sect1info>
12 <othername>$LastChangedBy$</othername>
13 <date>$Date$</date>
14 </sect1info>
15
16 <title>Xorg-&xorg-version; Testing and Configuration</title>
17
18 <indexterm zone="xorg-config">
19 <primary sortas="g-configuring-xorg">Configuring Xorg</primary>
20 </indexterm>
21
22 <sect2 id='X11-testing' xreflabel="Testing Xorg">
23 <title>Testing Xorg</title>
24
25 <para>To test the <application>Xorg</application> installation, issue
26 <userinput>startx</userinput>. This command brings up a rudimentary window
27 manager called <emphasis>twm</emphasis> with three xterm windows and one
28 xclock window. The xterm window in the upper left is a login terminal and
29 running <emphasis>exit</emphasis> from this terminal will exit the
30 <application>X Window</application> session. The third xterm window may be
31 obscured on your system by the other two xterms.</para>
32
33 <para>Generally, there is no specific configuration required for
34 <application>Xorg</application>, but customization is possible. For details
35 see <xref linkend='xconfig'/> below.</para>
36
37 </sect2>
38
39 <sect2 role="configuration" id='checking-dri' xreflabel="Checking the DRI installation">
40 <title>Checking the Direct Rendering Infrastructure (DRI) Installation</title>
41
42 <para>DRI is a framework for allowing software to access graphics hardware
43 in a safe and efficient manner. It is installed in <application>X</application>
44 by default (using <application>MesaLib</application>) if you have a supported
45 video card.</para>
46
47 <para>To check if DRI is installed properly, check the log file
48 <filename>/var/log/Xorg.0.log</filename> for statements like:</para>
49
50<screen><literal>(II) R128(0): Direct rendering enabled</literal></screen>
51
52 <note><para>DRI configuration may differ if you are using alternate
53 drivers, such as those from
54 <ulink url="http://www.nvidia.com/page/home.html">NVIDIA</ulink> or
55 <ulink url="http://www.ati.com/">ATI</ulink>.</para>
56 </note>
57
58 <para>Although all users can use software acceleration, any hardware
59 acceleration (DRI2) is only available to
60 <systemitem class="username">root</systemitem> and members of the
61 <systemitem class="groupname">video</systemitem> group.</para>
62
63 <para>To see if hardware acceleration is available for your driver, look in
64 <filename>/var/log/Xorg.0.log</filename> for statements like:</para>
65
66<screen><literal> (II) intel(0): direct rendering: DRI2 Enabled</literal></screen>
67
68 <para>If your driver is supported, add any users that might use X to that group:</para>
69
70<screen role="root"><userinput>usermod -a -G video <replaceable>&lt;username&gt;</replaceable></userinput></screen>
71
72 <para>If you elected to install the Mesa-Demos package when installing
73 <xref linkend="mesalib"/>, from an <command>xterm</command>, run
74 <command>glxinfo</command> and first look for the phrase:</para>
75
76<screen><computeroutput>direct rendering: Yes</computeroutput></screen>
77
78 <para>If direct rendering is enabled, you can add verbosity by
79 running <command>LIBGL_DEBUG=verbose glxinfo</command>. This will
80 show the drivers, device nodes and files used by the DRI system.</para>
81
82 <para>If DRI is enabled, to confirm that DRI2 hardware acceleration is
83 working you can (still in the <command>xterm</command>) run the command
84 <command>glxinfo | grep "OpenGL renderer string"</command> - if that
85 reports something <emphasis>other than</emphasis>
86 <literal>Software Rasterizer</literal> then you have working acceleration
87 for the user who ran the command.</para>
88
89 <para>Again, if you have added the Mesa-Demos package, you can also
90 run the test program <command>glxgears</command>.
91 This program brings up a window with three gears turning. The
92 <command>xterm</command> will display how many frames were drawn every
93 five seconds, so this is a reasonable benchmark. The window is scalable,
94 and the frames drawn per second is highly dependent on the size of
95 the window.</para>
96
97 </sect2>
98
99 <sect2 role="configuration" id='X11R6-compat-symlink'
100 xreflabel="Creating an X11R6 Compatibility Symlink">
101
102 <title>Creating an X11R6 Compatibility Symlink</title>
103
104 <para>Until recently (relatively speaking) almost every
105 <application>X Window</application> installation you performed or came
106 across was installed in the
107 <filename class='directory'>/usr/X11R6</filename> directory. That was the
108 standard for years. Developers picked up on this and wrote their package
109 installation scripts looking for <application>X</application> in the
110 standard location. Things have changed and the trend is to now install
111 <application>X</application> in
112 <filename class='directory'>/usr</filename>. Some people want to install
113 it in a custom location.</para>
114
115 <para>Many package developers have not caught up to the change and their
116 packages are still trying to find <application>X</application> in
117 <filename class='directory'>/usr/X11R6</filename> and subsequently fail
118 when you try to build the package. Though for most packages it is not
119 difficult to 'hack' the installation script to fix the problem, that is not
120 the long term solution to the problem. Upstream developers need to modernize
121 their installation scripts and eliminate the problem altogether.</para>
122
123 <para>Until then, you can create a symbolic link to satisfy the
124 <filename class='directory'>/usr/X11R6</filename> requirement so that you
125 won't be inconvenienced with a package build failure due to this known
126 issue. If you wish to create the symlink, issue the following command as
127 the <systemitem class="username">root</systemitem>:</para>
128
129<screen role="root"><userinput>ln -vsf $XORG_PREFIX /usr/X11R6</userinput></screen>
130
131 </sect2>
132
133 <sect2 role="configuration" id="xft-font-protocol" xreflabel="Xft Font Protocol">
134 <title>Xft Font Protocol</title>
135
136 <indexterm zone="xft-font-protocol" id="fonts">
137 <primary sortas="g-truetype">TrueType Fonts</primary>
138 </indexterm>
139
140 <para>Xft provides antialiased font rendering through
141 <application>Freetype</application>, and fonts are controlled from the
142 client side using <application>Fontconfig</application>. The default
143 search path is <filename class="directory">/usr/share/fonts</filename>
144 and <filename class="directory">~/.fonts</filename>.
145 <application>Fontconfig</application> searches directories in its
146 path recursively and maintains a cache of the font characteristics in
147 <filename>fonts.cache-1</filename> files in each directory. If the cache
148 appears to be out of date, it is ignored, and information is (slowly)
149 fetched from the fonts themselves. This cache
150 can be regenerated using the <command>fc-cache</command> command at any
151 time. You can see the list of fonts known by
152 <application>Fontconfig</application> by running the command
153 <command>fc-list</command>.</para>
154
155 <para>If you've installed <application>Xorg</application> in any prefix
156 other than <filename class="directory">/usr</filename>, the
157 <application>X</application> fonts were not installed in a
158 location known to <application>Fontconfig</application>. This prevents
159 <application>Fontconfig</application> from using the poorly rendered
160 Type 1 fonts or the non-scalable bitmapped fonts. Symlinks were created
161 from the <filename class="directory">OTF</filename> and <filename
162 class="directory">TTF</filename> <application>X</application> font
163 directories to <filename
164 class="directory">/usr/share/fonts/X11-{OTF,TTF}</filename>. This allows
165 <application>Fontconfig</application> to use the OpenType and TrueType
166 fonts provided by <application>X</application> (which are scalable and
167 of higher quality).</para>
168
169 <para><application>Fontconfig</application> uses names such as
170 "Monospace 12" to define fonts. Applications generally use generic font
171 names such as "Monospace", "Sans" and "Serif".
172 <application>Fontconfig</application> resolves these names to a font that
173 has all characters that cover the orthography of the language indicated
174 by the locale settings. Knowledge of these font names is included in
175 <filename>/etc/fonts/fonts.conf</filename>. Fonts that are not listed
176 in this file are still usable by <application>Fontconfig</application>,
177 but they will not be accessible by the generic family names.</para>
178
179 <para>Standard scalable fonts that come with <application>X</application>
180 provide very poor Unicode coverage. You may notice in applications that
181 use <application>Xft</application> that some characters appear as a box
182 with four binary digits inside. In this case, a font set with the
183 available glyphs has not been found. Other times, applications that
184 don't use other font families by default and don't accept substitutions
185 from <application>Fontconfig</application> will display blank lines when
186 the default font doesn't cover the orthography of the user's language.
187 This happens, e.g., with <application>Fluxbox</application> in the
188 ru_RU.KOI8-R locale.</para>
189
190 <para>In order to provide greater Unicode coverage, it is recommended
191 that you install these fonts:</para>
192
193 <itemizedlist>
194 <listitem>
195 <para><ulink url="http://dejavu.sourceforge.net/">DejaVu fonts</ulink>
196 - These fonts are replacements for the Bitstream Vera fonts and
197 provide Latin-based scripts with accents and Cyrillic glyphs.</para>
198 </listitem>
199 <listitem>
200 <para><ulink
201 url="http://download.savannah.nongnu.org/releases/freefont/">FreeFont</ulink>
202 - This set of fonts covers nearly every non-CJK character, but is not
203 visually pleasing. <application>Fontconfig</application> will use it
204 as a last resort to substitute generic font family names.</para>
205 </listitem>
206 <listitem>
207 <para><ulink
208 url="http://corefonts.sourceforge.net/">Microsoft Core fonts</ulink>
209 - These fonts provide slightly worse Unicode coverage than FreeFont,
210 but are better hinted. Be sure to read the license before using
211 them. These fonts are listed in the aliases in the
212 <filename class="directory">/etc/fonts/fonts.d</filename> directory
213 by default.</para>
214 </listitem>
215 <listitem>
216 <para><ulink
217 url="http://cle.linux.org.tw/fonts/FireFly">Firefly New Sung font</ulink>
218 - This font provides Chinese coverage. This font is listed in the
219 aliases in the
220 the <filename class="directory">/etc/fonts/fonts.d</filename>
221 directory by default.</para>
222 </listitem>
223 <listitem>
224 <para><ulink
225 url="http://cle.linux.org.tw/fonts/Arphic">Arphic fonts</ulink> -
226 A similar set of Chinese fonts to the Firefly New Sung font.
227 These fonts are listed in the aliases in the
228 <filename class="directory">/etc/fonts/fonts.d</filename> directory
229 by default.</para>
230 </listitem>
231 <listitem>
232 <para><ulink
233 url="http://sourceforge.jp/projects/efont/">Kochi fonts</ulink> -
234 These provide Japanese characters, and are listed in the aliases
235 in the <filename class="directory">/etc/fonts/fonts.d</filename>
236 directory by default.</para>
237 </listitem>
238 <listitem>
239 <para><ulink
240 url="http://kldp.net/projects/baekmuk/">Baekmuk fonts</ulink>
241 - These fonts provide Korean coverage, and are listed in the
242 aliases in the
243 <filename class="directory">/etc/fonts/fonts.d</filename> directory
244 by default.</para>
245 </listitem>
246 <listitem>
247 <para><ulink
248 url="&gnome-download-http;/cantarell-fonts/0.0/">Cantarell fonts</ulink>
249 - The Cantarell typeface family provides a contemporary Humanist sans
250 serif. It is particularly optimised for legibility at small sizes and is
251 the preferred font family for the <application>GNOME-3</application> user
252 interface.</para>
253 </listitem>
254 </itemizedlist>
255
256 <para>The list above will not provide complete Unicode coverage. For
257 more information, please visit the <ulink
258 url="http://unifont.org/fontguide/">Unicode Font Guide</ulink>.</para>
259
260 <para>As an example, consider the installation of the DejaVu fonts. From
261 the unpacked source directory, run the following commands as the
262 <systemitem class="username">root</systemitem> user:</para>
263
264<screen role="root"><userinput>install -v -d -m755 /usr/share/fonts/dejavu &amp;&amp;
265install -v -m644 *.ttf /usr/share/fonts/dejavu &amp;&amp;
266fc-cache -v /usr/share/fonts/dejavu</userinput></screen>
267
268 </sect2>
269
270 <sect2 role="configuration" id='xconfig'>
271 <title>Setting up Xorg Devices</title>
272 <para>For most hardware configurations, modern Xorg will automatically
273 get the server configuration correct without any user intervention. There
274 are, however, some cases where auto-configuration will be incorrect.
275 Following are some example manual configuration items that may be of use in
276 these instances.</para>
277
278 <sect3 id="xinput">
279 <title>Setting up X Input Devices</title>
280 <para>For most input devices, no additional configuration will be
281 necessary. This section is provided for informational purposes only.</para>
282
283 <para>A sample default XKB setup could look like the following (executed as
284 the <systemitem class="username">root</systemitem> user):</para>
285<screen><userinput role="username">cat &gt; /etc/X11/xorg.conf.d/xkb-defaults.conf &lt;&lt; "EOF"
286Section "InputClass"
287 Identifier "XKB Defaults"
288 MatchIsKeyboard "yes"
289 Option "XkbOptions" "terminate:ctrl_alt_bksp"
290EOF</userinput></screen>
291
292 </sect3>
293
294 <sect3 id="xdisplay">
295 <title>Fine Tuning Display Settings</title>
296 <para>Again, with modern Xorg, little or no additional configuration is
297 necessary. If you should need extra options passed to your video driver,
298 for instance, you could use something like the following (again, executed as
299 the <systemitem class="username">root</systemitem> user):</para>
300
301<screen><userinput role="root">cat &gt; /etc/X11/xorg.conf.d/videocard-0.conf &lt;&lt; "EOF"
302Section "Device"
303 Identifier "Videocard0"
304 Driver "radeon"
305 VendorName "Videocard vendor"
306 BoardName "ATI Radeon 7500"
307 Option "NoAccel" "true"
308EndSection
309EOF</userinput></screen>
310
311 <para>Another common setup is having multiple server layouts for use in
312 different environments. Though the server will automatically detect the
313 presence of another monitor, it may get the order incorrect:</para>
314
315<screen><userinput role="root">cat &gt; /etc/X11/xorg.conf.d/server-layout.conf &lt;&lt; "EOF"
316Section "ServerLayout"
317 Identifier "DefaultLayout"
318 Screen 0 "Screen0" 0 0
319 Screen 1 "Screen1" LeftOf "Screen0"
320 Option "Xinerama"
321EndSection
322EOF</userinput></screen>
323
324 </sect3>
325 </sect2>
326</sect1>
Note: See TracBrowser for help on using the repository browser.