/[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.58 - (show annotations) (download) (as text)
Sat Nov 20 22:23:30 2004 UTC (10 years ago) by neysx
Branch: MAIN
Changes since 1.57: +2 -2 lines
File MIME type: application/xml
Converted dates to YYYY-MM-DD format

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

  ViewVC Help
Powered by ViewVC 1.1.20