/[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.69 - (show annotations) (download) (as text)
Tue Jan 4 18:11:21 2005 UTC (9 years, 7 months ago) by swift
Branch: MAIN
Changes since 1.68: +13 -35 lines
File MIME type: application/xml
Separation of Gentoo Handbook into Current and 2004.3

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/draft/hb-install-system.xml,v 1.18 2004/12/28 17:57:18 swift Exp $ -->
8
9 <sections>
10
11 <version>1.64</version>
12 <date>2005-01-04</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 |grep 'GENTOO_MIRRORS=' &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>Updating the Portage tree</title>
109 <body>
110
111 <p>
112 You should now update your Portage tree to the latest version. <c>emerge
113 --sync</c> does this for you.
114 </p>
115
116 <pre caption="Updating the Portage tree">
117 # <i>emerge --sync</i>
118 </pre>
119
120 <p>
121 If you are warned that a new Portage version is available and that you should
122 update Portage, you should ignore it. Portage will be updated for you later
123 on during the installation.
124 </p>
125
126 </body>
127 </subsection>
128 <subsection id="configure_USE">
129 <title>Configuring the USE variable</title>
130 <body>
131
132 <p>
133 <c>USE</c> is one of the most powerful variables Gentoo provides to its users.
134 Several programs can be compiled with or without optional support for certain
135 items. For instance, some programs can be compiled with gtk-support, or with
136 qt-support. Others can be compiled with or without SSL support. Some programs
137 can even be compiled with framebuffer support (svgalib) instead of X11 support
138 (X-server).
139 </p>
140
141 <p>
142 Most distributions compile their packages with support for as much as possible,
143 increasing the size of the programs and startup time, not to mention an enormous
144 amount of dependencies. With Gentoo you can define what options a package
145 should be compiled with. This is where <c>USE</c> comes into play.
146 </p>
147
148 <p>
149 In the <c>USE</c> variable you define keywords which are mapped onto
150 compile-options. For instance, <e>ssl</e> will compile ssl-support in the
151 programs that support it. <e>-X</e> will remove X-server support (note the minus
152 sign in front). <e>gnome gtk -kde -qt</e> will compile your programs with gnome
153 (and gtk) support, and not with kde (and qt) support, making your system fully
154 tweaked for GNOME.
155 </p>
156
157 <p>
158 The default <c>USE</c> settings are placed in the <path>make.defaults</path>
159 files of your profile. You will find <path>make.defaults</path> files in the
160 directory which <path>/etc/make.profile</path> points to and all parent
161 directories as well. The default <c>USE</c> setting is the sum of all <c>USE</c>
162 settings in all <path>make.defaults</path> files. What you place in
163 <path>/etc/make.conf</path> is calculated against these defaults settings. If
164 you add something to the <c>USE</c> setting, it is added to the default list. If
165 you remove something from the <c>USE</c> setting (by placing a minus sign in
166 front of it) it is removed from the default list (if it was in the default list
167 at all). <e>Never</e> alter anything inside the <path>/etc/make.profile</path>
168 directory; it gets overwritten when you update Portage!
169 </p>
170
171 <p>
172 A full description on <c>USE</c> can be found in the second part of the Gentoo
173 Handbook, <uri link="?part=2&amp;chap=2">USE flags</uri>. A full description on
174 the available USE flags can be found on your system in
175 <path>/usr/portage/profiles/use.desc</path>.
176 </p>
177
178 <pre caption="Viewing available USE flags">
179 # <i>less /usr/portage/profiles/use.desc</i>
180 <comment>(You can scroll using your arrow keys, exit by pressing 'q')</comment>
181 </pre>
182
183 <p>
184 As an example we show a <c>USE</c> setting for a KDE-based system with DVD, ALSA
185 and CD Recording support:
186 </p>
187
188 <pre caption="Opening /etc/make.conf">
189 # <i>nano -w /etc/make.conf</i>
190 </pre>
191
192 <pre caption="USE setting">
193 USE="-gtk -gnome qt kde dvd alsa cdr"
194 </pre>
195
196 </body>
197 </subsection>
198 <subsection>
199 <title>Optional: GLIBC Locales</title>
200 <body>
201
202 <p>
203 You will probably only use one or maybe two locales on your system. Up until now
204 after compiling <c>glibc</c> a full set of all available locales will be
205 created. As of now you can activate the <c>userlocales</c> USE flag and specify
206 only the locales you will need in <path>/etc/locales.build</path>. Only do this
207 if you know what locales to choose.
208 </p>
209
210 <pre caption="Activate the userlocales USE flag especially for glibc">
211 # <i>mkdir /etc/portage</i>
212 # <i>echo "sys-libs/glibc userlocales" >> /etc/portage/package.use</i>
213 </pre>
214
215 <p>
216 Now specify the locales you want to be able to use:
217 </p>
218
219 <pre caption="Opening /etc/locales.build">
220 # <i>nano -w /etc/locales.build</i>
221 </pre>
222
223 <p>
224 The following locales are an example to get both English (United States) and
225 German (Germany) with the accompanying character formats (like UTF-8).
226 </p>
227
228 <pre caption="Specify your locales">
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 </section>
238 <section>
239 <title>Differences between Stage1, Stage2 and Stage3</title>
240 <body>
241
242 <p>
243 Now take a seat and think of your previous steps. We asked you to
244 select a <e>stage1</e>, <e>stage2</e> or <e>stage3</e> and warned you
245 that your choice is important for further installation steps. Well, this
246 is the first place where your choice defines the subsequent steps.
247 </p>
248
249 <ul>
250 <li>
251 If you chose <e>stage1</e>, then you have to follow <e>both</e> steps in
252 this chapter (starting with <uri link="#doc_chap3">Progressing from Stage1
253 to Stage2</uri>)
254 </li>
255 <li>
256 If you chose <e>stage2</e> you only can skip the first step
257 and immediately start with the second one (<uri link="#doc_chap4">Progressing
258 from Stage2 to Stage3</uri>)
259 </li>
260 <li>
261 If you chose <e>stage3</e> then you can skip both
262 steps and continue with <uri link="?part=1&amp;chap=7">Configuring the
263 Kernel</uri>
264 </li>
265 </ul>
266
267 </body>
268 </section>
269 <section>
270 <title>Progressing from Stage1 to Stage2</title>
271 <subsection>
272 <title>Introduction to Bootstrapping</title>
273 <body>
274
275 <p>
276 So, you want to compile everything from scratch? Okay then :-)
277 </p>
278
279 <p>
280 In this step, we will <e>bootstrap</e> your Gentoo system. This takes a
281 long time, but the result is a system that has been optimized from the
282 ground up for your specific machine and needs.
283 </p>
284
285 <p>
286 <e>Bootstrapping</e> means building the GNU C Library, GNU Compiler
287 Collection and several other key system programs.
288 </p>
289
290 <p>
291 Before starting the bootstrap, you might want to download all necessary
292 sourcecode first. If you do not want to do this, continue
293 with <uri link="#bootstrap">Bootstrapping the System</uri>.
294 </p>
295
296 </body>
297 </subsection>
298 <subsection>
299 <title>Optional: Downloading the Sources First</title>
300 <body>
301
302 <p>
303 If you haven't copied over all source code before, then the bootstrap
304 script will download all necessary files. If you want to
305 download the source code first and later bootstrap the system (for instance
306 because you don't want to have your internet connection open during the
307 compilation) use the <e>-f</e> option of the bootstrap script, which will
308 fetch (hence the letter <e>f</e>) all source code for you.
309 </p>
310
311 <pre caption = "Downloading the necessary sources">
312 # <i>cd /usr/portage</i>
313 # <i>scripts/bootstrap.sh -f</i>
314 </pre>
315
316 </body>
317 </subsection>
318 <subsection id="bootstrap">
319 <title>Bootstrapping the System</title>
320 <body>
321
322 <p>
323 Okay then, take your keyboard and punch in the next commands to start
324 the bootstrap. Then go amuse yourself with something else because this step
325 takes quite some time to finish.
326 </p>
327
328 <pre caption = "Bootstrapping the system">
329 # <i>cd /usr/portage</i>
330 # <i>scripts/bootstrap.sh</i>
331 </pre>
332
333 <p>
334 When you have set the <c>nptl</c> USE flag, rerunning <c>bootstrap.sh</c> might
335 fail with a message that <c>linux-headers</c> blocks <c>linux26-headers</c>.
336 When you receive this error, remove <c>linux-headers</c> and retry:
337 </p>
338
339 <pre caption="Removing linux-headers from your system">
340 # <i>emerge -C linux-headers</i>
341 # <i>emerge --oneshot --nodeps linux26-headers</i>
342 # <i>scripts/bootstrap.sh</i>
343 </pre>
344
345 <p>
346 Now continue with the next step, <uri link="#doc_chap4">Progressing from Stage2
347 to Stage3</uri>.
348 </p>
349
350 </body>
351 </subsection>
352 </section>
353 <section>
354 <title>Progressing from Stage2 to Stage3</title>
355 <subsection>
356 <title>Introduction</title>
357 <body>
358
359 <p>
360 If you are reading this section, then you have a bootstrapped system
361 (either because you bootstrapped it previously, or you are using a
362 <e>stage2</e>). Then it is now time to build all system packages.
363 </p>
364
365 <p>
366 <e>All</e> system packages? No, not really. In this step, you will build
367 the system packages of which there are no alternatives to use.
368 Some system packages have several alternatives (such as system loggers)
369 and as Gentoo is all about choices, we don't want to force one upon you.
370 </p>
371
372 </body>
373 </subsection>
374 <subsection>
375 <title>Optional: Viewing what will be done</title>
376 <body>
377
378 <p>
379 If you want to know what packages will be installed, execute <c>emerge
380 --pretend system</c>. This will list all packages that will be built. As this
381 list is pretty big, you should also use a pager like <c>less</c> or
382 <c>more</c> to go up and down the list.
383 </p>
384
385 <pre caption = "View what 'emerge system' will do">
386 # <i>emerge --pretend system | less</i>
387 </pre>
388
389 </body>
390 </subsection>
391 <subsection>
392 <title>Optional: Downloading the Sources</title>
393 <body>
394
395 <p>
396 If you want <c>emerge</c> to download the sources before you continue
397 (for instance because you don't want the internet connection to be left
398 open while you are building all packages) you can use the <e>--fetchonly</e>
399 option of <c>emerge</c> which will fetch all sources for you.
400 </p>
401
402 <pre caption = "Fetching the sources">
403 # <i>emerge --fetchonly system</i>
404 </pre>
405
406 </body>
407 </subsection>
408 <subsection>
409 <title>Building the System</title>
410 <body>
411
412 <p>
413 To start building the system, execute <c>emerge system</c>. Then go do
414 something to keep your mind busy, because this step takes a long time to
415 complete.
416 </p>
417
418 <pre caption = "Building the System">
419 # <i>emerge system</i>
420 </pre>
421
422 <p>
423 You can for now safely ignore any warnings about updated configuration files
424 (and running <c>etc-update</c>). When your Gentoo system is fully installed and
425 booted, do read our documentation on <uri
426 link="?part=3&amp;chap=2#doc_chap3">Configuration File Protection</uri>.
427 </p>
428
429 <p>
430 When the build process has completed, continue with <uri
431 link="?part=1&amp;chap=7">Configuring the Kernel</uri>.
432 </p>
433
434 </body>
435 </subsection>
436 </section>
437
438 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20