/[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.49 - (show annotations) (download) (as text)
Mon Jul 26 09:04:42 2004 UTC (13 years, 11 months ago) by dertobi123
Branch: MAIN
Changes since 1.48: +8 -13 lines
File MIME type: application/xml
Move over files from the draft/ directory. 2004.2 is released :)

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

  ViewVC Help
Powered by ViewVC 1.1.20