/[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.86 - (hide annotations) (download) (as text)
Wed Aug 10 10:46:51 2005 UTC (13 years, 2 months ago) by swift
Branch: MAIN
Changes since 1.85: +10 -3 lines
File MIME type: application/xml
stage3 for athlon-xp has wrong permissions

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.86 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-stage.xml,v 1.85 2005/08/09 09:43:58 swift Exp $ -->
8 swift 1.15
9 swift 1.7 <sections>
10 swift 1.68
11 swift 1.86 <version>2.2</version>
12     <date>2005-08-10</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.86 <!-- 2005.1: stage3 for athlon xp is b0rked -->
162     <warn>
163     The <path>stage3-athlon-xp-2005.1.tar.bz2</path> file has a serious permission
164     error. After extracting, run <c>chmod 0755 /mnt/gentoo</c> to fix this
165     <e>before</e> continuing with the installation.
166     </warn>
167    
168 swift 1.79 <note>
169 swift 1.84 Some architectures (e.g. MIPS) Installation CDs and boot images rely upon the
170 swift 1.79 <c>tar</c> built into BusyBox which doesn't currently support the <c>-v</c>
171     option. Therefore it may not work.
172     </note>
173    
174 swift 1.12 <p>
175 swift 1.34 Now that the stage is installed, continue with <uri
176     link="#installing_portage">Installing Portage</uri>.
177 swift 1.12 </p>
178    
179     </body>
180     </subsection>
181     </section>
182     <section>
183 swift 1.84 <title>Alternative: Using a Stage from the Installation CD</title>
184 swift 1.12 <subsection>
185     <title>Extracting the Stage Tarball</title>
186     <body>
187    
188     <p>
189     The stages on the CD reside in the <path>/mnt/cdrom/stages</path> directory. To
190     see a listing of available stages, use <c>ls</c>:
191     </p>
192    
193     <pre caption="List all available stages">
194     # <i>ls /mnt/cdrom/stages</i>
195     </pre>
196    
197     <p>
198     If the system replies with an error, you may need to mount the CD-ROM first:
199     </p>
200    
201     <pre caption="Mounting the CD-ROM">
202     # <i>ls /mnt/cdrom/stages</i>
203     ls: /mnt/cdrom/stages: No such file or directory
204     # <i>mount /dev/cdroms/cdrom0 /mnt/cdrom</i>
205     # <i>ls /mnt/cdrom/stages</i>
206     </pre>
207    
208     <p>
209     Now go into your Gentoo mountpoint (usually <path>/mnt/gentoo</path>):
210     </p>
211    
212     <pre caption="Changing directory to /mnt/gentoo">
213     # <i>cd /mnt/gentoo</i>
214     </pre>
215    
216     <p>
217     We will now extract the stage tarball of your choice. We will do this with the
218 swift 1.79 GNU <c>tar</c> tool. Make sure you use the same options (<c>-xvjpf</c>)! Again,
219     the <c>v</c> argument is optional and not supported in some <c>tar</c> versions.
220     In the next example, we extract the stage tarball
221 swift 1.85 <path>stage3-&lt;subarch&gt;-2005.1.tar.bz2</path>.
222 swift 1.12 Be sure to substitute the tarball filename with your stage.
223     </p>
224    
225     <pre caption="Extracting the stage tarball">
226 swift 1.85 # <i>tar -xvjpf /mnt/cdrom/stages/stage3-&lt;subarch&gt;-2005.1.tar.bz2</i>
227 swift 1.12 </pre>
228    
229 swift 1.34 <p>
230     Now that the stage is installed, continue with <uri
231     link="#installing_portage">Installing Portage</uri>.
232     </p>
233    
234 swift 1.12 </body>
235     </subsection>
236 swift 1.34 </section>
237     <section id="installing_portage">
238     <title>Installing Portage</title>
239 swift 1.12 <subsection>
240 swift 1.71 <title>Unpacking a Portage Snapshot</title>
241 swift 1.34 <body>
242    
243     <p>
244 neysx 1.72 You now have to install a Portage snapshot, a collection of files that inform
245 swift 1.71 Portage what software titles you can install, which profiles are available, etc.
246     </p>
247    
248     </body>
249     </subsection>
250     <subsection id="installing_from_Internet">
251 swift 1.77 <title>Download and Install a Portage Snapshot</title>
252 swift 1.71 <body>
253    
254     <p>
255 neysx 1.72 Go to the mountpoint where you mounted your filesystem (most likely
256 swift 1.71 <path>/mnt/gentoo</path>):
257     </p>
258    
259     <pre caption="Going to the Gentoo mountpoint">
260     # <i>cd /mnt/gentoo</i>
261     </pre>
262    
263     <p>
264     Fire up <c>links2</c> (or <c>lynx</c>) and go to our <uri
265 neysx 1.72 link="/main/en/mirrors.xml">Gentoo mirror list</uri>. Pick a mirror close to
266     you and open the <path>snapshots/</path> directory. There, download the latest
267 swift 1.83 Portage snapshot by selecting it and pressing <c>D</c>.
268 swift 1.71 </p>
269    
270 neysx 1.72 <pre caption="Browsing the Gentoo mirrorlist">
271 swift 1.71 # <i>links2 http://www.gentoo.org/main/en/mirrors.xml</i>
272     </pre>
273    
274     <p>
275     Now exit your browser by pressing <c>Q</c>. You will now have a Portage snapshot
276     stored in <path>/mnt/gentoo</path>. In the next step, we extract the Portage
277 swift 1.77 snapshot onto your filesystem. Make sure that you use the exact command; the
278     last option is a capital <c>C</c>, not <c>c</c>.
279 swift 1.71 </p>
280    
281     <pre caption="Extracting the Portage snapshot">
282 swift 1.83 <comment>(Substitute &lt;date&gt; with the datestamp of the downloaded snapshot)</comment>
283     # <i>tar -xvjf /mnt/gentoo/portage-&lt;date&gt;.tar.bz2 -C /mnt/gentoo/usr</i>
284 swift 1.71 </pre>
285    
286     </body>
287     </subsection>
288 swift 1.7 </section>
289 swift 1.34
290     <section id="compile_options">
291 swift 1.7 <title>Configuring the Compile Options</title>
292 swift 1.1 <subsection>
293 swift 1.3 <title>Introduction</title>
294 swift 1.1 <body>
295    
296     <p>
297 swift 1.3 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 swift 1.1 </p>
303    
304 dertobi123 1.27 <note>
305     A commented listing of all possible variables can be found in
306 swift 1.34 <path>/mnt/gentoo/etc/make.conf.example</path>. For a successful Gentoo
307 swift 1.29 installation you'll only need to set the variables which are mentioned beneath.
308 dertobi123 1.27 </note>
309    
310 swift 1.3 <p>
311     Fire up your favorite editor (in this guide we use <c>nano</c>) so we can alter
312 swift 1.57 the optimization variables we will discuss hereafter.
313 swift 1.3 </p>
314    
315     <pre caption="Opening /etc/make.conf">
316 swift 1.12 # <i>nano -w /mnt/gentoo/etc/make.conf</i>
317 swift 1.3 </pre>
318    
319     <p>
320 swift 1.57 As you probably noticed, the <path>make.conf.example</path> file is
321 dertobi123 1.27 structured in a generic way: commented lines start with "#", other lines define
322 swift 1.57 variables using the <c>VARIABLE="content"</c> syntax. The <path>make.conf</path>
323     file uses the same syntax. Several of those variables are discussed next.
324 swift 1.3 </p>
325    
326     </body>
327 swift 1.7 </subsection>
328     <subsection>
329 swift 1.3 <title>CHOST</title>
330     <body>
331    
332     <warn>
333 swift 1.34 Although it might be tempting for non-stage1 users, they should <e>not</e>
334 swift 1.3 change the <c>CHOST</c> setting in <path>make.conf</path>. Doing so might render
335 swift 1.4 their system unusable. Again: only change this variable if you use a
336     <e>stage1</e> installation.
337 swift 1.3 </warn>
338 swift 1.4
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 swift 1.60 <ti>ppc64</ti>
382     <ti></ti>
383     <ti>powerpc64-unknown-linux-gnu</ti>
384     </tr>
385     <tr>
386 swift 1.4 <ti>sparc</ti>
387     <ti></ti>
388     <ti>sparc-unknown-linux-gnu</ti>
389     </tr>
390     <tr>
391 neysx 1.75 <ti>sparc64</ti>
392     <ti></ti>
393     <ti>sparc-unknown-linux-gnu</ti>
394     </tr>
395     <tr>
396 swift 1.4 <ti>hppa</ti>
397 swift 1.13 <ti>(generic)</ti>
398     <ti>hppa-unknown-linux-gnu</ti>
399     </tr>
400     <tr>
401     <ti>hppa</ti>
402     <ti>pa7000</ti>
403     <ti>hppa1.1-unknown-linux-gnu</ti>
404     </tr>
405     <tr>
406     <ti>hppa</ti>
407     <ti>pa8000 and above</ti>
408     <ti>hppa2.0-unknown-linux-gnu</ti>
409 swift 1.4 </tr>
410 swift 1.21 <tr>
411     <ti>mips</ti>
412     <ti></ti>
413     <ti>mips-unknown-linux-gnu</ti>
414     </tr>
415 swift 1.28 <tr>
416     <ti>amd64</ti>
417     <ti></ti>
418     <ti>x86_64-pc-linux-gnu</ti>
419     </tr>
420 swift 1.4 </table>
421    
422 swift 1.76 <p>
423     Please, make sure that you use the <e>correct</e> CHOST setting. For instance,
424     the CHOST setting for sparc64 still is <c>sparc-unknown-linux-gnu</c> and
425     <e>not</e> <c>sparc64-unknown-linux-gnu</c>!
426     </p>
427    
428 swift 1.78 <p>
429     Users interested in bootstrapping their entire system with NPTL support on an
430     x86 system need to set their CHOST to <c>i586-pc-linux-gnu</c> or higher.
431     </p>
432    
433 swift 1.4 </body>
434 swift 1.7 </subsection>
435     <subsection>
436 swift 1.4 <title>CFLAGS and CXXFLAGS</title>
437     <body>
438    
439     <p>
440     The <c>CFLAGS</c> and <c>CXXFLAGS</c> variables define the optimization flags
441     for the <c>gcc</c> C and C++ compiler respectively. Although we define those
442     generally here, you will only have maximum performance if you optimize these
443 swift 1.18 flags for each program separately. The reason for this is because every program
444 swift 1.4 is different.
445     </p>
446    
447     <p>
448     In <path>make.conf</path> you should define the optimization flags you think
449     will make your system the most responsive <e>generally</e>. Don't place
450     experimental settings in this variable; too much optimization can make
451     programs behave bad (crash, or even worse, malfunction).
452     </p>
453    
454     <p>
455     We will not explain all possible optimization options. If you want to know
456 swift 1.43 them all, read the <uri link="http://gcc.gnu.org/onlinedocs/">GNU
457 swift 1.4 Online Manual(s)</uri> or the <c>gcc</c> info page (<c>info gcc</c> -- only
458 swift 1.34 works on a working Linux system). The <path>make.conf.example</path> file
459     itself also contains lots of examples and information; don't forget to read it
460     too.
461 swift 1.4 </p>
462    
463     <p>
464     A first setting is the <c>-march=</c> flag, which specifies the name of the
465     target architecture. Possible options are described in the
466 swift 1.34 <path>make.conf.example</path> file (as comments). For instance, for the x86
467     Athlon XP architecture:
468 swift 1.4 </p>
469    
470     <pre caption="The GCC march setting">
471 neysx 1.81 <comment># AMD64 users who want to use a native 64 bit system should use -march=k8</comment>
472 swift 1.85 <comment>#EM64T users should use -march=nocona</comment>
473 swift 1.4 -march=athlon-xp
474     </pre>
475    
476     <p>
477 neysx 1.48 A second one is the <c>-O</c> flag (that is a capital O, not a zero),
478     which specifies the <c>gcc</c> optimization
479 swift 1.6 class flag. Possible classes are <c>s</c> (for size-optimized),
480 swift 1.36 <c>0</c> (zero - for no optimizations), <c>1</c>, <c>2</c> or <c>3</c> for more
481 swift 1.4 speed-optimization flags (every class has the same flags as the one before, plus
482 swift 1.6 some extras). For instance, for a class-2 optimization:
483 swift 1.4 </p>
484    
485     <pre caption="The GCC O setting">
486     -O2
487     </pre>
488    
489     <p>
490 swift 1.67 Another popular optimization flag is <c>-pipe</c> (use pipes rather than
491     temporary files for communication between the various stages of compilation).
492     </p>
493    
494     <p>
495     Mind you that using <c>-fomit-frame-pointer</c> (which doesn't keep the frame
496     pointer in a register for functions that don't need one) might have serious
497     repercussions on the debugging of applications!
498 swift 1.4 </p>
499    
500     <p>
501     When you define the <c>CFLAGS</c> and <c>CXXFLAGS</c>, you should combine
502     several optimization flags, like in the following example:
503     </p>
504    
505     <pre caption="Defining the CFLAGS and CXXFLAGS variable">
506 swift 1.82 CFLAGS="-march=athlon-xp -pipe -O2" <comment># AMD64 users should use march=k8</comment>
507 swift 1.85 <comment># EM64T users should use march=nocona</comment>
508 swift 1.4 CXXFLAGS="${CFLAGS}" <comment># Use the same settings for both variables</comment>
509     </pre>
510    
511     </body>
512 swift 1.7 </subsection>
513     <subsection>
514 swift 1.4 <title>MAKEOPTS</title>
515     <body>
516    
517 swift 1.6 <p>
518     With <c>MAKEOPTS</c> you define how many parallel compilations should occur when
519 swift 1.62 you install a package. A good choice is the number of CPUs in your system plus
520     one, but this guideline isn't always perfect.
521 swift 1.6 </p>
522    
523     <pre caption="MAKEOPTS for a regular, 1-CPU system">
524     MAKEOPTS="-j2"
525     </pre>
526    
527 swift 1.4 </body>
528 swift 1.7 </subsection>
529     <subsection>
530 swift 1.6 <title>Ready, Set, Go!</title>
531 swift 1.4 <body>
532 swift 1.3
533 swift 1.6 <p>
534 neysx 1.61 Update your <path>/mnt/gentoo/etc/make.conf</path> to your own preference and
535     save (<c>nano</c> users would hit <c>Ctrl-X</c>). You are now ready to continue
536 swift 1.57 with <uri link="?part=1&amp;chap=6">Installing the Gentoo Base System</uri>.
537 swift 1.8 </p>
538 swift 1.6
539     </body>
540 swift 1.1 </subsection>
541     </section>
542 swift 1.7 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20