/[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.37 - (hide annotations) (download) (as text)
Sun May 30 15:07:32 2004 UTC (9 years, 10 months ago) by neysx
Branch: MAIN
Changes since 1.36: +2 -2 lines
File MIME type: application/xml
Filter out rogue line from mirrorselect that b0rks /etc/make.conf
See #52264

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

  ViewVC Help
Powered by ViewVC 1.1.20