/[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.81 - (show annotations) (download) (as text)
Tue Jun 28 12:28:00 2005 UTC (9 years, 6 months ago) by neysx
Branch: MAIN
Changes since 1.80: +34 -3 lines
File MIME type: application/xml
#96715 stage3 users should upgrade baselayout to be consistent with stage1/2 and other parts of book

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.80 2005/06/08 23:37:48 neysx Exp $ -->
8
9 <sections>
10
11 <version>2.8</version>
12 <date>2005-06-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 <comment>(If you're using a slow terminal like some framebuffers or a serial
139 console, you can add the --quiet option to speed up this process:)</comment>
140 # <i>emerge --sync --quiet</i>
141 </pre>
142
143 <p>
144 If you are behind a firewall that blocks rsync traffic, you can use
145 <c>emerge-webrsync</c> which will download and install a portage snapshot for
146 you.
147 </p>
148
149 <p>
150 If you are warned that a new Portage version is available and that you should
151 update Portage, you should ignore it. Portage will be updated for you later
152 on during the installation.
153 </p>
154
155 </body>
156 </subsection>
157 <subsection>
158 <title>Choosing the Right Profile</title>
159 <body>
160
161 <p>
162 First, a small definition is in place.
163 </p>
164
165 <p>
166 A profile is a building block for any Gentoo system. Not only does it specify
167 default values for CHOST, CFLAGS and other important variables, it also locks
168 the system to a certain range of package versions. This is all maintained by the
169 Gentoo developers.
170 </p>
171
172 <p>
173 Previously, such a profile was barely touched by the user. However, x86, hppa
174 and alpha users can choose between two profiles, one for a 2.4 kernel and one
175 for a 2.6 kernel. This requirement has been imposed to improve the integration
176 of the 2.6 kernels.
177 </p>
178
179 <p>
180 You can see what profile you are currently using with the following command:
181 </p>
182
183 <pre caption="Verifying system profile">
184 # <i>ls -FGg /etc/make.profile</i>
185 lrwxrwxrwx 1 48 Apr 8 18:51 /etc/make.profile -> ../usr/portage/profiles/default-linux/x86/2005.0/
186 </pre>
187
188 <p>
189 If you are using one of the aforementioned three architectures, the default
190 profile will provide you with a Linux 2.6-based system. This is the recommended
191 default, but you have the option of choosing another profile too.
192 </p>
193
194 <p>
195 Some users may wish to install a system based on the older Linux 2.4 profile.
196 If you have good reason to do this, then you should first check that an
197 additional profile exists. On x86, we can do this with the following command:
198 </p>
199
200 <pre caption="Finding out if an additional profile exists">
201 # <i>ls -d /usr/portage/profiles/default-linux/x86/2005.0/2.4</i>
202 /usr/portage/profiles/default-linux/x86/2005.0/2.4
203 </pre>
204
205 <p>
206 The above example shows that the additional 2.4 profile exists (i.e. it didn't
207 complain about missing file or directory). It is recommended that you stay with
208 the default, but if you wish to switch, you can do so with as follows:
209 </p>
210
211 <pre caption="Switching to a 2.4 profile">
212 <comment>(Make sure you use the right architecture, the example below is for x86)</comment>
213 # <i>ln -snf /usr/portage/profiles/default-linux/x86/2005.0/2.4 /etc/make.profile</i>
214 <comment>(List the files in the 2.4 profile)</comment>
215 # <i>ls -FGg /etc/make.profile/</i>
216 total 12
217 -rw-r--r-- 1 939 Dec 10 14:06 packages
218 -rw-r--r-- 1 347 Dec 3 2004 parent
219 -rw-r--r-- 1 573 Dec 3 2004 virtuals
220 </pre>
221
222 </body>
223 </subsection>
224 <subsection id="configure_USE">
225 <title>Configuring the USE variable</title>
226 <body>
227
228 <p>
229 <c>USE</c> is one of the most powerful variables Gentoo provides to its users.
230 Several programs can be compiled with or without optional support for certain
231 items. For instance, some programs can be compiled with gtk-support, or with
232 qt-support. Others can be compiled with or without SSL support. Some programs
233 can even be compiled with framebuffer support (svgalib) instead of X11 support
234 (X-server).
235 </p>
236
237 <p>
238 Most distributions compile their packages with support for as much as possible,
239 increasing the size of the programs and startup time, not to mention an enormous
240 amount of dependencies. With Gentoo you can define what options a package
241 should be compiled with. This is where <c>USE</c> comes into play.
242 </p>
243
244 <p>
245 In the <c>USE</c> variable you define keywords which are mapped onto
246 compile-options. For instance, <e>ssl</e> will compile ssl-support in the
247 programs that support it. <e>-X</e> will remove X-server support (note the minus
248 sign in front). <e>gnome gtk -kde -qt</e> will compile your programs with gnome
249 (and gtk) support, and not with kde (and qt) support, making your system fully
250 tweaked for GNOME.
251 </p>
252
253 <p>
254 The default <c>USE</c> settings are placed in the <path>make.defaults</path>
255 files of your profile. You will find <path>make.defaults</path> files in the
256 directory which <path>/etc/make.profile</path> points to and all parent
257 directories as well. The default <c>USE</c> setting is the sum of all <c>USE</c>
258 settings in all <path>make.defaults</path> files. What you place in
259 <path>/etc/make.conf</path> is calculated against these defaults settings. If
260 you add something to the <c>USE</c> setting, it is added to the default list. If
261 you remove something from the <c>USE</c> setting (by placing a minus sign in
262 front of it) it is removed from the default list (if it was in the default list
263 at all). <e>Never</e> alter anything inside the <path>/etc/make.profile</path>
264 directory; it gets overwritten when you update Portage!
265 </p>
266
267 <p>
268 A full description on <c>USE</c> can be found in the second part of the Gentoo
269 Handbook, <uri link="?part=2&amp;chap=2">USE flags</uri>. A full description on
270 the available USE flags can be found on your system in
271 <path>/usr/portage/profiles/use.desc</path>.
272 </p>
273
274 <pre caption="Viewing available USE flags">
275 # <i>less /usr/portage/profiles/use.desc</i>
276 <comment>(You can scroll using your arrow keys, exit by pressing 'q')</comment>
277 </pre>
278
279 <p>
280 As an example we show a <c>USE</c> setting for a KDE-based system with DVD, ALSA
281 and CD Recording support:
282 </p>
283
284 <pre caption="Opening /etc/make.conf">
285 # <i>nano -w /etc/make.conf</i>
286 </pre>
287
288 <pre caption="USE setting">
289 USE="-gtk -gnome qt kde dvd alsa cdr"
290 </pre>
291
292 </body>
293 </subsection>
294 <subsection>
295 <title>Optional: GLIBC Locales</title>
296 <body>
297
298 <p>
299 You will probably only use one or maybe two locales on your system. Up until now
300 after compiling <c>glibc</c> a full set of all available locales will be
301 created. As of now you can activate the <c>userlocales</c> USE flag and specify
302 only the locales you will need in <path>/etc/locales.build</path>. Only do this
303 if you know what locales to choose. This will not work for the bootstrapping,
304 but when you recompile glibc afterwards it will.
305 </p>
306
307 <pre caption="Activate the userlocales USE flag especially for glibc">
308 # <i>mkdir /etc/portage</i>
309 # <i>echo "sys-libs/glibc userlocales" >> /etc/portage/package.use</i>
310 </pre>
311
312 <p>
313 Now specify the locales you want to be able to use:
314 </p>
315
316 <pre caption="Opening /etc/locales.build">
317 # <i>nano -w /etc/locales.build</i>
318 </pre>
319
320 <p>
321 The following locales are an example to get both English (United States) and
322 German (Germany) with the accompanying character formats (like UTF-8).
323 </p>
324
325 <pre caption="Specify your locales">
326 en_US/ISO-8859-1
327 en_US.UTF-8/UTF-8
328 de_DE/ISO-8859-1
329 de_DE@euro/ISO-8859-15
330 </pre>
331
332 </body>
333 </subsection>
334 </section>
335 <section>
336 <title>Differences between Stage1, Stage2 and Stage3</title>
337 <body>
338
339 <p>
340 Now take a seat and think of your previous steps. We asked you to
341 select a <e>stage1</e>, <e>stage2</e> or <e>stage3</e> and warned you
342 that your choice is important for further installation steps. Well, this
343 is the first place where your choice defines the subsequent steps.
344 </p>
345
346 <ul>
347 <li>
348 If you chose <e>stage1</e>, then you have to follow <e>both</e> steps in
349 this chapter (starting with <uri link="#doc_chap3">Progressing from Stage1
350 to Stage2</uri>)
351 </li>
352 <li>
353 If you chose <e>stage2</e> you only can skip the first step
354 and immediately start with the second one (<uri link="#doc_chap4">Progressing
355 from Stage2 to Stage3</uri>)
356 </li>
357 <!-- Keep this for 2005.1
358 <li>
359 If you chose <e>stage3</e> then you can skip both
360 steps and continue with <uri link="?part=1&amp;chap=7">Configuring the
361 Kernel</uri>
362 </li>
363 -->
364 <li>
365 If you chose <e>stage3</e> then you should <uri
366 link="#upgrade-baselayout">upgrade the baselayout package</uri>.
367 </li>
368 </ul>
369
370 </body>
371 </section>
372 <section>
373 <title>Progressing from Stage1 to Stage2</title>
374 <subsection>
375 <title>Introduction to Bootstrapping</title>
376 <body>
377
378 <p>
379 So, you want to compile everything from scratch? Okay then :-)
380 </p>
381
382 <p>
383 In this step, we will <e>bootstrap</e> your Gentoo system. This takes a
384 long time, but the result is a system that has been optimized from the
385 ground up for your specific machine and needs.
386 </p>
387
388 <p>
389 <e>Bootstrapping</e> means building the GNU C Library, GNU Compiler
390 Collection and several other key system programs.
391 </p>
392
393 <p>
394 Before starting the bootstrap, you might want to download all necessary
395 sourcecode first. If you do not want to do this, continue
396 with <uri link="#bootstrap">Bootstrapping the System</uri>.
397 </p>
398
399 </body>
400 </subsection>
401 <subsection>
402 <title>Optional: Downloading the Sources First</title>
403 <body>
404
405 <p>
406 If you haven't copied over all source code before, then the bootstrap
407 script will download all necessary files. If you want to
408 download the source code first and later bootstrap the system (for instance
409 because you don't want to have your internet connection open during the
410 compilation) use the <e>-f</e> option of the bootstrap script, which will
411 fetch (hence the letter <e>f</e>) all source code for you.
412 </p>
413
414 <pre caption = "Downloading the necessary sources">
415 # <i>cd /usr/portage</i>
416 # <i>scripts/bootstrap.sh -f</i>
417 </pre>
418
419 </body>
420 </subsection>
421 <subsection id="bootstrap">
422 <title>Bootstrapping the System</title>
423 <body>
424
425 <p>
426 Okay then, take your keyboard and punch in the next commands to start
427 the bootstrap. Then go amuse yourself with something else because this step
428 takes quite some time to finish.
429 </p>
430
431 <pre caption = "Bootstrapping the system">
432 # <i>cd /usr/portage</i>
433 # <i>scripts/bootstrap.sh</i>
434 </pre>
435
436 <p>
437 Now continue with the next step, <uri link="#doc_chap4">Progressing from Stage2
438 to Stage3</uri>.
439 </p>
440
441 </body>
442 </subsection>
443 </section>
444 <section>
445 <title>Progressing from Stage2 to Stage3</title>
446 <subsection>
447 <title>Introduction</title>
448 <body>
449
450 <p>
451 If you are reading this section, then you have a bootstrapped system
452 (either because you bootstrapped it previously, or you are using a
453 <e>stage2</e>). Then it is now time to build all system packages.
454 </p>
455
456 <p>
457 <e>All</e> system packages? No, not really. In this step, you will build
458 the system packages of which there are no alternatives to use.
459 Some system packages have several alternatives (such as system loggers)
460 and as Gentoo is all about choices, we don't want to force one upon you.
461 </p>
462
463 </body>
464 </subsection>
465 <subsection>
466 <title>Optional: Viewing what will be done</title>
467 <body>
468
469 <p>
470 If you want to know what packages will be installed, execute <c>emerge
471 --pretend --emptytree system</c>. This will list all packages that will be
472 built. As this list is pretty big, you should also use a pager like
473 <c>less</c> or <c>more</c> to go up and down the list.
474 </p>
475
476 <pre caption = "View what 'emerge system' will do">
477 # <i>emerge --pretend --emptytree system | less</i>
478 </pre>
479
480 <p>
481 Note that, if you haven't touched the default CFLAGS/CXXFLAGS setting, using
482 <c>emerge --pretend --newuse system</c> is sufficient: it will rebuild the
483 applications that are affected by a change in USE flags (compared to the USE
484 flag we used while building the stage2). If you didn't touch
485 the USE flag either, why are you running a stage2 installation then?
486 </p>
487
488 </body>
489 </subsection>
490 <subsection>
491 <title>Optional: Downloading the Sources</title>
492 <body>
493
494 <p>
495 If you want <c>emerge</c> to download the sources before you continue
496 (for instance because you don't want the internet connection to be left
497 open while you are building all packages) you can use the <e>--fetchonly</e>
498 option of <c>emerge</c> which will fetch all sources for you.
499 </p>
500
501 <pre caption = "Fetching the sources">
502 # <i>emerge --fetchonly --emptytree system</i>
503 </pre>
504
505 </body>
506 </subsection>
507 <subsection>
508 <title>Building the System</title>
509 <body>
510
511 <p>
512 To start building the system, execute <c>emerge --emptytree system</c>. Then
513 go do something to keep your mind busy, because this step takes a long time to
514 complete.
515 </p>
516
517 <pre caption = "Building the System">
518 # <i>emerge --emptytree system</i>
519 </pre>
520
521 <p>
522 Again, if you haven't touched the default CFLAGS and CXXFLAGS setting, using
523 <c>--newuse</c> is sufficient.
524 </p>
525
526 <p>
527 You can for now safely ignore any warnings about updated configuration files
528 (and running <c>etc-update</c>). When your Gentoo system is fully installed and
529 booted, do read our documentation on <uri
530 link="?part=3&amp;chap=2#doc_chap3">Configuration File Protection</uri>.
531 </p>
532
533 <p>
534 When the build process has completed, continue with <uri
535 link="?part=1&amp;chap=7">Configuring the Kernel</uri>.
536 </p>
537
538 </body>
539 </subsection>
540 </section>
541 <section id="upgrade-baselayout">
542 <title>Upgrading baselayout</title>
543 <subsection>
544 <body>
545
546 <p>
547 The <c>baselayout</c> package has been significantly updated after the release
548 of Gentoo 2005.0. Some configuration files have been moved and others use a new
549 syntax. This handbook now uses the new configuration files. It is therefore
550 highly recommended that you upgrade it before moving on to the next section.
551 </p>
552
553 <pre caption="Upgrading baselayout">
554 # <i>rm /etc/conf.d/net</i>
555 # <i>CONFIG_PROTECT="-*" emerge baselayout</i>
556 </pre>
557
558 <p>
559 Please continue with <uri link="?part=1&amp;chap=7">Configuring the
560 Kernel</uri>.
561 </p>
562
563 </body>
564 </subsection>
565 </section>
566
567 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20