/[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.72 - (show annotations) (download) (as text)
Mon Mar 28 11:30:53 2005 UTC (9 years ago) by swift
Branch: MAIN
Changes since 1.71: +78 -12 lines
File MIME type: application/xml
Updating docos to 2005.0

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.71 2005/02/25 09:13:41 swift Exp $ -->
8
9 <sections>
10
11 <version>2.00</version>
12 <date>2005-03-28</date>
13
14 <section>
15 <title>Chrooting</title>
16 <subsection>
17 <title>Optional: Selecting Mirrors</title>
18 <body>
19
20 <p>
21 In order to download source code quickly it is recommended to select a fast
22 mirror. Portage will look in your <path>make.conf</path> file for the
23 GENTOO_MIRRORS variable and use the mirrors listed therein. You can surf to
24 our <uri link="/main/en/mirrors.xml">mirror list</uri> and search
25 for a mirror (or mirrors) close to you (as those are most frequently the
26 fastest ones), but we provide a nice tool called <c>mirrorselect</c> which
27 provides you with a nice interface to select the mirrors you want.
28 </p>
29
30 <pre caption="Using mirrorselect for the GENTOO_MIRRORS variable">
31 # <i>mirrorselect -i -o &gt;&gt; /mnt/gentoo/etc/make.conf</i>
32 </pre>
33
34 <warn>
35 Do not select any IPv6 mirrors. Our stages currently do not support IPv6.
36 </warn>
37
38 <p>
39 A second important setting is the SYNC setting in <path>make.conf</path>. This
40 variable contains the rsync server you want to use when updating your Portage
41 tree (the collection of ebuilds, scripts containing all the information Portage
42 needs to download and install software). Although you can manually enter a SYNC
43 server for yourself, <c>mirrorselect</c> can ease that operation for you:
44 </p>
45
46 <pre caption="Selecting an rsync mirror using mirrorselect">
47 # <i>mirrorselect -i -r -o &gt;&gt; /mnt/gentoo/etc/make.conf</i>
48 </pre>
49
50 <p>
51 After running <c>mirrorselect</c> it is adviseable to double-check the settings
52 in <path>/mnt/gentoo/etc/make.conf</path> !
53 </p>
54
55 </body>
56 </subsection>
57 <subsection>
58 <title>Copy DNS Info</title>
59 <body>
60
61 <p>
62 One thing still remains to be done before we enter the new environment and that
63 is copying over the DNS information in <path>/etc/resolv.conf</path>. You need
64 to do this to ensure that networking still works even after entering the new
65 environment. <path>/etc/resolv.conf</path> contains the nameservers for your
66 network.
67 </p>
68
69 <pre caption="Copy over DNS information">
70 <comment>(The "-L" option is needed to make sure we don't copy a symbolic link)</comment>
71 # <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</i>
72 </pre>
73
74 </body>
75 </subsection>
76 <subsection>
77 <title>Mounting the proc Filesystem</title>
78 <body>
79
80 <p>
81 Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to
82 allow the installation to use the kernel-provided information even within the
83 chrooted environment.
84 </p>
85
86 <pre caption="Mounting /proc">
87 # <i>mount -t proc none /mnt/gentoo/proc</i>
88 </pre>
89
90 </body>
91 </subsection>
92 <subsection>
93 <title>Entering the new Environment</title>
94 <body>
95
96 <p>
97 Now that all partitions are initialized and the base environment
98 installed, it is time to enter our new installation environment by
99 <e>chrooting</e> into it. This means that we change from the current
100 installation environment (Installation CD or other installation medium) to your
101 installation system (namely the initialized partitions).
102 </p>
103
104 <p>
105 This chrooting is done in three steps. First we will change the root
106 from <path>/</path> (on the installation medium) to <path>/mnt/gentoo</path>
107 (on your partitions) using <c>chroot</c>. Then we will create a new environment
108 using <c>env-update</c>, which essentially creates environment variables.
109 Finally, we load those variables into memory using <c>source</c>.
110 </p>
111
112 <pre caption = "Chrooting into the new environment">
113 # <i>chroot /mnt/gentoo /bin/bash</i>
114 # <i>env-update</i>
115 * Caching service dependencies...
116 # <i>source /etc/profile</i>
117 </pre>
118
119 <p>
120 Congratulations! You are now inside your own Gentoo Linux environment.
121 Of course it is far from finished, which is why the installation still
122 has some sections left :-)
123 </p>
124
125 </body>
126 </subsection>
127 <subsection>
128 <title>Updating the Portage tree</title>
129 <body>
130
131 <p>
132 You should now update your Portage tree to the latest version. <c>emerge
133 --sync</c> does this for you.
134 </p>
135
136 <pre caption="Updating the Portage tree">
137 # <i>emerge --sync</i>
138 </pre>
139
140 <p>
141 If you are warned that a new Portage version is available and that you should
142 update Portage, you should ignore it. Portage will be updated for you later
143 on during the installation.
144 </p>
145
146 </body>
147 </subsection>
148 <subsection>
149 <title>Choosing the Right Profile</title>
150 <body>
151
152 <p>
153 First, a small definition is in place.
154 </p>
155
156 <p>
157 A profile is a building block for any Gentoo system. Not only does it specify
158 default values for CHOST, CFLAGS and other important variables, it also locks
159 the system to a certain range of package versions. This is all maintained by the
160 Gentoo developers.
161 </p>
162
163 <p>
164 Previously, such a profile was barely touched by the user. However, recently,
165 x86, hppa and alpha users can choose between two profiles, one for a 2.4 kernel
166 and one for a 2.6 kernel. This requirement has been imposed to improve the
167 integration of the 2.6 kernels.
168 </p>
169
170 <p>
171 You can see what profile you are currently using by issuing the following
172 command:
173 </p>
174
175 <pre caption="Verifying system profile">
176 # <i>ls -l /etc/make.profile</i>
177 lrwxrwxrwx 1 root root 48 Mar 7 11:55 /etc/make.profile ->
178 ../usr/portage/profiles/default-linux/x86/2005.0
179 </pre>
180
181 <p>
182 If you are using one of the abovementioned three architectures, you will see an
183 additional profile in the one listed by the <path>make.profile</path> symlink:
184 </p>
185
186 <pre caption="Finding out if an additional profile exists">
187 # <i>ls -F /etc/make.profile/</i>
188 2.4/ packages parent virtuals
189 </pre>
190
191 <p>
192 As you can see, in the above example there is a 2.4 subdirectory. This means
193 that the current profile uses the 2.6 kernel; if you want a 2.4-based system,
194 you need to relink your <path>make.profile</path> symlink:
195 </p>
196
197 <pre caption="Relinking the profile">
198 # <i>ln -snf /usr/portage/profiles/default-linux/x86/2005.0/2.4 /etc/make.profile</i>
199 </pre>
200
201 </body>
202 </subsection>
203 <subsection id="configure_USE">
204 <title>Configuring the USE variable</title>
205 <body>
206
207 <p>
208 <c>USE</c> is one of the most powerful variables Gentoo provides to its users.
209 Several programs can be compiled with or without optional support for certain
210 items. For instance, some programs can be compiled with gtk-support, or with
211 qt-support. Others can be compiled with or without SSL support. Some programs
212 can even be compiled with framebuffer support (svgalib) instead of X11 support
213 (X-server).
214 </p>
215
216 <p>
217 Most distributions compile their packages with support for as much as possible,
218 increasing the size of the programs and startup time, not to mention an enormous
219 amount of dependencies. With Gentoo you can define what options a package
220 should be compiled with. This is where <c>USE</c> comes into play.
221 </p>
222
223 <p>
224 In the <c>USE</c> variable you define keywords which are mapped onto
225 compile-options. For instance, <e>ssl</e> will compile ssl-support in the
226 programs that support it. <e>-X</e> will remove X-server support (note the minus
227 sign in front). <e>gnome gtk -kde -qt</e> will compile your programs with gnome
228 (and gtk) support, and not with kde (and qt) support, making your system fully
229 tweaked for GNOME.
230 </p>
231
232 <p>
233 The default <c>USE</c> settings are placed in the <path>make.defaults</path>
234 files of your profile. You will find <path>make.defaults</path> files in the
235 directory which <path>/etc/make.profile</path> points to and all parent
236 directories as well. The default <c>USE</c> setting is the sum of all <c>USE</c>
237 settings in all <path>make.defaults</path> files. What you place in
238 <path>/etc/make.conf</path> is calculated against these defaults settings. If
239 you add something to the <c>USE</c> setting, it is added to the default list. If
240 you remove something from the <c>USE</c> setting (by placing a minus sign in
241 front of it) it is removed from the default list (if it was in the default list
242 at all). <e>Never</e> alter anything inside the <path>/etc/make.profile</path>
243 directory; it gets overwritten when you update Portage!
244 </p>
245
246 <p>
247 A full description on <c>USE</c> can be found in the second part of the Gentoo
248 Handbook, <uri link="?part=2&amp;chap=2">USE flags</uri>. A full description on
249 the available USE flags can be found on your system in
250 <path>/usr/portage/profiles/use.desc</path>.
251 </p>
252
253 <pre caption="Viewing available USE flags">
254 # <i>less /usr/portage/profiles/use.desc</i>
255 <comment>(You can scroll using your arrow keys, exit by pressing 'q')</comment>
256 </pre>
257
258 <p>
259 As an example we show a <c>USE</c> setting for a KDE-based system with DVD, ALSA
260 and CD Recording support:
261 </p>
262
263 <pre caption="Opening /etc/make.conf">
264 # <i>nano -w /etc/make.conf</i>
265 </pre>
266
267 <pre caption="USE setting">
268 USE="-gtk -gnome qt kde dvd alsa cdr"
269 </pre>
270
271 </body>
272 </subsection>
273 <subsection>
274 <title>Optional: GLIBC Locales</title>
275 <body>
276
277 <p>
278 You will probably only use one or maybe two locales on your system. Up until now
279 after compiling <c>glibc</c> a full set of all available locales will be
280 created. As of now you can activate the <c>userlocales</c> USE flag and specify
281 only the locales you will need in <path>/etc/locales.build</path>. Only do this
282 if you know what locales to choose.
283 </p>
284
285 <pre caption="Activate the userlocales USE flag especially for glibc">
286 # <i>mkdir /etc/portage</i>
287 # <i>echo "sys-libs/glibc userlocales" >> /etc/portage/package.use</i>
288 </pre>
289
290 <p>
291 Now specify the locales you want to be able to use:
292 </p>
293
294 <pre caption="Opening /etc/locales.build">
295 # <i>nano -w /etc/locales.build</i>
296 </pre>
297
298 <p>
299 The following locales are an example to get both English (United States) and
300 German (Germany) with the accompanying character formats (like UTF-8).
301 </p>
302
303 <pre caption="Specify your locales">
304 en_US/ISO-8859-1
305 en_US.UTF-8/UTF-8
306 de_DE/ISO-8859-1
307 de_DE@euro/ISO-8859-15
308 </pre>
309
310 </body>
311 </subsection>
312 </section>
313 <section>
314 <title>Differences between Stage1, Stage2 and Stage3</title>
315 <body>
316
317 <p>
318 Now take a seat and think of your previous steps. We asked you to
319 select a <e>stage1</e>, <e>stage2</e> or <e>stage3</e> and warned you
320 that your choice is important for further installation steps. Well, this
321 is the first place where your choice defines the subsequent steps.
322 </p>
323
324 <ul>
325 <li>
326 If you chose <e>stage1</e>, then you have to follow <e>both</e> steps in
327 this chapter (starting with <uri link="#doc_chap3">Progressing from Stage1
328 to Stage2</uri>)
329 </li>
330 <li>
331 If you chose <e>stage2</e> you only can skip the first step
332 and immediately start with the second one (<uri link="#doc_chap4">Progressing
333 from Stage2 to Stage3</uri>)
334 </li>
335 <li>
336 If you chose <e>stage3</e> then you can skip both
337 steps and continue with <uri link="?part=1&amp;chap=7">Configuring the
338 Kernel</uri>
339 </li>
340 </ul>
341
342 </body>
343 </section>
344 <section>
345 <title>Progressing from Stage1 to Stage2</title>
346 <subsection>
347 <title>Introduction to Bootstrapping</title>
348 <body>
349
350 <p>
351 So, you want to compile everything from scratch? Okay then :-)
352 </p>
353
354 <p>
355 In this step, we will <e>bootstrap</e> your Gentoo system. This takes a
356 long time, but the result is a system that has been optimized from the
357 ground up for your specific machine and needs.
358 </p>
359
360 <p>
361 <e>Bootstrapping</e> means building the GNU C Library, GNU Compiler
362 Collection and several other key system programs.
363 </p>
364
365 <p>
366 Before starting the bootstrap, you might want to download all necessary
367 sourcecode first. If you do not want to do this, continue
368 with <uri link="#bootstrap">Bootstrapping the System</uri>.
369 </p>
370
371 </body>
372 </subsection>
373 <subsection>
374 <title>Optional: Downloading the Sources First</title>
375 <body>
376
377 <p>
378 If you haven't copied over all source code before, then the bootstrap
379 script will download all necessary files. If you want to
380 download the source code first and later bootstrap the system (for instance
381 because you don't want to have your internet connection open during the
382 compilation) use the <e>-f</e> option of the bootstrap script, which will
383 fetch (hence the letter <e>f</e>) all source code for you.
384 </p>
385
386 <pre caption = "Downloading the necessary sources">
387 # <i>cd /usr/portage</i>
388 # <i>scripts/bootstrap.sh -f</i>
389 </pre>
390
391 </body>
392 </subsection>
393 <subsection id="bootstrap">
394 <title>Bootstrapping the System</title>
395 <body>
396
397 <p>
398 Okay then, take your keyboard and punch in the next commands to start
399 the bootstrap. Then go amuse yourself with something else because this step
400 takes quite some time to finish.
401 </p>
402
403 <pre caption = "Bootstrapping the system">
404 # <i>cd /usr/portage</i>
405 # <i>scripts/bootstrap.sh</i>
406 </pre>
407
408 <p>
409 When you have set the <c>nptl</c> USE flag, rerunning <c>bootstrap.sh</c> might
410 fail with a message that <c>linux-headers</c> blocks <c>linux26-headers</c>.
411 When you receive this error, remove <c>linux-headers</c> and retry:
412 </p>
413
414 <pre caption="Removing linux-headers from your system">
415 # <i>emerge -C linux-headers</i>
416 # <i>emerge --oneshot --nodeps linux26-headers</i>
417 # <i>scripts/bootstrap.sh</i>
418 </pre>
419
420 <p>
421 Now continue with the next step, <uri link="#doc_chap4">Progressing from Stage2
422 to Stage3</uri>.
423 </p>
424
425 </body>
426 </subsection>
427 </section>
428 <section>
429 <title>Progressing from Stage2 to Stage3</title>
430 <subsection>
431 <title>Introduction</title>
432 <body>
433
434 <p>
435 If you are reading this section, then you have a bootstrapped system
436 (either because you bootstrapped it previously, or you are using a
437 <e>stage2</e>). Then it is now time to build all system packages.
438 </p>
439
440 <p>
441 <e>All</e> system packages? No, not really. In this step, you will build
442 the system packages of which there are no alternatives to use.
443 Some system packages have several alternatives (such as system loggers)
444 and as Gentoo is all about choices, we don't want to force one upon you.
445 </p>
446
447 </body>
448 </subsection>
449 <subsection>
450 <title>Optional: Viewing what will be done</title>
451 <body>
452
453 <p>
454 If you want to know what packages will be installed, execute <c>emerge
455 --pretend --emptytree system</c>. This will list all packages that will be
456 built. As this list is pretty big, you should also use a pager like
457 <c>less</c> or <c>more</c> to go up and down the list.
458 </p>
459
460 <pre caption = "View what 'emerge system' will do">
461 # <i>emerge --pretend --emptytree system | less</i>
462 </pre>
463
464 <p>
465 Note that, if you haven't touched the default CFLAGS/CXXFLAGS setting, using
466 <c>emerge --pretend --newuse system</c> is sufficient. If you didn't touch the
467 USE flag either, why are you running a stage2 installation then?
468 </p>
469
470 </body>
471 </subsection>
472 <subsection>
473 <title>Optional: Downloading the Sources</title>
474 <body>
475
476 <p>
477 If you want <c>emerge</c> to download the sources before you continue
478 (for instance because you don't want the internet connection to be left
479 open while you are building all packages) you can use the <e>--fetchonly</e>
480 option of <c>emerge</c> which will fetch all sources for you.
481 </p>
482
483 <pre caption = "Fetching the sources">
484 # <i>emerge --fetchonly --emptytree system</i>
485 </pre>
486
487 </body>
488 </subsection>
489 <subsection>
490 <title>Building the System</title>
491 <body>
492
493 <p>
494 To start building the system, execute <c>emerge --emptytree system</c>. Then
495 go do something to keep your mind busy, because this step takes a long time to
496 complete.
497 </p>
498
499 <pre caption = "Building the System">
500 # <i>emerge --emptytree system</i>
501 </pre>
502
503 <p>
504 Again, if you haven't touched the default CFLAGS and CXXFLAGS setting, using
505 <c>--newuse</c> is sufficient.
506 </p>
507
508 <p>
509 You can for now safely ignore any warnings about updated configuration files
510 (and running <c>etc-update</c>). When your Gentoo system is fully installed and
511 booted, do read our documentation on <uri
512 link="?part=3&amp;chap=2#doc_chap3">Configuration File Protection</uri>.
513 </p>
514
515 <p>
516 When the build process has completed, continue with <uri
517 link="?part=1&amp;chap=7">Configuring the Kernel</uri>.
518 </p>
519
520 </body>
521 </subsection>
522 </section>
523
524 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20