/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-system.xml
Gentoo

Contents of /xml/htdocs/doc/en/handbook/hb-install-system.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.54 - (hide annotations) (download) (as text)
Sat Nov 6 15:06:21 2004 UTC (9 years, 10 months ago) by swift
Branch: MAIN
Changes since 1.53: +3 -2 lines
File MIME type: application/xml
Use coding style, create /etc/portage directory

1 swift 1.26 <?xml version='1.0' encoding='UTF-8'?>
2     <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3    
4 swift 1.6 <!-- The content of this document is licensed under the CC-BY-SA license -->
5     <!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
6    
7 swift 1.54 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-system.xml,v 1.53 2004/11/01 20:15:45 dertobi123 Exp $ -->
8 swift 1.11
9 swift 1.3 <sections>
10 swift 1.1 <section>
11 swift 1.3 <title>Chrooting</title>
12 swift 1.1 <subsection>
13 swift 1.2 <title>Optional: Selecting Mirrors</title>
14     <body>
15    
16     <p>
17 swift 1.24 If you have booted from a Gentoo LiveCD, you are able to use <c>mirrorselect</c>
18 swift 1.2 to update <path>/etc/make.conf</path> so fast mirrors are used for both Portage
19 swift 1.28 and source code (of course in case you have a working network connection):
20 swift 1.2 </p>
21    
22 swift 1.49 <warn>
23     An error within mirrorselect might make it output garbage after the
24     GENTOO_MIRRORS statement. Please open <path>/mnt/gentoo/etc/make.conf</path>
25     and remove the garbage at the end of the GENTOO_MIRRORS statement if applicable.
26     </warn>
27    
28 swift 1.2 <pre caption="Selecting fast mirrors">
29 neysx 1.44 # <i>mirrorselect -a -s4 -o | grep 'GENTOO_MIRRORS=' &gt;&gt; /mnt/gentoo/etc/make.conf</i>
30 swift 1.2 </pre>
31    
32     <p>
33     If for some reason <c>mirrorselect</c> fails, don't panic. This step is
34 swift 1.33 completely optional, the default values suffice.
35 swift 1.2 </p>
36    
37     </body>
38 swift 1.3 </subsection>
39     <subsection>
40 swift 1.5 <title>Copy DNS Info</title>
41     <body>
42    
43     <p>
44 swift 1.24 One thing still remains to be done before we enter the new environment and that
45     is copying over the DNS information in <path>/etc/resolv.conf</path>. You need
46 swift 1.5 to do this to ensure that networking still works even after entering the new
47     environment. <path>/etc/resolv.conf</path> contains the nameservers for your
48     network.
49     </p>
50    
51     <pre caption="Copy over DNS information">
52 swift 1.35 <comment>(The "-L" option is needed to make sure we don't copy a symbolic link)</comment>
53     # <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</i>
54 swift 1.18 </pre>
55    
56     </body>
57     </subsection>
58     <subsection>
59 swift 1.43 <title>Mounting the proc Filesystem</title>
60     <body>
61    
62     <p>
63     Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to
64     allow the installation to use the kernel-provided information even within the
65     chrooted environment.
66     </p>
67    
68     <pre caption="Mounting /proc">
69     # <i>mount -t proc none /mnt/gentoo/proc</i>
70     </pre>
71    
72     </body>
73     </subsection>
74     <subsection>
75 swift 1.2 <title>Entering the new Environment</title>
76 swift 1.1 <body>
77    
78     <p>
79 swift 1.19 Now that all partitions are initialized and the base environment
80 swift 1.1 installed, it is time to enter our new installation environment by
81 swift 1.9 <e>chrooting</e> into it. This means that we change from the current
82 swift 1.2 installation environment (LiveCD or other installation medium) to your
83 swift 1.19 installation system (namely the initialized partitions).
84 swift 1.1 </p>
85    
86     <p>
87     This chrooting is done in three steps. First we will change the root
88 swift 1.2 from <path>/</path> (on the installation medium) to <path>/mnt/gentoo</path>
89     (on your partitions) using <c>chroot</c>. Then we will create a new environment
90     using <c>env-update</c>, which essentially creates environment variables.
91 swift 1.1 Finally, we load those variables into memory using <c>source</c>.
92     </p>
93    
94     <pre caption = "Chrooting into the new environment">
95     # <i>chroot /mnt/gentoo /bin/bash</i>
96     # <i>env-update</i>
97 neysx 1.39 * Caching service dependencies...
98 swift 1.1 # <i>source /etc/profile</i>
99     </pre>
100    
101     <p>
102     Congratulations! You are now inside your own Gentoo Linux environment.
103 swift 1.10 Of course it is far from finished, which is why the installation still
104 swift 1.1 has some sections left :-)
105     </p>
106    
107     </body>
108 swift 1.3 </subsection>
109     <subsection>
110 dertobi123 1.40 <title>Optional: Updating the Portage tree</title>
111 swift 1.2 <body>
112    
113     <p>
114 cam 1.50 If you haven't installed a Portage snapshot in the previous chapter, you must
115     download a recent Portage tree from the Internet. <c>emerge --sync</c> does this
116     for you. Other users should skip this and continue with <uri
117 swift 1.28 link="#configure_USE">Configuring the USE variable</uri>.
118 swift 1.2 </p>
119    
120 dertobi123 1.40 <pre caption="Updating the Portage tree">
121 cam 1.50 # <i>emerge --sync</i>
122 swift 1.38 </pre>
123    
124     <p>
125     Portage uses the RSYNC protocol for updating the Portage tree. If the above
126     command fails due to your firewall, use <c>emerge-webrsync</c> which
127 swift 1.51 downloads and installs a Portage snapshot for you using the regular HTTP
128 swift 1.38 protocol.
129     </p>
130    
131 dertobi123 1.40 <pre caption="Updating the Portage tree with emerge-webrsync">
132 swift 1.27 # <i>emerge-webrsync</i>
133 swift 1.13 </pre>
134    
135     <p>
136     If you are warned that a new Portage version is available and that you should
137 swift 1.34 update Portage, you should ignore it. Portage will be updated for you later
138 bennyc 1.16 on during the installation.
139 swift 1.13 </p>
140 swift 1.8
141     </body>
142     </subsection>
143 swift 1.28 <subsection id="configure_USE">
144 swift 1.21 <title>Configuring the USE variable</title>
145     <body>
146    
147     <p>
148     <c>USE</c> is one of the most powerful variables Gentoo provides to its users.
149     Several programs can be compiled with or without optional support for certain
150     items. For instance, some programs can be compiled with gtk-support, or with
151     qt-support. Others can be compiled with or without SSL support. Some programs
152     can even be compiled with framebuffer support (svgalib) instead of X11 support
153     (X-server).
154     </p>
155    
156     <p>
157     Most distributions compile their packages with support for as much as possible,
158     increasing the size of the programs and startup time, not to mention an enormous
159 swift 1.24 amount of dependencies. With Gentoo you can define what options a package
160 swift 1.21 should be compiled with. This is where <c>USE</c> comes into play.
161     </p>
162    
163     <p>
164     In the <c>USE</c> variable you define keywords which are mapped onto
165     compile-options. For instance, <e>ssl</e> will compile ssl-support in the
166     programs that support it. <e>-X</e> will remove X-server support (note the minus
167     sign in front). <e>gnome gtk -kde -qt</e> will compile your programs with gnome
168     (and gtk) support, and not with kde (and qt) support, making your system fully
169     tweaked for GNOME.
170     </p>
171    
172     <p>
173     The default <c>USE</c> settings are placed in
174     <path>/etc/make.profile/make.defaults</path>. What you place in
175     <path>/etc/make.conf</path> is calculated against these defaults settings. If
176     you add something to the <c>USE</c> setting, it is added to the default list. If
177     you remove something from the <c>USE</c> setting (by placing a minus sign in
178     front of it) it is removed from the default list (if it was in the default list
179     at all). <e>Never</e> alter anything inside the <path>/etc/make.profile</path>
180     directory; it gets overwritten when you update Portage!
181     </p>
182    
183     <p>
184     A full description on <c>USE</c> can be found in the second part of the Gentoo
185 neysx 1.52 Handbook, <uri link="?part=2&amp;chap=2">USE flags</uri>. A full description on
186     the available USE flags can be found on your system in
187 swift 1.23 <path>/usr/portage/profiles/use.desc</path>.
188     </p>
189    
190     <pre caption="Viewing available USE flags">
191     # <i>less /usr/portage/profiles/use.desc</i>
192 swift 1.45 <comment>(You can scroll using your arrow keys, exit by pressing 'q')</comment>
193 swift 1.23 </pre>
194    
195     <p>
196     As an example we show a <c>USE</c> setting for a KDE-based system with DVD, ALSA
197     and CD Recording support:
198 swift 1.21 </p>
199    
200     <pre caption="Opening /etc/make.conf">
201     # <i>nano -w /etc/make.conf</i>
202     </pre>
203    
204     <pre caption="USE setting">
205     USE="-gtk -gnome qt kde dvd alsa cdr"
206     </pre>
207    
208 dertobi123 1.53 <p>
209     You will probably only use one or maybe two locales on your system. Up until now
210     after compiling <c>glibc</c> a full set of all available locales has been
211     created. As of now you can activate the <c>userlocales</c> USE flag und specify
212     only the locales you will need in <path>/etc/locales.build</path>.
213     </p>
214    
215     <pre caption="Activate the userlocales USE flag especially for glibc">
216 swift 1.54 # <i>mkdir /etc/portage</i>
217     # <i>echo "sys-libs/glibc userlocales" >> /etc/portage/package.use</i>
218 dertobi123 1.53 </pre>
219    
220     <p>
221     Now specify the locales you want to be able to use:
222     </p>
223    
224     <pre caption="nano -w /etc/locales.build">
225     en_US/ISO-8859-1
226     en_US.UTF-8/UTF-8
227     de_DE/ISO-8859-1
228     de_DE@euro/ISO-8859-15
229     </pre>
230    
231 swift 1.21 </body>
232     </subsection>
233     <subsection>
234 swift 1.8 <title>Optional: Using Distributed Compiling</title>
235     <body>
236    
237     <p>
238     If you are interested in using a collection of systems to help in compiling your
239     system you might want to take a look at our <uri
240     link="/doc/en/distcc.xml">DistCC Guide</uri>. By using <c>distcc</c> you can use
241     the processing power of several systems to aid you with the installation.
242     </p>
243 swift 1.2
244     </body>
245 swift 1.1 </subsection>
246 swift 1.3 </section>
247     <section>
248 swift 1.1 <title>Differences between Stage1, Stage2 and Stage3</title>
249     <body>
250    
251     <p>
252     Now take a seat and think of your previous steps. We asked you to
253     select a <e>stage1</e>, <e>stage2</e> or <e>stage3</e> and warned you
254     that your choice is important for further installation steps. Well, this
255 neysx 1.48 is the first place where your choice defines the subsequent steps.
256 swift 1.1 </p>
257    
258     <ul>
259     <li>
260 swift 1.4 If you chose <e>stage1</e>, then you have to follow <e>both</e> steps in
261     this chapter (starting with <uri link="#doc_chap3">Progressing from Stage1
262     to Stage2</uri>)
263 swift 1.1 </li>
264     <li>
265 swift 1.4 If you chose <e>stage2</e> you only can skip the first step
266     and immediately start with the second one (<uri link="#doc_chap4">Progressing
267     from Stage2 to Stage3</uri>)
268 swift 1.1 </li>
269     <li>
270 swift 1.4 If you chose <e>stage3</e> (either with or without GRP) then you can skip both
271 swift 1.31 steps and continue with <uri link="?part=1&amp;chap=7">Configuring the
272     Kernel</uri>
273 swift 1.1 </li>
274     </ul>
275    
276     </body>
277 swift 1.3 </section>
278     <section>
279     <title>Progressing from Stage1 to Stage2</title>
280 swift 1.1 <subsection>
281     <title>Introduction to Bootstrapping</title>
282     <body>
283    
284     <p>
285     So, you want to compile everything from scratch? Okay then :-)
286     </p>
287    
288     <p>
289     In this step, we will <e>bootstrap</e> your Gentoo system. This takes a
290     long time, but the result is a system that has been optimized from the
291     ground up for your specific machine and needs.
292     </p>
293    
294     <p>
295     <e>Bootstrapping</e> means building the GNU C Library, GNU Compiler
296 swift 1.32 Collection and several other key system programs.
297 swift 1.1 </p>
298    
299     <p>
300     Before starting the bootstrap, we list a couple of options you might or
301 swift 1.4 might not want. If you do not want to read those, continue with <uri
302 swift 1.41 link="#bootstrap">Bootstrapping the System</uri>.
303 swift 1.1 </p>
304    
305     </body>
306 swift 1.3 </subsection>
307     <subsection>
308 swift 1.1 <title>Optional: Downloading the Sources First</title>
309     <body>
310    
311     <p>
312 swift 1.25 If you haven't copied over all source code before, then the bootstrap
313 swift 1.1 script will download all necessary files. It goes without saying that
314     this only works if you have a working network connnection :-) If you want to
315 swift 1.25 download the source code first and later bootstrap the system (for instance
316 swift 1.1 because you don't want to have your internet connection open during the
317     compilation) use the <e>-f</e> option of the bootstrap script, which will
318 swift 1.25 fetch (hence the letter <e>f</e>) all source code for you.
319 swift 1.1 </p>
320    
321     <pre caption = "Downloading the necessary sources">
322     # <i>cd /usr/portage</i>
323 swift 1.47 # <i>scripts/bootstrap.sh -f</i>
324 swift 1.1 </pre>
325    
326     </body>
327 swift 1.3 </subsection>
328 swift 1.41 <subsection id="bootstrap">
329 swift 1.1 <title>Bootstrapping the System</title>
330     <body>
331    
332     <p>
333     Okay then, take your keyboard and punch in the next commands to start
334 swift 1.36 the bootstrap. Then go amuse yourself with something else because this step
335     takes quite some time to finish.
336 swift 1.1 </p>
337    
338     <pre caption = "Bootstrapping the system">
339     # <i>cd /usr/portage</i>
340 swift 1.47 # <i>scripts/bootstrap.sh</i>
341 swift 1.12 </pre>
342    
343     <p>
344 swift 1.4 Now continue with the next step, <uri link="#doc_chap4">Progressing from Stage2
345     to Stage3</uri>.
346     </p>
347    
348 swift 1.1 </body>
349     </subsection>
350 swift 1.3 </section>
351     <section>
352     <title>Progressing from Stage2 to Stage3</title>
353 swift 1.1 <subsection>
354     <title>Introduction</title>
355     <body>
356    
357     <p>
358     If you are reading this section, then you have a bootstrapped system
359     (either because you bootstrapped it previously, or you are using a
360     <e>stage2</e>). Then it is now time to build all system packages.
361     </p>
362    
363     <p>
364     <e>All</e> system packages? No, not really. In this step, you will build
365 swift 1.19 the system packages of which there are no alternatives to use.
366     Some system packages have several alternatives (such as system loggers)
367 swift 1.1 and as Gentoo is all about choices, we don't want to force one upon you.
368     </p>
369    
370     </body>
371 swift 1.3 </subsection>
372     <subsection>
373 swift 1.1 <title>Optional: Viewing what will be done</title>
374     <body>
375    
376     <p>
377     If you want to know what packages will be installed, execute <c>emerge
378 swift 1.14 --pretend system</c>. This will list all packages that will be built. As this
379 swift 1.1 list is pretty big, you should also use a pager like <c>less</c> or
380     <c>more</c> to go up and down the list.
381     </p>
382    
383     <pre caption = "View what 'emerge system' will do">
384 swift 1.14 # <i>emerge --pretend system | less</i>
385 swift 1.1 </pre>
386    
387     </body>
388 swift 1.3 </subsection>
389     <subsection>
390 swift 1.4 <title>Optional: Downloading the Sources</title>
391 swift 1.1 <body>
392    
393     <p>
394     If you want <c>emerge</c> to download the sources before you continue
395     (for instance because you don't want the internet connection to be left
396 swift 1.20 open while you are building all packages) you can use the <e>--fetchonly</e>
397 swift 1.1 option of <c>emerge</c> which will fetch all sources for you.
398     </p>
399    
400     <pre caption = "Fetching the sources">
401 swift 1.14 # <i>emerge --fetchonly system</i>
402 swift 1.1 </pre>
403    
404     </body>
405 swift 1.3 </subsection>
406     <subsection>
407 swift 1.1 <title>Building the System</title>
408     <body>
409    
410     <p>
411     To start building the system, execute <c>emerge system</c>. Then go do
412 swift 1.4 something to keep your mind busy, because this step takes a long time to
413     complete.
414 swift 1.1 </p>
415    
416     <pre caption = "Building the System">
417     # <i>emerge system</i>
418     </pre>
419    
420     <p>
421 swift 1.30 You can for now safely ignore any warnings about updated configuration files
422     (and running <c>etc-update</c>). When your Gentoo system is fully installed and
423     booted, do read our documentation on <uri
424 neysx 1.52 link="?part=3&amp;chap=2#doc_chap3">Configuration File Protection</uri>.
425 swift 1.28 </p>
426    
427     <p>
428 swift 1.31 When the build process has completed, continue with <uri
429     link="?part=1&amp;chap=7">Configuring the Kernel</uri>.
430 swift 1.28 </p>
431    
432     </body>
433     </subsection>
434     </section>
435    
436 swift 1.3 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20