/[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.24 - (hide annotations) (download) (as text)
Tue Jan 6 10:06:41 2004 UTC (10 years, 3 months ago) by swift
Branch: MAIN
Changes since 1.23: +6 -6 lines
File MIME type: application/xml
Fix typos, #37377

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

  ViewVC Help
Powered by ViewVC 1.1.20