/[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.54 - (hide annotations) (download) (as text)
Sat Jul 31 12:42:35 2004 UTC (14 years, 2 months ago) by swift
Branch: MAIN
Changes since 1.53: +5 -3 lines
File MIME type: application/xml
#57330 - Make it more clear that using a portage snapshot from the CD is only required if you do a stage3 networkless installation

1 swift 1.31 <?xml version='1.0' encoding='UTF-8'?>
2     <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3    
4 swift 1.10 <!-- 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 swift 1.54 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-stage.xml,v 1.53 2004/07/31 12:04:06 swift Exp $ -->
8 swift 1.15
9 swift 1.7 <sections>
10 swift 1.1 <section>
11 swift 1.34 <title>Installing a Stage Tarball</title>
12     <subsection>
13 swift 1.38 <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 swift 1.41 Sun Apr 25 16:21:18 CEST 2004
28 swift 1.38 </pre>
29    
30     <p>
31 neysx 1.48 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 swift 1.38 </p>
36    
37     <pre caption="Setting the date/time">
38 swift 1.41 # <i>date 042516212004</i>
39 swift 1.38 </pre>
40    
41     </body>
42     </subsection>
43     <subsection>
44 swift 1.34 <title>Making your Choice</title>
45 swift 1.1 <body>
46    
47     <p>
48 swift 1.34 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 swift 1.37 from the Internet or, if you are booted from one of the Gentoo Universal
51     LiveCDs, copy it over from the CD itself.
52 swift 1.12 </p>
53    
54     <ul>
55 swift 1.34 <li><uri link="#doc_chap2">Default: Using a Stage from the Internet</uri></li>
56 swift 1.17 <li><uri link="#doc_chap3">Alternative: Using a Stage from the LiveCD</uri></li>
57 swift 1.12 </ul>
58    
59     </body>
60 swift 1.34 </subsection>
61 swift 1.12 </section>
62     <section>
63 swift 1.34 <title>Default: Using a Stage from the Internet</title>
64 swift 1.12 <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 swift 1.40 <path>releases/</path> directory, followed by your architecture (for instance
83 dertobi123 1.49 <path>x86/</path>) and the Gentoo version (<path>2004.2/</path>)
84 swift 1.34 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 swift 1.12 </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 swift 1.19 <c>links2</c> is more powerful than <c>lynx</c>, but has some drawbacks. One of
96 swift 1.12 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 swift 1.34 <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 swift 1.12 </pre>
106    
107 swift 1.32 <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 swift 1.50 mirror. For instance, to check the validity of the x86 stage tarball:
111 swift 1.32 </p>
112    
113 swift 1.50 <pre caption="Example checking integrity of a stage tarball">
114 swift 1.51 # <i>md5sum -c stage1-x86-2004.2.tar.bz2.md5</i>
115 dertobi123 1.49 stage1-x86-2004.2.tar.bz2: OK
116 swift 1.32 </pre>
117    
118 swift 1.12 </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 swift 1.19 # <i>tar -xvjpf stage?-*.tar.bz2</i>
131 swift 1.12 </pre>
132    
133 swift 1.46 <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 swift 1.12 <p>
139 swift 1.19 Make sure that you use the same options (<c>-xvjpf</c>). The <c>x</c> stands for
140 swift 1.12 <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 swift 1.34 Now that the stage is installed, continue with <uri
148     link="#installing_portage">Installing Portage</uri>.
149 swift 1.12 </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 swift 1.19 GNU <c>tar</c> tool. Make sure you use the same options (<c>-xvjpf</c>)! In the
191 swift 1.45 next example, we extract the stage tarball
192 dertobi123 1.49 <path>stage3-&lt;subarch&gt;-2004.2.tar.bz2</path>.
193 swift 1.12 Be sure to substitute the tarball filename with your stage.
194     </p>
195    
196     <pre caption="Extracting the stage tarball">
197 dertobi123 1.49 # <i>tar -xvjpf /mnt/cdrom/stages/stage3-&lt;subarch&gt;-2004.2.tar.bz2</i>
198 swift 1.12 </pre>
199    
200 swift 1.46 <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 swift 1.34 <p>
206     Now that the stage is installed, continue with <uri
207     link="#installing_portage">Installing Portage</uri>.
208     </p>
209    
210 swift 1.12 </body>
211     </subsection>
212 swift 1.34 </section>
213     <section id="installing_portage">
214     <title>Installing Portage</title>
215 swift 1.12 <subsection>
216 swift 1.34 <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 swift 1.54 snapshot provided by one of our LiveCDs. This automatically assumes that you are
222     installing from a <e>stage3</e> tarball (as it is the only tarball supported for
223     networkless installations). If you want to use prebuilt packages
224 swift 1.37 later on to speed up the installation, you <e>must</e> use a portage snapshot
225 swift 1.54 from the LiveCD. Other users should download a fully updated Portage tree using
226 swift 1.37 <c>emerge</c> later on.
227 swift 1.34 </p>
228    
229     <p>
230     Continue with the appropriate part:
231     </p>
232    
233     <ul>
234     <li>
235     <uri link="#installing_from_LiveCD">Installing a Portage Snapshot and
236     Source Code from LiveCD</uri> (for networkless installations or GRP
237     installations)
238     </li>
239     <li>
240     <uri link="#compile_options">Configuring the Compile Options</uri> (all
241     other installation methods)
242     </li>
243     </ul>
244    
245     </body>
246     </subsection>
247     <subsection id="installing_from_LiveCD">
248     <title>Installing a Portage Snapshot and Source Code from LiveCD</title>
249 swift 1.12 <body>
250    
251     <p>
252 swift 1.37 There is a Portage snapshot available on the Universal LiveCDs. Since you are
253     reading this, we can safely assume you are using such a LiveCD. To install this
254 swift 1.12 snapshot, take a look inside <path>/mnt/cdrom/snapshots/</path> to see what
255 swift 1.19 snapshot we have available:
256 swift 1.12 </p>
257    
258     <pre caption="Checking the /mnt/cdrom/snapshots content">
259     # <i>ls /mnt/cdrom/snapshots</i>
260     </pre>
261    
262     <p>
263 swift 1.19 Now extract the snapshot using the following construct. Again,
264 swift 1.12 make sure you use the correct options to <c>tar</c>. Also, the <c>-C</c> is with
265     a capital <c>C</c>, not <c>c</c>. In the next example we use
266 dertobi123 1.49 <path>portage-20040710.tar.bz2</path> as the snapshot filename. Be sure to
267 swift 1.12 substitute with your snapshot.
268     </p>
269    
270     <pre caption="Extracting a Portage snapshot">
271 dertobi123 1.49 # <i>tar -xvjf /mnt/cdrom/snapshots/portage-20040710.tar.bz2 -C /mnt/gentoo/usr</i>
272 swift 1.12 </pre>
273    
274     <p>
275 swift 1.34 You also need to copy over all source code from the CD:
276 swift 1.12 </p>
277    
278     <pre caption="Copy over source code">
279 swift 1.26 # <i>mkdir /mnt/gentoo/usr/portage/distfiles</i>
280     # <i>cp /mnt/cdrom/distfiles/* /mnt/gentoo/usr/portage/distfiles/</i>
281 swift 1.12 </pre>
282    
283     <p>
284 swift 1.34 Now that your Portage snapshot is installed, continue with <uri
285     link="#compile_options">Configuring the Compile Options</uri>.
286 swift 1.1 </p>
287    
288     </body>
289 swift 1.12 </subsection>
290 swift 1.7 </section>
291 swift 1.34
292     <section id="compile_options">
293 swift 1.7 <title>Configuring the Compile Options</title>
294 swift 1.1 <subsection>
295 swift 1.3 <title>Introduction</title>
296 swift 1.1 <body>
297    
298     <p>
299 swift 1.3 To optimize Gentoo, you can set a couple of variables which impact Portage
300     behaviour. All those variables can be set as environment variables (using
301     <c>export</c>) but that isn't permanent. To keep your settings, Portage provides
302     you with <path>/etc/make.conf</path>, a configuration file for Portage. It is
303     this file we will edit now.
304 swift 1.1 </p>
305    
306 dertobi123 1.27 <note>
307     A commented listing of all possible variables can be found in
308 swift 1.34 <path>/mnt/gentoo/etc/make.conf.example</path>. For a successful Gentoo
309 swift 1.29 installation you'll only need to set the variables which are mentioned beneath.
310 dertobi123 1.27 </note>
311    
312 swift 1.3 <p>
313     Fire up your favorite editor (in this guide we use <c>nano</c>) so we can alter
314     the optimization variables we will discuss hereafter.
315     </p>
316    
317     <pre caption="Opening /etc/make.conf">
318 swift 1.12 # <i>nano -w /mnt/gentoo/etc/make.conf</i>
319 swift 1.3 </pre>
320    
321     <p>
322 swift 1.34 As you probably notice now, the <path>make.conf.example</path> file is
323 dertobi123 1.27 structured in a generic way: commented lines start with "#", other lines define
324     variables using the <c>VARIABLE="content"</c> syntax. Several of those
325     variables are discussed next.
326 swift 1.3 </p>
327    
328     </body>
329 swift 1.7 </subsection>
330     <subsection>
331 swift 1.3 <title>CHOST</title>
332     <body>
333    
334     <warn>
335 swift 1.34 Although it might be tempting for non-stage1 users, they should <e>not</e>
336 swift 1.3 change the <c>CHOST</c> setting in <path>make.conf</path>. Doing so might render
337 swift 1.4 their system unusable. Again: only change this variable if you use a
338     <e>stage1</e> installation.
339 swift 1.3 </warn>
340 swift 1.4
341     <p>
342     The <c>CHOST</c> variable defines what architecture <c>gcc</c> has to
343     compile programs for. The possibilities are:
344     </p>
345    
346     <table>
347     <tr>
348     <th>Architecture</th>
349     <th>Subarchitecture</th>
350     <th>CHOST Setting</th>
351     </tr>
352     <tr>
353     <ti>x86</ti>
354     <ti>i386</ti>
355     <ti>i386-pc-linux-gnu</ti>
356     </tr>
357     <tr>
358     <ti>x86</ti>
359     <ti>i486</ti>
360     <ti>i486-pc-linux-gnu</ti>
361     </tr>
362     <tr>
363     <ti>x86</ti>
364     <ti>i586</ti>
365     <ti>i586-pc-linux-gnu</ti>
366     </tr>
367     <tr>
368     <ti>x86</ti>
369     <ti>i686 and above (incl. athlon)</ti>
370     <ti>i686-pc-linux-gnu</ti>
371     </tr>
372     <tr>
373     <ti>alpha</ti>
374     <ti></ti>
375     <ti>alpha-unknown-linux-gnu</ti>
376     </tr>
377     <tr>
378     <ti>ppc</ti>
379     <ti></ti>
380     <ti>powerpc-unknown-linux-gnu</ti>
381     </tr>
382     <tr>
383     <ti>sparc</ti>
384     <ti></ti>
385     <ti>sparc-unknown-linux-gnu</ti>
386     </tr>
387     <tr>
388     <ti>hppa</ti>
389 swift 1.13 <ti>(generic)</ti>
390     <ti>hppa-unknown-linux-gnu</ti>
391     </tr>
392     <tr>
393     <ti>hppa</ti>
394     <ti>pa7000</ti>
395     <ti>hppa1.1-unknown-linux-gnu</ti>
396     </tr>
397     <tr>
398     <ti>hppa</ti>
399     <ti>pa8000 and above</ti>
400     <ti>hppa2.0-unknown-linux-gnu</ti>
401 swift 1.4 </tr>
402 swift 1.21 <tr>
403     <ti>mips</ti>
404     <ti></ti>
405     <ti>mips-unknown-linux-gnu</ti>
406     </tr>
407 swift 1.28 <tr>
408     <ti>amd64</ti>
409     <ti></ti>
410     <ti>x86_64-pc-linux-gnu</ti>
411     </tr>
412 swift 1.4 </table>
413    
414 swift 1.52 <p>
415     If you have altered the CHOST variable you will need to reload the environment
416     variables:
417     </p>
418    
419     <pre caption="Reloading the environment variables">
420     # <i>env-update</i>
421     # <i>source /etc/profile</i>
422     </pre>
423    
424 swift 1.4 </body>
425 swift 1.7 </subsection>
426     <subsection>
427 swift 1.4 <title>CFLAGS and CXXFLAGS</title>
428     <body>
429    
430     <p>
431     The <c>CFLAGS</c> and <c>CXXFLAGS</c> variables define the optimization flags
432     for the <c>gcc</c> C and C++ compiler respectively. Although we define those
433     generally here, you will only have maximum performance if you optimize these
434 swift 1.18 flags for each program separately. The reason for this is because every program
435 swift 1.4 is different.
436     </p>
437    
438     <p>
439     In <path>make.conf</path> you should define the optimization flags you think
440     will make your system the most responsive <e>generally</e>. Don't place
441     experimental settings in this variable; too much optimization can make
442     programs behave bad (crash, or even worse, malfunction).
443     </p>
444    
445     <p>
446     We will not explain all possible optimization options. If you want to know
447 swift 1.43 them all, read the <uri link="http://gcc.gnu.org/onlinedocs/">GNU
448 swift 1.4 Online Manual(s)</uri> or the <c>gcc</c> info page (<c>info gcc</c> -- only
449 swift 1.34 works on a working Linux system). The <path>make.conf.example</path> file
450     itself also contains lots of examples and information; don't forget to read it
451     too.
452 swift 1.4 </p>
453    
454     <p>
455     A first setting is the <c>-march=</c> flag, which specifies the name of the
456     target architecture. Possible options are described in the
457 swift 1.34 <path>make.conf.example</path> file (as comments). For instance, for the x86
458     Athlon XP architecture:
459 swift 1.4 </p>
460    
461     <pre caption="The GCC march setting">
462 swift 1.53 <comment># AMD64 users who want to use a native 64 bit system should not use athlon-xp</comment>
463 swift 1.4 -march=athlon-xp
464     </pre>
465    
466     <p>
467 neysx 1.48 A second one is the <c>-O</c> flag (that is a capital O, not a zero),
468     which specifies the <c>gcc</c> optimization
469 swift 1.6 class flag. Possible classes are <c>s</c> (for size-optimized),
470 swift 1.36 <c>0</c> (zero - for no optimizations), <c>1</c>, <c>2</c> or <c>3</c> for more
471 swift 1.4 speed-optimization flags (every class has the same flags as the one before, plus
472 swift 1.6 some extras). For instance, for a class-2 optimization:
473 swift 1.4 </p>
474    
475     <pre caption="The GCC O setting">
476     -O2
477     </pre>
478    
479     <p>
480     Other popular optimization flags are <c>-pipe</c> (use pipes rather than
481     temporary files for communication between the various stages of compilation) and
482     <c>-fomit-frame-pointer</c> (which doesn't keep the frame pointer in a register
483     for functions that don't need one).
484     </p>
485    
486     <p>
487     When you define the <c>CFLAGS</c> and <c>CXXFLAGS</c>, you should combine
488     several optimization flags, like in the following example:
489     </p>
490    
491     <pre caption="Defining the CFLAGS and CXXFLAGS variable">
492 neysx 1.47 CFLAGS="-march=athlon-xp -pipe -O2" <comment># AMD64 users should not use athlon-xp</comment>
493 swift 1.4 CXXFLAGS="${CFLAGS}" <comment># Use the same settings for both variables</comment>
494     </pre>
495    
496     </body>
497 swift 1.7 </subsection>
498     <subsection>
499 swift 1.4 <title>MAKEOPTS</title>
500     <body>
501    
502 swift 1.6 <p>
503     With <c>MAKEOPTS</c> you define how many parallel compilations should occur when
504     you install a package. The suggested number is the number of CPUs in your system
505     plus one.
506     </p>
507    
508     <pre caption="MAKEOPTS for a regular, 1-CPU system">
509     MAKEOPTS="-j2"
510     </pre>
511    
512 swift 1.4 </body>
513 swift 1.7 </subsection>
514     <subsection>
515 swift 1.6 <title>Ready, Set, Go!</title>
516 swift 1.4 <body>
517 swift 1.3
518 swift 1.6 <p>
519 swift 1.12 Update your <path>/mnt/gentoo/etc/make.conf</path> to your own will and save.
520     You are now ready to continue with <uri link="?part=1&amp;chap=6">Installing the
521     Gentoo Base System</uri>.
522 swift 1.8 </p>
523 swift 1.6
524     </body>
525 swift 1.1 </subsection>
526     </section>
527 swift 1.7 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20