/[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.39 - (show annotations) (download) (as text)
Fri Jul 16 09:42:37 2004 UTC (10 years, 5 months ago) by neysx
Branch: MAIN
Changes since 1.38: +2 -2 lines
File MIME type: application/xml
#57264: updated output from env-update
#57266: typo (s/socalled/so-called/)

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

  ViewVC Help
Powered by ViewVC 1.1.20