/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-stage.xml
Gentoo

Contents of /xml/htdocs/doc/en/handbook/hb-install-stage.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.57 - (show annotations) (download) (as text)
Fri Aug 6 13:10:11 2004 UTC (13 years, 8 months ago) by swift
Branch: MAIN
Changes since 1.56: +8 -8 lines
File MIME type: application/xml
Small fixups, undo my undoing of my finishing touches regarding the noauto thingie for /boot

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-stage.xml,v 1.56 2004/08/02 15:54:00 swift Exp $ -->
8
9 <sections>
10 <section>
11 <title>Installing a Stage Tarball</title>
12 <subsection>
13 <title>Setting the Date/Time Right</title>
14 <body>
15
16 <p>
17 Before you continue you need to check your date/time and update it. A
18 misconfigured clock may lead to strange results in the future!
19 </p>
20
21 <p>
22 To verify the current date/time, run <c>date</c>:
23 </p>
24
25 <pre caption="Verifying the date/time">
26 # <i>date</i>
27 Sun Apr 25 16:21:18 CEST 2004
28 </pre>
29
30 <p>
31 If the date/time displayed is wrong, update it using the <c>date
32 MMDDhhmmYYYY</c> syntax (<b>M</b>onth, <b>D</b>ay, <b>h</b>our, <b>m</b>inute
33 and <b>Y</b>ear). For instance, to set the date to April 25th, 16:21 in the
34 year 2004:
35 </p>
36
37 <pre caption="Setting the date/time">
38 # <i>date 042516212004</i>
39 </pre>
40
41 </body>
42 </subsection>
43 <subsection>
44 <title>Making your Choice</title>
45 <body>
46
47 <p>
48 The next step you need to perform is to install the <e>stage</e> tarball of your
49 choice onto your system. You have the option of downloading the required tarball
50 from the Internet or, if you are booted from one of the Gentoo Universal
51 LiveCDs, copy it over from the CD itself. If you have a Universal CD and the
52 stage you want to use is on the CD, downloading it from the Internet is just a
53 waste of bandwidth as the stage files are the same.
54 </p>
55
56 <ul>
57 <li><uri link="#doc_chap2">Default: Using a Stage from the Internet</uri></li>
58 <li><uri link="#doc_chap3">Alternative: Using a Stage from the LiveCD</uri></li>
59 </ul>
60
61 </body>
62 </subsection>
63 </section>
64 <section>
65 <title>Default: Using a Stage from the Internet</title>
66 <subsection>
67 <title>Downloading the Stage Tarball</title>
68 <body>
69
70 <p>
71 Go to the Gentoo mountpoint at which you mounted your filesystems
72 (most likely <path>/mnt/gentoo</path>):
73 </p>
74
75 <pre caption="Going to the Gentoo mountpoint">
76 # <i>cd /mnt/gentoo</i>
77 </pre>
78
79 <p>
80 Depending on your installation medium, you have a couple of tools available to
81 download a stage. If you have <c>lynx</c> available, then you can immediately
82 surf to <uri link="/main/en/mirrors.xml">the Gentoo
83 mirrorlist</uri> and choose a mirror close to you. Then pick the
84 <path>releases/</path> directory, followed by your architecture (for instance
85 <path>x86/</path>) and the Gentoo version (<path>2004.2/</path>)
86 to finish up with the <path>stages/</path> directory. There you should see all
87 available stage files for your architecture. Select one and press <c>D</c> to
88 download. When you're finished, press <c>Q</c> to quit the browser.
89 </p>
90
91 <pre caption="Surfing to the mirror listing with lynx">
92 # <i>lynx http://www.gentoo.org/main/en/mirrors.xml</i>
93 </pre>
94
95 <p>
96 If you do not have <c>lynx</c>, you should have <c>links2</c> at your disposal.
97 <c>links2</c> is more powerful than <c>lynx</c>, but has some drawbacks. One of
98 them is that it doesn't listen to the proxy variables we have declared
99 previously. If you need to setup a proxy, use <c>links2 -http-proxy
100 proxy.server.com:8080</c>. From there on, you should follow the same steps as
101 with <c>lynx</c> as they are equivalent.
102 </p>
103
104 <pre caption="Surfing to the mirror listing with links2">
105 <comment>(Without proxy)</comment> # <i>links2 http://www.gentoo.org/main/en/mirrors.xml</i>
106 <comment>(With proxy)</comment> # <i>links2 -http-proxy proxy.server.com:8080 http://www.gentoo.org/main/en/mirrors.xml</i>
107 </pre>
108
109 <p>
110 If you want to check the integrity of the downloaded stage tarball, use
111 <c>md5sum</c> and compare the output with the MD5 checksum provided on the
112 mirror. For instance, to check the validity of the x86 stage tarball:
113 </p>
114
115 <pre caption="Example checking integrity of a stage tarball">
116 # <i>md5sum -c stage1-x86-2004.2.tar.bz2.md5</i>
117 stage1-x86-2004.2.tar.bz2: OK
118 </pre>
119
120 </body>
121 </subsection>
122 <subsection>
123 <title>Unpacking the Stage Tarball</title>
124 <body>
125
126 <p>
127 Now unpack your downloaded stage onto your system. We use GNU's <c>tar</c> to
128 proceed as it is the easiest method:
129 </p>
130
131 <pre caption="Unpacking the stage">
132 # <i>tar -xvjpf stage?-*.tar.bz2</i>
133 </pre>
134
135 <p>
136 Make sure that you use the same options (<c>-xvjpf</c>). The <c>x</c> stands for
137 <e>Extract</e>, the <c>v</c> for <e>Verbose</e> (okay, yes, this is optional),
138 the <c>j</c> for <e>Decompress with bzip2</e>, the <c>p</c> for <e>Preserve
139 permissions</e> and the <c>f</c> to denote that we want to extract a file, not
140 standard input.
141 </p>
142
143 <p>
144 Now that the stage is installed, continue with <uri
145 link="#installing_portage">Installing Portage</uri>.
146 </p>
147
148 </body>
149 </subsection>
150 </section>
151 <section>
152 <title>Alternative: Using a Stage from the LiveCD</title>
153 <subsection>
154 <title>Extracting the Stage Tarball</title>
155 <body>
156
157 <p>
158 The stages on the CD reside in the <path>/mnt/cdrom/stages</path> directory. To
159 see a listing of available stages, use <c>ls</c>:
160 </p>
161
162 <pre caption="List all available stages">
163 # <i>ls /mnt/cdrom/stages</i>
164 </pre>
165
166 <p>
167 If the system replies with an error, you may need to mount the CD-ROM first:
168 </p>
169
170 <pre caption="Mounting the CD-ROM">
171 # <i>ls /mnt/cdrom/stages</i>
172 ls: /mnt/cdrom/stages: No such file or directory
173 # <i>mount /dev/cdroms/cdrom0 /mnt/cdrom</i>
174 # <i>ls /mnt/cdrom/stages</i>
175 </pre>
176
177 <p>
178 Now go into your Gentoo mountpoint (usually <path>/mnt/gentoo</path>):
179 </p>
180
181 <pre caption="Changing directory to /mnt/gentoo">
182 # <i>cd /mnt/gentoo</i>
183 </pre>
184
185 <p>
186 We will now extract the stage tarball of your choice. We will do this with the
187 GNU <c>tar</c> tool. Make sure you use the same options (<c>-xvjpf</c>)! In the
188 next example, we extract the stage tarball
189 <path>stage3-&lt;subarch&gt;-2004.2.tar.bz2</path>.
190 Be sure to substitute the tarball filename with your stage.
191 </p>
192
193 <pre caption="Extracting the stage tarball">
194 # <i>tar -xvjpf /mnt/cdrom/stages/stage3-&lt;subarch&gt;-2004.2.tar.bz2</i>
195 </pre>
196
197 <p>
198 Now that the stage is installed, continue with <uri
199 link="#installing_portage">Installing Portage</uri>.
200 </p>
201
202 </body>
203 </subsection>
204 </section>
205 <section id="installing_portage">
206 <title>Installing Portage</title>
207 <subsection>
208 <title>Network or No Network?</title>
209 <body>
210
211 <p>
212 If you don't have a working network connection, you have to install a portage
213 snapshot provided by one of our LiveCDs. This automatically assumes that you are
214 installing from a <e>stage3</e> tarball (as it is the only tarball supported for
215 networkless installations). If you want to use prebuilt packages
216 later on to speed up the installation, you <e>must</e> use a portage snapshot
217 from the LiveCD. Other users will download a fully updated Portage tree using
218 <c>emerge</c> in the next chapter.
219 </p>
220
221 <p>
222 Continue with the appropriate part:
223 </p>
224
225 <ul>
226 <li>
227 <uri link="#installing_from_LiveCD">Installing a Portage Snapshot and
228 Source Code from LiveCD</uri> (for networkless installations or GRP
229 installations)
230 </li>
231 <li>
232 <uri link="#compile_options">Configuring the Compile Options</uri> (all
233 other installation methods)
234 </li>
235 </ul>
236
237 </body>
238 </subsection>
239 <subsection id="installing_from_LiveCD">
240 <title>Installing a Portage Snapshot and Source Code from LiveCD</title>
241 <body>
242
243 <p>
244 There is a Portage snapshot available on the Universal LiveCDs. Since you are
245 reading this, we can safely assume you are using such a LiveCD. To install this
246 snapshot, take a look inside <path>/mnt/cdrom/snapshots/</path> to see what
247 snapshot we have available:
248 </p>
249
250 <pre caption="Checking the /mnt/cdrom/snapshots content">
251 # <i>ls /mnt/cdrom/snapshots</i>
252 </pre>
253
254 <p>
255 Now extract the snapshot using the following construct. Again,
256 make sure you use the correct options to <c>tar</c>. Also, the <c>-C</c> is with
257 a capital <c>C</c>, not <c>c</c>. In the next example we use
258 <path>portage-20040710.tar.bz2</path> as the snapshot filename. Be sure to
259 substitute with your snapshot.
260 </p>
261
262 <pre caption="Extracting a Portage snapshot">
263 # <i>tar -xvjf /mnt/cdrom/snapshots/portage-20040710.tar.bz2 -C /mnt/gentoo/usr</i>
264 </pre>
265
266 <p>
267 You also need to copy over all source code from the CD:
268 </p>
269
270 <pre caption="Copy over source code">
271 # <i>mkdir /mnt/gentoo/usr/portage/distfiles</i>
272 # <i>cp /mnt/cdrom/distfiles/* /mnt/gentoo/usr/portage/distfiles/</i>
273 </pre>
274
275 <p>
276 Now that your Portage snapshot is installed, continue with <uri
277 link="#compile_options">Configuring the Compile Options</uri>.
278 </p>
279
280 </body>
281 </subsection>
282 </section>
283
284 <section id="compile_options">
285 <title>Configuring the Compile Options</title>
286 <subsection>
287 <title>Introduction</title>
288 <body>
289
290 <p>
291 To optimize Gentoo, you can set a couple of variables which impact Portage
292 behaviour. All those variables can be set as environment variables (using
293 <c>export</c>) but that isn't permanent. To keep your settings, Portage provides
294 you with <path>/etc/make.conf</path>, a configuration file for Portage. It is
295 this file we will edit now.
296 </p>
297
298 <note>
299 A commented listing of all possible variables can be found in
300 <path>/mnt/gentoo/etc/make.conf.example</path>. For a successful Gentoo
301 installation you'll only need to set the variables which are mentioned beneath.
302 </note>
303
304 <p>
305 Fire up your favorite editor (in this guide we use <c>nano</c>) so we can alter
306 the optimization variables we will discuss hereafter.
307 </p>
308
309 <pre caption="Opening /etc/make.conf">
310 # <i>nano -w /mnt/gentoo/etc/make.conf</i>
311 </pre>
312
313 <p>
314 As you probably noticed, the <path>make.conf.example</path> file is
315 structured in a generic way: commented lines start with "#", other lines define
316 variables using the <c>VARIABLE="content"</c> syntax. The <path>make.conf</path>
317 file uses the same syntax. Several of those variables are discussed next.
318 </p>
319
320 </body>
321 </subsection>
322 <subsection>
323 <title>CHOST</title>
324 <body>
325
326 <warn>
327 Although it might be tempting for non-stage1 users, they should <e>not</e>
328 change the <c>CHOST</c> setting in <path>make.conf</path>. Doing so might render
329 their system unusable. Again: only change this variable if you use a
330 <e>stage1</e> installation.
331 </warn>
332
333 <p>
334 The <c>CHOST</c> variable defines what architecture <c>gcc</c> has to
335 compile programs for. The possibilities are:
336 </p>
337
338 <table>
339 <tr>
340 <th>Architecture</th>
341 <th>Subarchitecture</th>
342 <th>CHOST Setting</th>
343 </tr>
344 <tr>
345 <ti>x86</ti>
346 <ti>i386</ti>
347 <ti>i386-pc-linux-gnu</ti>
348 </tr>
349 <tr>
350 <ti>x86</ti>
351 <ti>i486</ti>
352 <ti>i486-pc-linux-gnu</ti>
353 </tr>
354 <tr>
355 <ti>x86</ti>
356 <ti>i586</ti>
357 <ti>i586-pc-linux-gnu</ti>
358 </tr>
359 <tr>
360 <ti>x86</ti>
361 <ti>i686 and above (incl. athlon)</ti>
362 <ti>i686-pc-linux-gnu</ti>
363 </tr>
364 <tr>
365 <ti>alpha</ti>
366 <ti></ti>
367 <ti>alpha-unknown-linux-gnu</ti>
368 </tr>
369 <tr>
370 <ti>ppc</ti>
371 <ti></ti>
372 <ti>powerpc-unknown-linux-gnu</ti>
373 </tr>
374 <tr>
375 <ti>sparc</ti>
376 <ti></ti>
377 <ti>sparc-unknown-linux-gnu</ti>
378 </tr>
379 <tr>
380 <ti>hppa</ti>
381 <ti>(generic)</ti>
382 <ti>hppa-unknown-linux-gnu</ti>
383 </tr>
384 <tr>
385 <ti>hppa</ti>
386 <ti>pa7000</ti>
387 <ti>hppa1.1-unknown-linux-gnu</ti>
388 </tr>
389 <tr>
390 <ti>hppa</ti>
391 <ti>pa8000 and above</ti>
392 <ti>hppa2.0-unknown-linux-gnu</ti>
393 </tr>
394 <tr>
395 <ti>mips</ti>
396 <ti></ti>
397 <ti>mips-unknown-linux-gnu</ti>
398 </tr>
399 <tr>
400 <ti>amd64</ti>
401 <ti></ti>
402 <ti>x86_64-pc-linux-gnu</ti>
403 </tr>
404 </table>
405
406 <p>
407 If you have altered the CHOST variable you will need to reload the environment
408 variables:
409 </p>
410
411 <pre caption="Reloading the environment variables">
412 # <i>env-update</i>
413 # <i>source /etc/profile</i>
414 </pre>
415
416 </body>
417 </subsection>
418 <subsection>
419 <title>CFLAGS and CXXFLAGS</title>
420 <body>
421
422 <p>
423 The <c>CFLAGS</c> and <c>CXXFLAGS</c> variables define the optimization flags
424 for the <c>gcc</c> C and C++ compiler respectively. Although we define those
425 generally here, you will only have maximum performance if you optimize these
426 flags for each program separately. The reason for this is because every program
427 is different.
428 </p>
429
430 <p>
431 In <path>make.conf</path> you should define the optimization flags you think
432 will make your system the most responsive <e>generally</e>. Don't place
433 experimental settings in this variable; too much optimization can make
434 programs behave bad (crash, or even worse, malfunction).
435 </p>
436
437 <p>
438 We will not explain all possible optimization options. If you want to know
439 them all, read the <uri link="http://gcc.gnu.org/onlinedocs/">GNU
440 Online Manual(s)</uri> or the <c>gcc</c> info page (<c>info gcc</c> -- only
441 works on a working Linux system). The <path>make.conf.example</path> file
442 itself also contains lots of examples and information; don't forget to read it
443 too.
444 </p>
445
446 <p>
447 A first setting is the <c>-march=</c> flag, which specifies the name of the
448 target architecture. Possible options are described in the
449 <path>make.conf.example</path> file (as comments). For instance, for the x86
450 Athlon XP architecture:
451 </p>
452
453 <pre caption="The GCC march setting">
454 <comment># AMD64 users who want to use a native 64 bit system should not use athlon-xp</comment>
455 -march=athlon-xp
456 </pre>
457
458 <p>
459 A second one is the <c>-O</c> flag (that is a capital O, not a zero),
460 which specifies the <c>gcc</c> optimization
461 class flag. Possible classes are <c>s</c> (for size-optimized),
462 <c>0</c> (zero - for no optimizations), <c>1</c>, <c>2</c> or <c>3</c> for more
463 speed-optimization flags (every class has the same flags as the one before, plus
464 some extras). For instance, for a class-2 optimization:
465 </p>
466
467 <pre caption="The GCC O setting">
468 -O2
469 </pre>
470
471 <p>
472 Other popular optimization flags are <c>-pipe</c> (use pipes rather than
473 temporary files for communication between the various stages of compilation) and
474 <c>-fomit-frame-pointer</c> (which doesn't keep the frame pointer in a register
475 for functions that don't need one).
476 </p>
477
478 <p>
479 When you define the <c>CFLAGS</c> and <c>CXXFLAGS</c>, you should combine
480 several optimization flags, like in the following example:
481 </p>
482
483 <pre caption="Defining the CFLAGS and CXXFLAGS variable">
484 CFLAGS="-march=athlon-xp -pipe -O2" <comment># AMD64 users should not use athlon-xp</comment>
485 CXXFLAGS="${CFLAGS}" <comment># Use the same settings for both variables</comment>
486 </pre>
487
488 </body>
489 </subsection>
490 <subsection>
491 <title>MAKEOPTS</title>
492 <body>
493
494 <p>
495 With <c>MAKEOPTS</c> you define how many parallel compilations should occur when
496 you install a package. The suggested number is the number of CPUs in your system
497 plus one.
498 </p>
499
500 <pre caption="MAKEOPTS for a regular, 1-CPU system">
501 MAKEOPTS="-j2"
502 </pre>
503
504 </body>
505 </subsection>
506 <subsection>
507 <title>Ready, Set, Go!</title>
508 <body>
509
510 <p>
511 Update your <path>/mnt/gentoo/etc/make.conf</path> to your own will and save
512 (<c>nano</c> users would hit <c>Ctrl-X</c>). You are now ready to continue
513 with <uri link="?part=1&amp;chap=6">Installing the Gentoo Base System</uri>.
514 </p>
515
516 </body>
517 </subsection>
518 </section>
519 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20