/[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.28 - (hide annotations) (download) (as text)
Mon Mar 1 05:43:41 2004 UTC (10 years, 7 months ago) by swift
Branch: MAIN
Changes since 1.27: +129 -9 lines
File MIME type: application/xml
Move from draft - 2004.0 is released

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.28 <!-- $Header: /home/cvsroot/gentoo/xml/htdocs/doc/en/handbook/draft/hb-install-system.xml,v 1.3 2004/02/24 16:14:55 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     # <i>mirrorselect -a -s4 -o &gt;&gt; /mnt/gentoo/etc/make.conf</i>
24     </pre>
25    
26     <p>
27     If for some reason <c>mirrorselect</c> fails, don't panic. This step is
28     completely optional. If <c>mirrorselect</c> fails, the default values suffice.
29     </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     # <i>cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</i>
47 swift 1.18 </pre>
48    
49     </body>
50     </subsection>
51     <subsection>
52     <title>Optional: Mounting /dev</title>
53     <body>
54    
55     <p>
56     Knoppix users (and people that install Gentoo from an installation medium that
57 swift 1.22 does not use DevFS) should now bind-mount the <path>/dev</path> structure. If
58     you use one of our LiveCDs you can skip this step.
59 swift 1.18 </p>
60    
61     <pre caption="Bind-mounting /dev">
62     # <i>mkdir /mnt/gentoo/dev</i>
63     # <i>mount -o bind /dev /mnt/gentoo/dev</i>
64 swift 1.5 </pre>
65    
66     </body>
67     </subsection>
68     <subsection>
69 swift 1.2 <title>Entering the new Environment</title>
70 swift 1.1 <body>
71    
72     <p>
73 swift 1.19 Now that all partitions are initialized and the base environment
74 swift 1.1 installed, it is time to enter our new installation environment by
75 swift 1.9 <e>chrooting</e> into it. This means that we change from the current
76 swift 1.2 installation environment (LiveCD or other installation medium) to your
77 swift 1.19 installation system (namely the initialized partitions).
78 swift 1.1 </p>
79    
80     <p>
81     This chrooting is done in three steps. First we will change the root
82 swift 1.2 from <path>/</path> (on the installation medium) to <path>/mnt/gentoo</path>
83     (on your partitions) using <c>chroot</c>. Then we will create a new environment
84     using <c>env-update</c>, which essentially creates environment variables.
85 swift 1.1 Finally, we load those variables into memory using <c>source</c>.
86     </p>
87    
88     <pre caption = "Chrooting into the new environment">
89     # <i>chroot /mnt/gentoo /bin/bash</i>
90     # <i>env-update</i>
91     Regenerating /etc/ld.so.cache...
92     # <i>source /etc/profile</i>
93     </pre>
94    
95     <p>
96     Congratulations! You are now inside your own Gentoo Linux environment.
97 swift 1.10 Of course it is far from finished, which is why the installation still
98 swift 1.1 has some sections left :-)
99     </p>
100    
101     </body>
102 swift 1.3 </subsection>
103     <subsection>
104 swift 1.2 <title>Optional: Updating Portage</title>
105     <body>
106    
107     <p>
108 swift 1.28 If you haven't installed a Portage snapshot in the previous chapter, you must
109     download a recent Portage tree from the Internet. <c>emerge sync</c> does this
110     for you. Other users should skip this and continue with <uri
111     link="#configure_USE">Configuring the USE variable</uri>.
112 swift 1.2 </p>
113    
114     <pre caption="Updating Portage">
115     # <i>emerge sync</i>
116 swift 1.27 <comment>(In case you are unable to use rsync, use "emerge-webrsync" which
117     downloads and installs a portage snapshot for you)</comment>
118     # <i>emerge-webrsync</i>
119 swift 1.13 </pre>
120    
121     <p>
122     If you are warned that a new Portage version is available and that you should
123 neysx 1.15 update Portage, you can safely ignore it. Portage will be updated for you later
124 bennyc 1.16 on during the installation.
125 swift 1.13 </p>
126 swift 1.8
127     </body>
128     </subsection>
129 swift 1.28 <subsection id="configure_USE">
130 swift 1.21 <title>Configuring the USE variable</title>
131     <body>
132    
133     <p>
134     <c>USE</c> is one of the most powerful variables Gentoo provides to its users.
135     Several programs can be compiled with or without optional support for certain
136     items. For instance, some programs can be compiled with gtk-support, or with
137     qt-support. Others can be compiled with or without SSL support. Some programs
138     can even be compiled with framebuffer support (svgalib) instead of X11 support
139     (X-server).
140     </p>
141    
142     <p>
143     Most distributions compile their packages with support for as much as possible,
144     increasing the size of the programs and startup time, not to mention an enormous
145 swift 1.24 amount of dependencies. With Gentoo you can define what options a package
146 swift 1.21 should be compiled with. This is where <c>USE</c> comes into play.
147     </p>
148    
149     <p>
150     In the <c>USE</c> variable you define keywords which are mapped onto
151     compile-options. For instance, <e>ssl</e> will compile ssl-support in the
152     programs that support it. <e>-X</e> will remove X-server support (note the minus
153     sign in front). <e>gnome gtk -kde -qt</e> will compile your programs with gnome
154     (and gtk) support, and not with kde (and qt) support, making your system fully
155     tweaked for GNOME.
156     </p>
157    
158     <p>
159     The default <c>USE</c> settings are placed in
160     <path>/etc/make.profile/make.defaults</path>. What you place in
161     <path>/etc/make.conf</path> is calculated against these defaults settings. If
162     you add something to the <c>USE</c> setting, it is added to the default list. If
163     you remove something from the <c>USE</c> setting (by placing a minus sign in
164     front of it) it is removed from the default list (if it was in the default list
165     at all). <e>Never</e> alter anything inside the <path>/etc/make.profile</path>
166     directory; it gets overwritten when you update Portage!
167     </p>
168    
169     <p>
170     A full description on <c>USE</c> can be found in the second part of the Gentoo
171 swift 1.23 Handbook, <uri link="?part=2&amp;chap=1">Chapter 1: USE flags</uri>. A full
172     description on the available USE flags can be found on your system in
173     <path>/usr/portage/profiles/use.desc</path>.
174     </p>
175    
176     <pre caption="Viewing available USE flags">
177     # <i>less /usr/portage/profiles/use.desc</i>
178     </pre>
179    
180     <p>
181     As an example we show a <c>USE</c> setting for a KDE-based system with DVD, ALSA
182     and CD Recording support:
183 swift 1.21 </p>
184    
185     <pre caption="Opening /etc/make.conf">
186     # <i>nano -w /etc/make.conf</i>
187     </pre>
188    
189     <pre caption="USE setting">
190     USE="-gtk -gnome qt kde dvd alsa cdr"
191     </pre>
192    
193     </body>
194     </subsection>
195     <subsection>
196 swift 1.8 <title>Optional: Using Distributed Compiling</title>
197     <body>
198    
199     <p>
200     If you are interested in using a collection of systems to help in compiling your
201     system you might want to take a look at our <uri
202     link="/doc/en/distcc.xml">DistCC Guide</uri>. By using <c>distcc</c> you can use
203     the processing power of several systems to aid you with the installation.
204     </p>
205 swift 1.2
206     </body>
207 swift 1.1 </subsection>
208 swift 1.3 </section>
209     <section>
210 swift 1.1 <title>Differences between Stage1, Stage2 and Stage3</title>
211     <body>
212    
213     <p>
214     Now take a seat and think of your previous steps. We asked you to
215     select a <e>stage1</e>, <e>stage2</e> or <e>stage3</e> and warned you
216     that your choice is important for further installation steps. Well, this
217     is the first place where your choice defines the further steps.
218     </p>
219    
220     <ul>
221     <li>
222 swift 1.4 If you chose <e>stage1</e>, then you have to follow <e>both</e> steps in
223     this chapter (starting with <uri link="#doc_chap3">Progressing from Stage1
224     to Stage2</uri>)
225 swift 1.1 </li>
226     <li>
227 swift 1.4 If you chose <e>stage2</e> you only can skip the first step
228     and immediately start with the second one (<uri link="#doc_chap4">Progressing
229     from Stage2 to Stage3</uri>)
230 swift 1.1 </li>
231     <li>
232 swift 1.4 If you chose <e>stage3</e> (either with or without GRP) then you can skip both
233 swift 1.28 steps. If you want to use GRP, continue with <uri
234     link="#preparing_grp">Optional: Preparing for GRP</uri>. Otherwise continue
235     with <uri link="?part=1&amp;chap=7">Configuring the Kernel</uri>
236 swift 1.1 </li>
237     </ul>
238    
239     </body>
240 swift 1.3 </section>
241     <section>
242     <title>Progressing from Stage1 to Stage2</title>
243 swift 1.1 <subsection>
244     <title>Introduction to Bootstrapping</title>
245     <body>
246    
247     <p>
248     So, you want to compile everything from scratch? Okay then :-)
249     </p>
250    
251     <p>
252     In this step, we will <e>bootstrap</e> your Gentoo system. This takes a
253     long time, but the result is a system that has been optimized from the
254     ground up for your specific machine and needs.
255     </p>
256    
257     <p>
258     <e>Bootstrapping</e> means building the GNU C Library, GNU Compiler
259     Collection and several other key system programs. The GNU Compiler
260     Collection even has to be built twice: first with the "generic" compiler
261     we provide, and a second time with the compiler you then just built.
262     </p>
263    
264     <p>
265     Before starting the bootstrap, we list a couple of options you might or
266 swift 1.4 might not want. If you do not want to read those, continue with <uri
267     link="#doc_chap3_sect4">Bootstrapping the System</uri>.
268 swift 1.1 </p>
269    
270     </body>
271 swift 1.3 </subsection>
272     <subsection>
273 swift 1.1 <title>Optional: Decreasing Compilation Time</title>
274     <body>
275    
276     <p>
277     If you want to speed up the bootstrapping, you can temporarily deselect
278     java-support. This means that the GNU Compiler Collection and the GNU C
279     Library will be compiled without java-support (which decreases
280     compilation time considerably). Although this means that you wont have
281 swift 1.17 the GNU Java Compiler (<c>gcj</c>) this does <e>not</e> mean that your
282 swift 1.1 system won't be able to use java applets and other java-related stuff.
283     </p>
284    
285     <p>
286     To deselect java-support temporarily, define <e>USE="-java"</e> before
287     firing up the bootstrap script.
288     </p>
289    
290     <pre caption = "Deselecting java support">
291     # <i>export USE="-java"</i>
292     </pre>
293    
294 swift 1.7 <p>
295     Don't forget to unset the variable after bootstrapping:
296     </p>
297    
298     <pre caption="Unsetting USE">
299     # <i>unset USE</i>
300     </pre>
301    
302 swift 1.1 </body>
303 swift 1.3 </subsection>
304     <subsection>
305 swift 1.1 <title>Optional: Downloading the Sources First</title>
306     <body>
307    
308     <p>
309 swift 1.25 If you haven't copied over all source code before, then the bootstrap
310 swift 1.1 script will download all necessary files. It goes without saying that
311     this only works if you have a working network connnection :-) If you want to
312 swift 1.25 download the source code first and later bootstrap the system (for instance
313 swift 1.1 because you don't want to have your internet connection open during the
314     compilation) use the <e>-f</e> option of the bootstrap script, which will
315 swift 1.25 fetch (hence the letter <e>f</e>) all source code for you.
316 swift 1.1 </p>
317    
318     <pre caption = "Downloading the necessary sources">
319     # <i>cd /usr/portage</i>
320     # <i>scripts/bootstrap.sh -f</i>
321     </pre>
322    
323     </body>
324 swift 1.3 </subsection>
325     <subsection>
326 swift 1.1 <title>Bootstrapping the System</title>
327     <body>
328    
329     <p>
330     Okay then, take your keyboard and punch in the next commands to start
331 swift 1.4 the bootstrap. Then go amuse yourself with something else (for instance harass
332     Gentoo developers on #gentoo), because this step takes quite some time to
333     finish.
334 swift 1.1 </p>
335    
336     <pre caption = "Bootstrapping the system">
337     # <i>cd /usr/portage</i>
338     # <i>scripts/bootstrap.sh</i>
339 swift 1.12 </pre>
340    
341     <p>
342     If you have altered the <c>CHOST</c> setting in <path>/etc/make.conf</path>
343 swift 1.19 previously, you need to reinitialize some variables in order for <c>gcc</c> to
344 swift 1.12 work fast:
345     </p>
346    
347 swift 1.19 <pre caption="Reinitialize environment variables">
348 swift 1.12 # <i>source /etc/profile</i>
349 swift 1.1 </pre>
350    
351 swift 1.4 <p>
352     Now continue with the next step, <uri link="#doc_chap4">Progressing from Stage2
353     to Stage3</uri>.
354     </p>
355    
356 swift 1.1 </body>
357     </subsection>
358 swift 1.3 </section>
359     <section>
360     <title>Progressing from Stage2 to Stage3</title>
361 swift 1.1 <subsection>
362     <title>Introduction</title>
363     <body>
364    
365     <p>
366     If you are reading this section, then you have a bootstrapped system
367     (either because you bootstrapped it previously, or you are using a
368     <e>stage2</e>). Then it is now time to build all system packages.
369     </p>
370    
371     <p>
372     <e>All</e> system packages? No, not really. In this step, you will build
373 swift 1.19 the system packages of which there are no alternatives to use.
374     Some system packages have several alternatives (such as system loggers)
375 swift 1.1 and as Gentoo is all about choices, we don't want to force one upon you.
376     </p>
377    
378     </body>
379 swift 1.3 </subsection>
380     <subsection>
381 swift 1.1 <title>Optional: Viewing what will be done</title>
382     <body>
383    
384     <p>
385     If you want to know what packages will be installed, execute <c>emerge
386 swift 1.14 --pretend system</c>. This will list all packages that will be built. As this
387 swift 1.1 list is pretty big, you should also use a pager like <c>less</c> or
388     <c>more</c> to go up and down the list.
389     </p>
390    
391     <pre caption = "View what 'emerge system' will do">
392 swift 1.14 # <i>emerge --pretend system | less</i>
393 swift 1.1 </pre>
394    
395     </body>
396 swift 1.3 </subsection>
397     <subsection>
398 swift 1.4 <title>Optional: Downloading the Sources</title>
399 swift 1.1 <body>
400    
401     <p>
402     If you want <c>emerge</c> to download the sources before you continue
403     (for instance because you don't want the internet connection to be left
404 swift 1.20 open while you are building all packages) you can use the <e>--fetchonly</e>
405 swift 1.1 option of <c>emerge</c> which will fetch all sources for you.
406     </p>
407    
408     <pre caption = "Fetching the sources">
409 swift 1.14 # <i>emerge --fetchonly system</i>
410 swift 1.1 </pre>
411    
412     </body>
413 swift 1.3 </subsection>
414     <subsection>
415 swift 1.1 <title>Building the System</title>
416     <body>
417    
418     <p>
419     To start building the system, execute <c>emerge system</c>. Then go do
420 swift 1.4 something to keep your mind busy, because this step takes a long time to
421     complete.
422 swift 1.1 </p>
423    
424     <pre caption = "Building the System">
425     # <i>emerge system</i>
426     </pre>
427    
428     <p>
429 swift 1.4 When the building has completed, continue with <uri
430     link="?part=1&amp;chap=7">Configuring the Kernel</uri>.
431 swift 1.1 </p>
432    
433     </body>
434     </subsection>
435     </section>
436 swift 1.28 <section id="preparing_grp">
437     <title>Optional: Preparing for GRP</title>
438     <subsection>
439     <title>Introduction</title>
440     <body>
441    
442     <p>
443     If you are booted from a x86 or ppc CD-1 LiveCD you can relax and continue with
444     <uri link="?part=1&amp;chap=7">Configuring the Kernel</uri> as the installation
445     of prebuilt packages happens at the very end of the installation.
446     </p>
447    
448     <p>
449     If you are booted from a different architecture LiveCD and you want to use the
450     prebuilt packages provided by the LiveCD, continue with <uri
451     link="#copying_from_livecd">Copying over the GRP packages</uri>.
452     </p>
453    
454     <p>
455     If you want to use the prebuilt packages provided by a Gentoo mirror, continue
456     with <uri link="#grp_downloads">Configuring Portage for GRP Downloads</uri>.
457     </p>
458    
459     </body>
460     </subsection>
461     <subsection id="copying_from_livecd">
462     <title>Copying over the GRP packages</title>
463     <body>
464    
465     <p>
466     You should now copy over the packages onto your filesystem so that Portage is
467     able to use them. First of all, open a second terminal by pressing
468     <c>Alt-F2</c>. This is needed as we need to work from the LiveCD, not from the
469     chrooted environment you're currently working in.
470     </p>
471    
472     <p>
473     You should be greeted by a root prompt (<c>#</c>). Copy over the packages using
474     the following commands:
475     </p>
476    
477     <pre caption="Copy over precompiled packages">
478     # <i>mkdir -p /mnt/gentoo/usr/portage/packages/All</i>
479     # <i>cp /mnt/cdrom/packages/All/* /mnt/gentoo/usr/portage/packages/All/</i>
480     </pre>
481    
482     <p>
483     After this step has completed, return to the chrooted environment by pressing
484     <c>Alt-F1</c>.
485     </p>
486    
487     <p>
488     Now pay close attention! Your Portage snapshot is in place and the GRP packages
489     are ready to be used. However, Portage doesn't automagically use them unless you
490     tell it to. Luckily, this is hardly difficult: every time you are asked to
491     install a package using <c>emerge</c>, you must add <c>--usepkg</c> as an
492     option:
493     </p>
494    
495     <pre caption="Example for Installing a GRP Package">
496     <comment>(Example without GRP)</comment>
497     # <i>emerge vanilla-sources</i>
498    
499     <comment>(Example with GRP)</comment>
500     # <i>emerge --usepkg vanilla-sources</i>
501     </pre>
502    
503     <p>
504     That's all there is to it. Just don't forget to add <c>--usepkg</c>. Now
505     continue with <uri link="?part=1&amp;chap=7">Configuring the Kernel</uri>.
506     </p>
507    
508    
509     </body>
510     </subsection>
511     <subsection id="grp_downloads">
512     <title>Configuring Portage for GRP Downloads</title>
513     <body>
514    
515     <p>
516     First of all, you need to edit <path>/etc/make.conf</path> and define
517     the <c>PORTAGE_BINHOST</c> variable so that it points to the server from which
518     you want to download the GRP packages. Please check our <uri
519     link="/main/en/mirrors.xml">mirror list</uri> for the available mirrors.
520     </p>
521    
522     <pre caption="Editing /mnt/gentoo/etc/make.conf">
523     # <i>nano -w /etc/make.conf</i>
524     </pre>
525    
526     <pre caption="Setting the PORTAGE_BINHOST variable">
527     PORTAGE_BINHOST="ftp://some.mirror.com/pub/gentoo/grp/2004/athlon-xp"
528     </pre>
529    
530     <p>
531     Save and exit (by pressing Ctrl-X and confirming). With this in place, you must
532     now pay close attention. Portage will not automagically download the GRP
533     packages if you don't instruct it to. However, this isn't hard: every time you
534     are asked to install a package using <c>emerge</c>, you must add
535     <c>--getbinpkg</c> as an option:
536     </p>
537    
538     <pre caption="Example for Downloading GRP Packages">
539     <comment>(Example without downloading GRP)</comment>
540     # <i>emerge vanilla-sources</i>
541    
542     <comment>(Example with downloading GRP)</comment>
543     # <i>emerge --getbinpkg vanilla-sources</i>
544     </pre>
545    
546     <p>
547     That's all there is to it. Just don't forget to add <c>--getbinpkg</c>. Now
548     continue with <uri link="?part=1&amp;chap=7">Configuring the Kernel</uri>.
549     </p>
550    
551     </body>
552     </subsection>
553     </section>
554    
555 swift 1.3 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20