/[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.26 - (show annotations) (download) (as text)
Thu Jan 8 14:23:17 2004 UTC (10 years, 6 months ago) by swift
Branch: MAIN
Changes since 1.25: +4 -1 lines
File MIME type: application/xml
Add necessary xml constructs on top of all hb-files, tx to neysx

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

  ViewVC Help
Powered by ViewVC 1.1.20