/[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.56 - (show annotations) (download) (as text)
Tue Nov 9 13:01:52 2004 UTC (10 years ago) by swift
Branch: MAIN
Changes since 1.55: +5 -1 lines
File MIME type: application/xml
Adding version/date information in pages

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.55 2004/11/06 15:07:49 swift Exp $ -->
8
9 <sections>
10
11 <version>1.55</version>
12 <date>November 6, 2004</date>
13
14 <section>
15 <title>Chrooting</title>
16 <subsection>
17 <title>Optional: Selecting Mirrors</title>
18 <body>
19
20 <p>
21 If you have booted from a Gentoo LiveCD, you are able to use <c>mirrorselect</c>
22 to update <path>/etc/make.conf</path> so fast mirrors are used for both Portage
23 and source code (of course in case you have a working network connection):
24 </p>
25
26 <warn>
27 An error within mirrorselect might make it output garbage after the
28 GENTOO_MIRRORS statement. Please open <path>/mnt/gentoo/etc/make.conf</path>
29 and remove the garbage at the end of the GENTOO_MIRRORS statement if applicable.
30 </warn>
31
32 <pre caption="Selecting fast mirrors">
33 # <i>mirrorselect -a -s4 -o | grep 'GENTOO_MIRRORS=' &gt;&gt; /mnt/gentoo/etc/make.conf</i>
34 </pre>
35
36 <p>
37 If for some reason <c>mirrorselect</c> fails, don't panic. This step is
38 completely optional, the default values suffice.
39 </p>
40
41 </body>
42 </subsection>
43 <subsection>
44 <title>Copy DNS Info</title>
45 <body>
46
47 <p>
48 One thing still remains to be done before we enter the new environment and that
49 is copying over the DNS information in <path>/etc/resolv.conf</path>. You need
50 to do this to ensure that networking still works even after entering the new
51 environment. <path>/etc/resolv.conf</path> contains the nameservers for your
52 network.
53 </p>
54
55 <pre caption="Copy over DNS information">
56 <comment>(The "-L" option is needed to make sure we don't copy a symbolic link)</comment>
57 # <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</i>
58 </pre>
59
60 </body>
61 </subsection>
62 <subsection>
63 <title>Mounting the proc Filesystem</title>
64 <body>
65
66 <p>
67 Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to
68 allow the installation to use the kernel-provided information even within the
69 chrooted environment.
70 </p>
71
72 <pre caption="Mounting /proc">
73 # <i>mount -t proc none /mnt/gentoo/proc</i>
74 </pre>
75
76 </body>
77 </subsection>
78 <subsection>
79 <title>Entering the new Environment</title>
80 <body>
81
82 <p>
83 Now that all partitions are initialized and the base environment
84 installed, it is time to enter our new installation environment by
85 <e>chrooting</e> into it. This means that we change from the current
86 installation environment (LiveCD or other installation medium) to your
87 installation system (namely the initialized partitions).
88 </p>
89
90 <p>
91 This chrooting is done in three steps. First we will change the root
92 from <path>/</path> (on the installation medium) to <path>/mnt/gentoo</path>
93 (on your partitions) using <c>chroot</c>. Then we will create a new environment
94 using <c>env-update</c>, which essentially creates environment variables.
95 Finally, we load those variables into memory using <c>source</c>.
96 </p>
97
98 <pre caption = "Chrooting into the new environment">
99 # <i>chroot /mnt/gentoo /bin/bash</i>
100 # <i>env-update</i>
101 * Caching service dependencies...
102 # <i>source /etc/profile</i>
103 </pre>
104
105 <p>
106 Congratulations! You are now inside your own Gentoo Linux environment.
107 Of course it is far from finished, which is why the installation still
108 has some sections left :-)
109 </p>
110
111 </body>
112 </subsection>
113 <subsection>
114 <title>Optional: Updating the Portage tree</title>
115 <body>
116
117 <p>
118 If you haven't installed a Portage snapshot in the previous chapter, you must
119 download a recent Portage tree from the Internet. <c>emerge --sync</c> does this
120 for you. Other users should skip this and continue with <uri
121 link="#configure_USE">Configuring the USE variable</uri>.
122 </p>
123
124 <pre caption="Updating the Portage tree">
125 # <i>emerge --sync</i>
126 </pre>
127
128 <p>
129 Portage uses the RSYNC protocol for updating the Portage tree. If the above
130 command fails due to your firewall, use <c>emerge-webrsync</c> which
131 downloads and installs a Portage snapshot for you using the regular HTTP
132 protocol.
133 </p>
134
135 <pre caption="Updating the Portage tree with emerge-webrsync">
136 # <i>emerge-webrsync</i>
137 </pre>
138
139 <p>
140 If you are warned that a new Portage version is available and that you should
141 update Portage, you should ignore it. Portage will be updated for you later
142 on during the installation.
143 </p>
144
145 </body>
146 </subsection>
147 <subsection id="configure_USE">
148 <title>Configuring the USE variable</title>
149 <body>
150
151 <p>
152 <c>USE</c> is one of the most powerful variables Gentoo provides to its users.
153 Several programs can be compiled with or without optional support for certain
154 items. For instance, some programs can be compiled with gtk-support, or with
155 qt-support. Others can be compiled with or without SSL support. Some programs
156 can even be compiled with framebuffer support (svgalib) instead of X11 support
157 (X-server).
158 </p>
159
160 <p>
161 Most distributions compile their packages with support for as much as possible,
162 increasing the size of the programs and startup time, not to mention an enormous
163 amount of dependencies. With Gentoo you can define what options a package
164 should be compiled with. This is where <c>USE</c> comes into play.
165 </p>
166
167 <p>
168 In the <c>USE</c> variable you define keywords which are mapped onto
169 compile-options. For instance, <e>ssl</e> will compile ssl-support in the
170 programs that support it. <e>-X</e> will remove X-server support (note the minus
171 sign in front). <e>gnome gtk -kde -qt</e> will compile your programs with gnome
172 (and gtk) support, and not with kde (and qt) support, making your system fully
173 tweaked for GNOME.
174 </p>
175
176 <p>
177 The default <c>USE</c> settings are placed in
178 <path>/etc/make.profile/make.defaults</path>. What you place in
179 <path>/etc/make.conf</path> is calculated against these defaults settings. If
180 you add something to the <c>USE</c> setting, it is added to the default list. If
181 you remove something from the <c>USE</c> setting (by placing a minus sign in
182 front of it) it is removed from the default list (if it was in the default list
183 at all). <e>Never</e> alter anything inside the <path>/etc/make.profile</path>
184 directory; it gets overwritten when you update Portage!
185 </p>
186
187 <p>
188 A full description on <c>USE</c> can be found in the second part of the Gentoo
189 Handbook, <uri link="?part=2&amp;chap=2">USE flags</uri>. A full description on
190 the available USE flags can be found on your system in
191 <path>/usr/portage/profiles/use.desc</path>.
192 </p>
193
194 <pre caption="Viewing available USE flags">
195 # <i>less /usr/portage/profiles/use.desc</i>
196 <comment>(You can scroll using your arrow keys, exit by pressing 'q')</comment>
197 </pre>
198
199 <p>
200 As an example we show a <c>USE</c> setting for a KDE-based system with DVD, ALSA
201 and CD Recording support:
202 </p>
203
204 <pre caption="Opening /etc/make.conf">
205 # <i>nano -w /etc/make.conf</i>
206 </pre>
207
208 <pre caption="USE setting">
209 USE="-gtk -gnome qt kde dvd alsa cdr"
210 </pre>
211
212 <p>
213 You will probably only use one or maybe two locales on your system. Up until now
214 after compiling <c>glibc</c> a full set of all available locales will be
215 created. As of now you can activate the <c>userlocales</c> USE flag and specify
216 only the locales you will need in <path>/etc/locales.build</path>.
217 </p>
218
219 <pre caption="Activate the userlocales USE flag especially for glibc">
220 # <i>mkdir /etc/portage</i>
221 # <i>echo "sys-libs/glibc userlocales" >> /etc/portage/package.use</i>
222 </pre>
223
224 <p>
225 Now specify the locales you want to be able to use:
226 </p>
227
228 <pre caption="nano -w /etc/locales.build">
229 en_US/ISO-8859-1
230 en_US.UTF-8/UTF-8
231 de_DE/ISO-8859-1
232 de_DE@euro/ISO-8859-15
233 </pre>
234
235 </body>
236 </subsection>
237 <subsection>
238 <title>Optional: Using Distributed Compiling</title>
239 <body>
240
241 <p>
242 If you are interested in using a collection of systems to help in compiling your
243 system you might want to take a look at our <uri
244 link="/doc/en/distcc.xml">DistCC Guide</uri>. By using <c>distcc</c> you can use
245 the processing power of several systems to aid you with the installation.
246 </p>
247
248 </body>
249 </subsection>
250 </section>
251 <section>
252 <title>Differences between Stage1, Stage2 and Stage3</title>
253 <body>
254
255 <p>
256 Now take a seat and think of your previous steps. We asked you to
257 select a <e>stage1</e>, <e>stage2</e> or <e>stage3</e> and warned you
258 that your choice is important for further installation steps. Well, this
259 is the first place where your choice defines the subsequent steps.
260 </p>
261
262 <ul>
263 <li>
264 If you chose <e>stage1</e>, then you have to follow <e>both</e> steps in
265 this chapter (starting with <uri link="#doc_chap3">Progressing from Stage1
266 to Stage2</uri>)
267 </li>
268 <li>
269 If you chose <e>stage2</e> you only can skip the first step
270 and immediately start with the second one (<uri link="#doc_chap4">Progressing
271 from Stage2 to Stage3</uri>)
272 </li>
273 <li>
274 If you chose <e>stage3</e> (either with or without GRP) then you can skip both
275 steps and continue with <uri link="?part=1&amp;chap=7">Configuring the
276 Kernel</uri>
277 </li>
278 </ul>
279
280 </body>
281 </section>
282 <section>
283 <title>Progressing from Stage1 to Stage2</title>
284 <subsection>
285 <title>Introduction to Bootstrapping</title>
286 <body>
287
288 <p>
289 So, you want to compile everything from scratch? Okay then :-)
290 </p>
291
292 <p>
293 In this step, we will <e>bootstrap</e> your Gentoo system. This takes a
294 long time, but the result is a system that has been optimized from the
295 ground up for your specific machine and needs.
296 </p>
297
298 <p>
299 <e>Bootstrapping</e> means building the GNU C Library, GNU Compiler
300 Collection and several other key system programs.
301 </p>
302
303 <p>
304 Before starting the bootstrap, we list a couple of options you might or
305 might not want. If you do not want to read those, continue with <uri
306 link="#bootstrap">Bootstrapping the System</uri>.
307 </p>
308
309 </body>
310 </subsection>
311 <subsection>
312 <title>Optional: Downloading the Sources First</title>
313 <body>
314
315 <p>
316 If you haven't copied over all source code before, then the bootstrap
317 script will download all necessary files. It goes without saying that
318 this only works if you have a working network connnection :-) If you want to
319 download the source code first and later bootstrap the system (for instance
320 because you don't want to have your internet connection open during the
321 compilation) use the <e>-f</e> option of the bootstrap script, which will
322 fetch (hence the letter <e>f</e>) all source code for you.
323 </p>
324
325 <pre caption = "Downloading the necessary sources">
326 # <i>cd /usr/portage</i>
327 # <i>scripts/bootstrap.sh -f</i>
328 </pre>
329
330 </body>
331 </subsection>
332 <subsection id="bootstrap">
333 <title>Bootstrapping the System</title>
334 <body>
335
336 <p>
337 Okay then, take your keyboard and punch in the next commands to start
338 the bootstrap. Then go amuse yourself with something else because this step
339 takes quite some time to finish.
340 </p>
341
342 <pre caption = "Bootstrapping the system">
343 # <i>cd /usr/portage</i>
344 # <i>scripts/bootstrap.sh</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 You can for now safely ignore any warnings about updated configuration files
426 (and running <c>etc-update</c>). When your Gentoo system is fully installed and
427 booted, do read our documentation on <uri
428 link="?part=3&amp;chap=2#doc_chap3">Configuration File Protection</uri>.
429 </p>
430
431 <p>
432 When the build process has completed, continue with <uri
433 link="?part=1&amp;chap=7">Configuring the Kernel</uri>.
434 </p>
435
436 </body>
437 </subsection>
438 </section>
439
440 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20