/[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.85 - (hide annotations) (download) (as text)
Tue Aug 9 09:43:58 2005 UTC (12 years, 6 months ago) by swift
Branch: MAIN
Changes since 1.84: +10 -8 lines
File MIME type: application/xml
Migrating to 2005.1

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

  ViewVC Help
Powered by ViewVC 1.1.20