/[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.90 - (hide annotations) (download) (as text)
Fri Nov 11 17:27:15 2005 UTC (12 years, 3 months ago) by swift
Branch: MAIN
Changes since 1.89: +17 -106 lines
File MIME type: application/xml
#105809 - Moving bootstrapping/system to FAQ, outside handbook

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 jkt 1.89 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 swift 1.10
7 swift 1.90 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-stage.xml,v 1.89 2005/08/13 21:21:30 jkt Exp $ -->
8 swift 1.15
9 swift 1.7 <sections>
10 swift 1.68
11 swift 1.90 <version>2.6</version>
12     <date>2005-11-11</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 swift 1.90 The next step you need to perform is to install the <e>stage3</e> tarball
53     onto your system. You have the option of downloading the required
54 neysx 1.74 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 swift 1.90 Make sure you download a stage3 tarball - installations using a stage1 or stage2
128     tarball are not supported anymore.
129     </p>
130    
131     <p>
132 swift 1.32 If you want to check the integrity of the downloaded stage tarball, use
133     <c>md5sum</c> and compare the output with the MD5 checksum provided on the
134 swift 1.50 mirror. For instance, to check the validity of the x86 stage tarball:
135 swift 1.32 </p>
136    
137 swift 1.50 <pre caption="Example checking integrity of a stage tarball">
138 swift 1.90 # <i>md5sum -c stage3-x86-2005.1.tar.bz2.md5</i>
139     stage3-x86-2005.1.tar.bz2: OK
140 swift 1.32 </pre>
141    
142 swift 1.12 </body>
143     </subsection>
144     <subsection>
145     <title>Unpacking the Stage Tarball</title>
146     <body>
147    
148     <p>
149     Now unpack your downloaded stage onto your system. We use GNU's <c>tar</c> to
150     proceed as it is the easiest method:
151     </p>
152    
153     <pre caption="Unpacking the stage">
154 swift 1.90 # <i>tar -xvjpf stage3-*.tar.bz2</i>
155 swift 1.12 </pre>
156    
157     <p>
158 swift 1.19 Make sure that you use the same options (<c>-xvjpf</c>). The <c>x</c> stands for
159 swift 1.79 <e>Extract</e>, the <c>v</c> for <e>Verbose</e> to see what happens during the
160     extraction process (okay, yes, this is optional),
161 swift 1.12 the <c>j</c> for <e>Decompress with bzip2</e>, the <c>p</c> for <e>Preserve
162     permissions</e> and the <c>f</c> to denote that we want to extract a file, not
163     standard input.
164     </p>
165    
166 fox2mike 1.88 <!-- 2005.1: stage3 for athlon xp, pentium3 and pentium4 are b0rked -->
167 swift 1.86 <warn>
168 fox2mike 1.88 The <path>stage3-athlon-xp-2005.1.tar.bz2</path>,
169     <path>stage3-pentium3-2005.1.tar.bz2</path> and
170 jkt 1.89 <path>stage3-pentium4-2005.1.tar.bz2</path> files have a serious permission
171 fox2mike 1.88 error. After extracting any of these, run <c>chmod 0755 /mnt/gentoo</c> to fix
172     the error <e>before</e> continuing with the installation.
173 swift 1.86 </warn>
174    
175 swift 1.79 <note>
176 swift 1.84 Some architectures (e.g. MIPS) Installation CDs and boot images rely upon the
177 swift 1.79 <c>tar</c> built into BusyBox which doesn't currently support the <c>-v</c>
178     option. Therefore it may not work.
179     </note>
180    
181 swift 1.12 <p>
182 swift 1.34 Now that the stage is installed, continue with <uri
183     link="#installing_portage">Installing Portage</uri>.
184 swift 1.12 </p>
185    
186     </body>
187     </subsection>
188     </section>
189     <section>
190 swift 1.84 <title>Alternative: Using a Stage from the Installation CD</title>
191 swift 1.12 <subsection>
192     <title>Extracting the Stage Tarball</title>
193     <body>
194    
195     <p>
196     The stages on the CD reside in the <path>/mnt/cdrom/stages</path> directory. To
197     see a listing of available stages, use <c>ls</c>:
198     </p>
199    
200     <pre caption="List all available stages">
201     # <i>ls /mnt/cdrom/stages</i>
202     </pre>
203    
204     <p>
205     If the system replies with an error, you may need to mount the CD-ROM first:
206     </p>
207    
208     <pre caption="Mounting the CD-ROM">
209     # <i>ls /mnt/cdrom/stages</i>
210     ls: /mnt/cdrom/stages: No such file or directory
211     # <i>mount /dev/cdroms/cdrom0 /mnt/cdrom</i>
212     # <i>ls /mnt/cdrom/stages</i>
213     </pre>
214    
215     <p>
216     Now go into your Gentoo mountpoint (usually <path>/mnt/gentoo</path>):
217     </p>
218    
219     <pre caption="Changing directory to /mnt/gentoo">
220     # <i>cd /mnt/gentoo</i>
221     </pre>
222    
223     <p>
224     We will now extract the stage tarball of your choice. We will do this with the
225 swift 1.79 GNU <c>tar</c> tool. Make sure you use the same options (<c>-xvjpf</c>)! Again,
226     the <c>v</c> argument is optional and not supported in some <c>tar</c> versions.
227     In the next example, we extract the stage tarball
228 swift 1.85 <path>stage3-&lt;subarch&gt;-2005.1.tar.bz2</path>.
229 swift 1.12 Be sure to substitute the tarball filename with your stage.
230     </p>
231    
232     <pre caption="Extracting the stage tarball">
233 swift 1.85 # <i>tar -xvjpf /mnt/cdrom/stages/stage3-&lt;subarch&gt;-2005.1.tar.bz2</i>
234 swift 1.12 </pre>
235    
236 fox2mike 1.88 <!-- 2005.1: stage3 for athlon xp, pentium3 and pentium4 are b0rked -->
237 swift 1.87 <warn>
238 fox2mike 1.88 The <path>stage3-athlon-xp-2005.1.tar.bz2</path>,
239     <path>stage3-pentium3-2005.1.tar.bz2</path> and
240 jkt 1.89 <path>stage3-pentium4-2005.1.tar.bz2</path> files have a serious permission
241 fox2mike 1.88 error. After extracting any of these, run <c>chmod 0755 /mnt/gentoo</c> to fix
242     the error <e>before</e> continuing with the installation.
243 swift 1.87 </warn>
244    
245 swift 1.34 <p>
246     Now that the stage is installed, continue with <uri
247     link="#installing_portage">Installing Portage</uri>.
248     </p>
249    
250 swift 1.12 </body>
251     </subsection>
252 swift 1.34 </section>
253     <section id="installing_portage">
254     <title>Installing Portage</title>
255 swift 1.12 <subsection>
256 swift 1.71 <title>Unpacking a Portage Snapshot</title>
257 swift 1.34 <body>
258    
259     <p>
260 neysx 1.72 You now have to install a Portage snapshot, a collection of files that inform
261 swift 1.71 Portage what software titles you can install, which profiles are available, etc.
262     </p>
263    
264     </body>
265     </subsection>
266     <subsection id="installing_from_Internet">
267 swift 1.77 <title>Download and Install a Portage Snapshot</title>
268 swift 1.71 <body>
269    
270     <p>
271 neysx 1.72 Go to the mountpoint where you mounted your filesystem (most likely
272 swift 1.71 <path>/mnt/gentoo</path>):
273     </p>
274    
275     <pre caption="Going to the Gentoo mountpoint">
276     # <i>cd /mnt/gentoo</i>
277     </pre>
278    
279     <p>
280     Fire up <c>links2</c> (or <c>lynx</c>) and go to our <uri
281 neysx 1.72 link="/main/en/mirrors.xml">Gentoo mirror list</uri>. Pick a mirror close to
282     you and open the <path>snapshots/</path> directory. There, download the latest
283 swift 1.83 Portage snapshot by selecting it and pressing <c>D</c>.
284 swift 1.71 </p>
285    
286 neysx 1.72 <pre caption="Browsing the Gentoo mirrorlist">
287 swift 1.71 # <i>links2 http://www.gentoo.org/main/en/mirrors.xml</i>
288     </pre>
289    
290     <p>
291     Now exit your browser by pressing <c>Q</c>. You will now have a Portage snapshot
292     stored in <path>/mnt/gentoo</path>. In the next step, we extract the Portage
293 swift 1.77 snapshot onto your filesystem. Make sure that you use the exact command; the
294     last option is a capital <c>C</c>, not <c>c</c>.
295 swift 1.71 </p>
296    
297     <pre caption="Extracting the Portage snapshot">
298 swift 1.83 <comment>(Substitute &lt;date&gt; with the datestamp of the downloaded snapshot)</comment>
299     # <i>tar -xvjf /mnt/gentoo/portage-&lt;date&gt;.tar.bz2 -C /mnt/gentoo/usr</i>
300 swift 1.71 </pre>
301    
302     </body>
303     </subsection>
304 swift 1.7 </section>
305 swift 1.34
306     <section id="compile_options">
307 swift 1.7 <title>Configuring the Compile Options</title>
308 swift 1.1 <subsection>
309 swift 1.3 <title>Introduction</title>
310 swift 1.1 <body>
311    
312     <p>
313 swift 1.3 To optimize Gentoo, you can set a couple of variables which impact Portage
314     behaviour. All those variables can be set as environment variables (using
315     <c>export</c>) but that isn't permanent. To keep your settings, Portage provides
316     you with <path>/etc/make.conf</path>, a configuration file for Portage. It is
317     this file we will edit now.
318 swift 1.1 </p>
319    
320 dertobi123 1.27 <note>
321     A commented listing of all possible variables can be found in
322 swift 1.34 <path>/mnt/gentoo/etc/make.conf.example</path>. For a successful Gentoo
323 swift 1.29 installation you'll only need to set the variables which are mentioned beneath.
324 dertobi123 1.27 </note>
325    
326 swift 1.3 <p>
327     Fire up your favorite editor (in this guide we use <c>nano</c>) so we can alter
328 swift 1.57 the optimization variables we will discuss hereafter.
329 swift 1.3 </p>
330    
331     <pre caption="Opening /etc/make.conf">
332 swift 1.12 # <i>nano -w /mnt/gentoo/etc/make.conf</i>
333 swift 1.3 </pre>
334    
335     <p>
336 swift 1.57 As you probably noticed, the <path>make.conf.example</path> file is
337 dertobi123 1.27 structured in a generic way: commented lines start with "#", other lines define
338 swift 1.57 variables using the <c>VARIABLE="content"</c> syntax. The <path>make.conf</path>
339     file uses the same syntax. Several of those variables are discussed next.
340 swift 1.3 </p>
341    
342     </body>
343 swift 1.7 </subsection>
344     <subsection>
345 swift 1.3 <title>CHOST</title>
346     <body>
347    
348 swift 1.78 <p>
349 swift 1.90 The <c>CHOST</c> variable declares the target build host for your system. This
350     variable should already be set to the correct value. <brite>Do not edit
351     it</brite> as that might break your system. If the <c>CHOST</c> variable does
352     not look correct to you, you might be using the wrong stage3 tarball.
353 swift 1.78 </p>
354    
355 swift 1.4 </body>
356 swift 1.7 </subsection>
357     <subsection>
358 swift 1.4 <title>CFLAGS and CXXFLAGS</title>
359     <body>
360    
361     <p>
362     The <c>CFLAGS</c> and <c>CXXFLAGS</c> variables define the optimization flags
363     for the <c>gcc</c> C and C++ compiler respectively. Although we define those
364     generally here, you will only have maximum performance if you optimize these
365 swift 1.18 flags for each program separately. The reason for this is because every program
366 swift 1.4 is different.
367     </p>
368    
369     <p>
370     In <path>make.conf</path> you should define the optimization flags you think
371     will make your system the most responsive <e>generally</e>. Don't place
372     experimental settings in this variable; too much optimization can make
373     programs behave bad (crash, or even worse, malfunction).
374     </p>
375    
376     <p>
377     We will not explain all possible optimization options. If you want to know
378 swift 1.43 them all, read the <uri link="http://gcc.gnu.org/onlinedocs/">GNU
379 swift 1.4 Online Manual(s)</uri> or the <c>gcc</c> info page (<c>info gcc</c> -- only
380 swift 1.34 works on a working Linux system). The <path>make.conf.example</path> file
381     itself also contains lots of examples and information; don't forget to read it
382     too.
383 swift 1.4 </p>
384    
385     <p>
386     A first setting is the <c>-march=</c> flag, which specifies the name of the
387     target architecture. Possible options are described in the
388 swift 1.34 <path>make.conf.example</path> file (as comments). For instance, for the x86
389     Athlon XP architecture:
390 swift 1.4 </p>
391    
392     <pre caption="The GCC march setting">
393 neysx 1.81 <comment># AMD64 users who want to use a native 64 bit system should use -march=k8</comment>
394 swift 1.85 <comment>#EM64T users should use -march=nocona</comment>
395 swift 1.4 -march=athlon-xp
396     </pre>
397    
398     <p>
399 neysx 1.48 A second one is the <c>-O</c> flag (that is a capital O, not a zero),
400     which specifies the <c>gcc</c> optimization
401 swift 1.6 class flag. Possible classes are <c>s</c> (for size-optimized),
402 swift 1.36 <c>0</c> (zero - for no optimizations), <c>1</c>, <c>2</c> or <c>3</c> for more
403 swift 1.4 speed-optimization flags (every class has the same flags as the one before, plus
404 swift 1.6 some extras). For instance, for a class-2 optimization:
405 swift 1.4 </p>
406    
407     <pre caption="The GCC O setting">
408     -O2
409     </pre>
410    
411     <p>
412 swift 1.67 Another popular optimization flag is <c>-pipe</c> (use pipes rather than
413     temporary files for communication between the various stages of compilation).
414     </p>
415    
416     <p>
417     Mind you that using <c>-fomit-frame-pointer</c> (which doesn't keep the frame
418     pointer in a register for functions that don't need one) might have serious
419     repercussions on the debugging of applications!
420 swift 1.4 </p>
421    
422     <p>
423     When you define the <c>CFLAGS</c> and <c>CXXFLAGS</c>, you should combine
424     several optimization flags, like in the following example:
425     </p>
426    
427     <pre caption="Defining the CFLAGS and CXXFLAGS variable">
428 swift 1.82 CFLAGS="-march=athlon-xp -pipe -O2" <comment># AMD64 users should use march=k8</comment>
429 swift 1.85 <comment># EM64T users should use march=nocona</comment>
430 swift 1.4 CXXFLAGS="${CFLAGS}" <comment># Use the same settings for both variables</comment>
431     </pre>
432    
433     </body>
434 swift 1.7 </subsection>
435     <subsection>
436 swift 1.4 <title>MAKEOPTS</title>
437     <body>
438    
439 swift 1.6 <p>
440     With <c>MAKEOPTS</c> you define how many parallel compilations should occur when
441 swift 1.62 you install a package. A good choice is the number of CPUs in your system plus
442     one, but this guideline isn't always perfect.
443 swift 1.6 </p>
444    
445     <pre caption="MAKEOPTS for a regular, 1-CPU system">
446     MAKEOPTS="-j2"
447     </pre>
448    
449 swift 1.4 </body>
450 swift 1.7 </subsection>
451     <subsection>
452 swift 1.6 <title>Ready, Set, Go!</title>
453 swift 1.4 <body>
454 swift 1.3
455 swift 1.6 <p>
456 neysx 1.61 Update your <path>/mnt/gentoo/etc/make.conf</path> to your own preference and
457     save (<c>nano</c> users would hit <c>Ctrl-X</c>). You are now ready to continue
458 swift 1.57 with <uri link="?part=1&amp;chap=6">Installing the Gentoo Base System</uri>.
459 swift 1.8 </p>
460 swift 1.6
461     </body>
462 swift 1.1 </subsection>
463     </section>
464 swift 1.7 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20