source: x/installing/xorg.xml@ 7f76b96

10.0 10.1 11.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 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 7f76b96 was 7f76b96, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Reverted the DTD change. That don't be done untiltomorrow.

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

  • Property mode set to 100644
File size: 20.5 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY xorg-download-http " ">
8 <!ENTITY xorg-download-ftp "ftp://ftp.opengroup.org/pub/x.org/pub/X11R&xorg-version;/src-single/X11R&xorg-version;-src.tar.bz2">
9 <!ENTITY xorg-md5sum "8131cd7ea1e4566e6e05c438a93fcfe1">
10 <!ENTITY xorg-size "43 MB">
11 <!ENTITY xorg-buildsize "839 MB">
12 <!ENTITY xorg-time "10.34 SBU">
13]>
14
15<sect1 id="xorg" xreflabel="X.org-&xorg-version;">
16<sect1info>
17 <othername>$LastChangedBy$</othername>
18 <date>$Date$</date>
19</sect1info>
20
21<?dbhtml filename="xorg.html"?>
22<title>Xorg-&xorg-version;</title>
23
24<indexterm zone="xorg">
25 <primary sortas="a-xorg">Xorg</primary>
26</indexterm>
27
28<sect2>
29<title>Introduction to <application>Xorg</application></title>
30
31<note><para>There are two packages in <acronym>BLFS</acronym> that implement
32the <application>X</application> Window System: <application>Xorg</application>
33and <application>XFree86</application>. These packages are quite similar. In
34fact, the base system of <application>Xorg</application> is
35<application>XFree86</application>-4.4.0RC2. The primary difference as of this
36writing is the license provisions of the packages. For someone building a
37package for their own use, these issues are not significant. Most large
38commercial distributions have decided to use the
39<application>Xorg</application> package, but several still use
40<application>XFree86</application>.</para>
41
42<para>A second reason for the forking of <application>X</application> packages
43is the stated goals of the developers. Some developers were unhappy with the
44administration and progress of <application>XFree86</application>. X.org's
45future plans include significant improvements to the internals of the system
46and more frequent releases.</para>
47
48<para><application>XFree86</application> continues to be a solid, conservative
49application with excellent driver support.</para>
50
51<para>Both <application>Xorg</application> and
52<application>XFree86</application> can be installed in the same way, but this
53section will provide a slightly different and more current variation for
54installation.</para>
55</note>
56
57<para><application>Xorg</application> is a freely redistributable open-source
58implementation of the <application>X</application> Window System. This
59application provides a client/server interface between display hardware (the
60mouse, keyboard, and video displays) and the desktop environment, while also
61providing both the windowing infrastructure and a standardized application
62interface (<acronym>API</acronym>).</para>
63
64<sect3><title>Package information</title>
65 <itemizedlist spacing='compact'>
66 <listitem><para>Download (HTTP): <ulink url="&xorg-download-http;"/></para></listitem>
67 <listitem><para>Download (FTP): <ulink url="&xorg-download-ftp;"/></para></listitem>
68 <listitem><para>Download MD5 sum: &xorg-md5sum;</para></listitem>
69 <listitem><para>Download size: &xorg-size;</para></listitem>
70 <listitem><para>Estimated disk space required: &xorg-buildsize;</para></listitem>
71 <listitem><para>Estimated build time: &xorg-time;</para></listitem>
72 </itemizedlist>
73</sect3>
74
75<sect3>
76 <title><application>Xorg</application> Dependencies</title>
77
78<sect4>
79 <title>Required</title>
80 <para><xref linkend="libpng"/> and
81 <xref linkend="fontconfig"/></para>
82</sect4>
83
84<sect4>
85 <title>Optional</title>
86 <para><xref linkend="Linux_PAM"/></para>
87</sect4>
88
89</sect3>
90
91<sect3><title>Download Instructions</title>
92
93<para>As an alternative to downloading the entire source tree in a single
94file, there are several files that need to be fetched from the download
95location (directory /pub/x.org/pub/X11R&xorg-version;/src/):</para>
96
97<itemizedlist spacing='compact'>
98 <listitem><para><filename>X11R&xorg-version;-src1.tar.gz</filename></para></listitem>
99 <listitem><para><filename>X11R&xorg-version;-src2.tar.gz</filename></para></listitem>
100 <listitem><para><filename>X11R&xorg-version;-src3.tar.gz</filename></para></listitem>
101 <listitem><para><filename>X11R&xorg-version;-src4.tar.gz</filename></para></listitem>
102 <listitem><para><filename>X11R&xorg-version;-src5.tar.gz</filename></para></listitem>
103 <listitem><para><filename>X11R&xorg-version;-src6.tar.gz</filename></para></listitem>
104 <listitem><para><filename>X11R&xorg-version;-src7.tar.gz</filename></para></listitem>
105</itemizedlist>
106
107<para>The first package contains the <application>Xorg</application> libraries
108and support programs, the second contains standard <application>X</application>
109programs, the third contains the <application>X</application> server, the
110fourth and fifth are fonts, the sixth is normal documentation, and the seventh
111is hardcopy documentation.</para>
112
113<para>To check your file for integrity, download the
114<filename>md5sums</filename> file. Then:</para>
115
116<screen><userinput><command>md5sum -c md5sums</command></userinput></screen>
117
118<para>The package (or all seven packages) should give an OK status.</para>
119</sect3>
120</sect2>
121
122<sect2>
123 <title>Installation of <application>Xorg</application></title>
124
125<sect3 id='xorg-kernel'>
126 <title>Kernel Compilation Settings</title>
127
128 <indexterm zone="xorg xorg-kernel">
129 <primary sortas="d-Xorg">Xorg</primary></indexterm>
130
131 <para>If you have an Intel P6 (Pentium Pro, Pentium II and later), it is
132 recommended that you compile <acronym>MTRR</acronym> (Memory Type Range
133 Registers) support into the kernel. The kernel can map Cyrix and AMD
134 <acronym>CPU</acronym>s to the <acronym>MTRR</acronym> interface, so selecting
135 this option is useful for those processors also. This option is found in the
136 "Processor type and features" menu. It can increase performance of
137 image write operations 2.5 times or more on <acronym>PCI</acronym> or
138 <acronym>AGP</acronym> video cards.
139 </para>
140
141 <para>In the "Character Devices" section, enable <acronym>AGP</acronym> Support
142 and select the chipset support on your motherboard. If you do not know the
143 chipset, you may select all the chip types at the expense of extra kernel size.
144 You can usually determine your motherboard's chipset by running the command
145 <command>lspci</command>, a program from the <xref linkend="pciutils"/>
146 package.
147 </para>
148
149 <para>In the "Character Devices" section, <emphasis>disable</emphasis> Direct
150 Rendering Manager unless you have a Direct Rendering Infrastructure
151 (<acronym>DRI</acronym>) supported video card. A complete list of
152 <acronym>DRI</acronym> supported video cards can be found at
153 <ulink url="http://dri.sourceforge.net" /> in the "Status" section.
154 Currently, supported cards include those from 3dfx (Voodoo, Banshee), 3Dlabs,
155 ATI (Rage Pro, Rage 128, Radeon 7X00, Radeon 2), Intel (i810, i815), and
156 Matrox (G200, G400, G450).
157 </para>
158
159 <para>Additionally NVidia provides their own closed source binary drivers,
160 which do not make use of <acronym>DRI</acronym>. If you intend to use these
161 drivers, do not enable <acronym>DRI</acronym>.
162 </para>
163
164 <para>If you made any changes to the kernel configuration, recompile and
165 install the new kernel.
166 </para>
167
168 <note><para>If you build <application>Xorg</application> in a
169 <command>chroot</command> environment, make sure the kernel version of the base
170 system and the target system are the same.</para>
171 </note>
172</sect3>
173
174<sect3>
175 <title>Suppressing Xprint-related modification to <filename class="directory">/etc</filename></title>
176
177 <para><application>Xorg</application> insists on putting
178 its boot and profile scripts into the <filename
179 class="directory">/etc</filename> directory even if specifically told
180 not to compile anything Xprint server or client related (see
181 <filename>host.def</filename> below). The following command will
182 suppress any such modifications:
183 </para>
184
185<screen><userinput><command>sed -i '/^SUBDIRS =/s/ etc$//' programs/Xserver/Xprint/Imakefile</command></userinput></screen>
186
187</sect3>
188
189<sect3>
190 <title>Setting Up a Shadow Directory</title>
191
192 <para>When building <application>Xorg</application>, you should create a shadow
193 directory of symbolic links for the compiled code. To do that, first make
194 <command>lndir</command>. Starting from the
195 <filename class='directory'>xc</filename> directory:
196 </para>
197
198<screen><userinput><command>pushd config/util &amp;&amp;
199make -f Makefile.ini lndir</command></userinput></screen>
200
201<para>Now, as the root user:</para>
202
203<screen><userinput role='root'><command>cp lndir /usr/bin/</command></userinput></screen>
204
205<para>And back as a regular user:</para>
206<screen><userinput><command>popd</command></userinput></screen>
207
208<para>Now create the shadow tree:</para>
209
210<screen><userinput><command>mkdir ../xcbuild &amp;&amp;
211cd ../xcbuild &amp;&amp;
212lndir ../xc</command></userinput></screen>
213</sect3>
214
215<sect3>
216 <title>Creating <filename>host.def</filename></title>
217
218 <para>The next step is to create the <filename>config/cf/host.def</filename>
219 file. The documentation for <application>Xorg</application> indicates that the
220 application will build without a <filename>host.def</filename> file, but
221 the included libraries for <application>Fontconfig</application> and
222 <application>FreeType2</application> do not build properly on a base
223 <acronym>LFS</acronym> system. Therefore, you must specify that these
224 libraries, as well as others, should be imported from the system.
225 </para>
226
227 <note><para><filename>config/cf/host.def</filename> is a C file, not a shell
228 script. Ensure the comments delimited by <userinput>/*</userinput> ...
229 <userinput>*/</userinput> are balanced when modifying the file.</para>
230 </note>
231
232<screen><userinput><command>cat &gt; config/cf/host.def &lt;&lt; "EOF"</command>
233/* Begin Xorg host.def file */
234
235/* System Related Information. If you read and configure only one
236 * section then it should be this one. The Intel architecture defaults
237 * are set for a i686 and higher. Axp is for the Alpha architecture
238 * and Ppc is for the Power PC. AMD64 is for the Opteron processor.
239 * Note that there have been reports that the Ppc optimization line
240 * causes segmentation faults during build. If that happens, try
241 * building without the DefaultGcc2PpcOpt line. ***********/
242
243/* #define DefaultGcc2i386Opt -O2 -fno-strength-reduce \
244 -fno-strict-aliasing -march=i686 */
245/* #define DefaultGccAMD64Opt -O2 -fno-strength-reduce \
246 -fno-strict-aliasing */
247/* #define DefaultGcc2AxpOpt -O2 -mcpu=ev6 */
248/* #define DefaultGcc2PpcOpt -O2 -mcpu=750 */
249
250#define HasFreetype2 YES
251#define HasFontconfig YES
252#define HasExpat YES
253#define HasLibpng YES
254#define HasZlib YES
255
256/*
257 * Which drivers to build. When building a static server, each of
258 * these will be included in it. When building the loadable server
259 * each of these modules will be built.
260 *
261#define XF86CardDrivers mga glint nv tga s3virge sis rendition \
262 neomagic i740 tdfx savage \
263 cirrus vmware tseng trident chips apm \
264 GlideDriver fbdev i128 \
265 ati AgpGartDrivers DevelDrivers ark \
266 cyrix siliconmotion vesa vga \
267 XF86OSCardDrivers XF86ExtraCardDrivers
268*/
269
270/*
271 * Select the XInput devices you want by uncommenting this.
272 *
273#define XInputDrivers mouse keyboard acecad calcomp citron \
274 digitaledge dmc dynapro elographics \
275 microtouch mutouch penmount spaceorb \
276 summa wacom void magictouch aiptek
277 */
278
279/* Most installs will only need this */
280
281#define XInputDrivers mouse keyboard
282
283/* Disable building Xprint server and clients until we get them figured
284 * out but build Xprint libraries to allow precompiled binaries such as
285 * Acrobat Reader to run.
286 */
287
288#define XprtServer NO
289#define BuildXprintClients NO
290
291/* End Xorg host.def file */
292<command>EOF</command></userinput></screen>
293
294 <para>There are several other options that you may want to consider. A well
295 documented example file is <filename>config/cf/xorgsite.def</filename>.
296 </para>
297
298</sect3>
299
300<sect3>
301 <title>Build Commands</title>
302
303 <para>Install <application>Xorg</application> by running the following commands:</para>
304
305<screen><userinput><command>sed -i -e "s@^#include &lt;linux/config.h&gt;@/* &amp; */@" \
306 `grep -lr linux/config.h *` &amp;&amp;
307( make World 2&gt;&amp;1 | tee xorg-compile.log &amp;&amp; exit $PIPESTATUS )</command></userinput></screen>
308
309<para>Again as the root user:</para>
310
311<screen><userinput role='root'><command>make install &amp;&amp;
312make install.man &amp;&amp;
313ln -sf ../X11R6/bin /usr/bin/X11 &amp;&amp;
314ln -sf ../X11R6/lib/X11 /usr/lib/X11 &amp;&amp;
315ln -sf ../X11R6/include/X11 /usr/include/X11</command></userinput></screen>
316
317</sect3>
318</sect2>
319
320<sect2>
321<title>Command explanations</title>
322
323 <para><command>sed -i -e "s@^#include &lt;linux/config.h&gt;@...</command>:
324 The <application>Linux-Libc-Headers</application> package installed in
325 <acronym>LFS</acronym> installs a
326 <filename>/usr/include/linux/config.h</filename> file which is not compatible
327 with userspace applications. The recommended fix for applications including
328 this file is to remove it (see <ulink
329 url="http://ep09.pld-linux.org/~mmazur/linux-libc-headers/doc/FAQ">
330 linux-libc-headers FAQ</ulink>). The <command>sed</command> uses
331 <command>grep -lr</command> to replace all occurences. If you desire, just
332 remove (comment) the line in the appropriate video driver file if you
333 customized <filename>host.def</filename>.
334</para>
335
336 <para><command>( make World 2&gt;&amp;1 | tee xorg-compile.log
337 &amp;&amp; exit $PIPESTATUS )</command>:
338 This command runs multiple <filename>Makefile</filename>s to completely rebuild
339 the system. <parameter>2&gt;&amp;1</parameter> redirects error messages
340 to the same location as standard output. The <command>tee</command> command
341 allows viewing of the output while logging the results to a file. The
342 parentheses around the command runs the entire comand in a subshell and finally
343 the <command>exit $PIPESTATUS</command> ensures the result of the
344 <command>make</command> is returned as the result and not the result of the
345 <command>tee</command> command.
346 </para>
347
348 <note><para>When rebuilding <application>Xorg</application>, a separate command
349 that may be used if only minor changes are made to the sources is
350 <command>make Everything</command>. This does not automatically remove generated
351 files and only rebuilds those files or programs that are out of date.</para>
352 </note>
353
354<para><screen><command>ln -sf ../X11R6/bin /usr/bin/X11
355ln -sf ../X11R6/lib/X11 /usr/lib/X11
356ln -sf ../X11R6/include/X11 /usr/include/X11</command></screen>
357These commands are present to enable other (broken) packages to build against
358<application>Xorg</application>, even though the Filesystem Hierarchy Standard
359says: "In general, software must not be installed or managed via the above
360symbolic links. They are intended for utilization by users only."</para>
361
362</sect2>
363
364<sect2 id='xorg-config'>
365<title>Configuring Xorg</title>
366
367<para>Edit <filename>/etc/ld.so.conf</filename> and add
368 <filename class="directory">/usr/X11R6/lib</filename>. Run:
369</para>
370
371<indexterm zone="xorg xorg-config">
372 <primary sortas="e-etc-ld.so.conf">/etc/ld.so.conf</primary>
373</indexterm>
374
375<screen><userinput><command>ldconfig</command></userinput></screen>
376
377<para>Ensure <filename class="directory">/usr/X11R6/bin</filename>
378and <filename class="directory">/usr/X11R6/lib/pkgconfig</filename>
379are added to your <envar>PATH</envar> and <envar>PKG_CONFIG_PATH</envar>
380environment variables, respectively. Instructions for doing this are
381described in the section "<xref linkend='postlfs-config-profile'/>."</para>
382
383<para>Create the <filename>xorg.conf</filename> file with:
384<screen><userinput><command>cd ~
385Xorg -configure</command></userinput></screen>
386The screen will go black and you may hear some clicking of the monitor. This
387command will create a file, <filename>xorg.conf.new</filename> in your home
388directory.</para>
389
390<indexterm zone="xorg xorg-config">
391 <primary sortas="e-etc-X11-xorg-conf">/etc/X11/xorg.conf</primary>
392</indexterm>
393
394<para>Edit <filename>xorg.conf.new</filename> to suit your system. The details
395of the file are located in the xorg.conf man page. Some
396things you may want to do are:</para>
397
398<itemizedlist>
399
400<listitem><para>Section "Files". Change the order of the font paths searched.
401You may want to put 100dpi fonts ahead of 75dpi fonts if your system normally
402comes up closer to 100 dots per inch. You may want to remove some font
403directories completely.</para></listitem>
404
405<listitem><para>Section "Module". If you are going to install NVidia
406drivers, remove the "dri" line.</para></listitem>
407
408<listitem><para>Sections "InputDevice". Specify the
409<parameter>Device</parameter> parameter to "/dev/input/mice" and
410<parameter>Protocol</parameter> to "auto" to set up your mouse. You may
411also want to change the keyboard autorepeat rate by adding
412<parameter>Option "Autorepeat" "250 30"</parameter>.</para></listitem>
413
414<listitem><para>Section "Monitor". Specify the
415<parameter>VertRefresh</parameter> and <parameter>HorizSync</parameter> values
416if the system does not automatically detect the monitor and its values.</para>
417</listitem>
418
419<listitem><para>Section "Device". You may want to set some of the options
420available for your selected video driver. A description of the driver
421parameters is in the man page for your driver.</para></listitem>
422
423<listitem><para>Section "Screen". Add a DefaultDepth statement such as:
424<parameter>DefaultDepth 16</parameter>. In the SubSection for your default
425depth, add a modes line such as:
426<parameter> Modes "1280x1024" "1024x768"</parameter>. The first mode listed
427will normally be the starting resolution.</para></listitem>
428
429</itemizedlist>
430
431<para>Test the system with:
432<screen><userinput><command>X -config ~/xorg.conf.new</command></userinput></screen>
433You will only get a gray background with an X-shaped mouse cursor, but it
434confirms the system is working. Exit with Control-Alt-Backspace. If the
435system does not work, take a look at <filename>/var/log/Xorg.0.log</filename>
436to see what went wrong.</para>
437
438<para>Move the configuration file to its final location:</para>
439<screen><userinput><command>mv ~/xorg.conf.new /etc/X11/xorg.conf</command></userinput></screen>
440
441<para>Create <filename>.xinitrc</filename>:
442<screen><userinput><command>cat &gt; ~/.xinitrc &lt;&lt; "EOF"</command>
443# Begin .xinitrc file
444xterm -g 80x40+0+0 &amp;
445xclock -g 100x100-0+0 &amp;
446twm
447<command>EOF</command></userinput></screen>
448This provides an initial screen with an xterm and a clock that is managed by a
449simple window manager, Tab Window Manager. For details of
450<command>twm</command>, see the man page.</para>
451
452<indexterm zone="xorg xorg-config">
453 <primary sortas="e-AA.xinitrc">~/.xinitrc</primary>
454</indexterm>
455
456<note>
457<para>When needed, <application>Xorg</application> creates the directory
458<filename>/tmp/.ICE-unix</filename> if it does not exist. If this directory is
459not owned by root, <application>Xorg</application> delays startup by a few
460seconds and also appends a warning to the logfile. This also affects startup of
461other applications. To improve performance, it is advisable to manually create
462the directory before <application>Xorg</application> uses it. Add the file
463creation to <filename>/etc/sysconfig/createfiles</filename> that is sourced by
464the <filename>/etc/rc.d/init.d/cleanfs</filename> startup script.</para>
465
466<screen><userinput role='root'><command>cat &gt;&gt; /etc/sysconfig/createfiles &lt;&lt; "EOF"</command>
467/tmp/.ICE-unix dir 1777 root root
468<command>EOF</command></userinput></screen>
469</note>
470
471<indexterm zone="xorg xorg-config">
472 <primary sortas="e-etc-sysconfig-createfiles">/etc/sysconfig/createfiles</primary>
473</indexterm>
474
475<para>Start <application>X</application> with:
476<screen><userinput><command>startx</command></userinput></screen>
477to get a basic functional <application>X</application> Window System.</para>
478
479<para>At this point, you should check out <xref linkend='x-setup'/>.</para>
480
481<para>For a list of the package contents and a description of the commands,
482see the sections in the <xref linkend='xfree86-contents'/>.</para>
483
484</sect2>
485
486</sect1>
Note: See TracBrowser for help on using the repository browser.