/[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.95 - (show annotations) (download) (as text)
Tue Feb 28 01:54:31 2006 UTC (11 years, 10 months ago) by fox2mike
Branch: MAIN
Changes since 1.94: +9 -3 lines
File MIME type: application/xml
Make it clear that you don't have stages for x86 on the CD (LiveCD). Clarification fix for #124315

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/2.5 -->
6
7 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-stage.xml,v 1.94 2006/02/27 00:55:35 fox2mike Exp $ -->
8
9 <sections>
10
11 <version>2.9</version>
12 <date>2006-02-28</date>
13
14 <section>
15 <title>Installing a Stage Tarball</title>
16 <subsection>
17 <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 Fri Mar 29 16:21:18 CEST 2005
32 </pre>
33
34 <p>
35 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 and <b>Y</b>ear). For instance, to set the date to March 29th, 16:21 in the
38 year 2005:
39 </p>
40
41 <pre caption="Setting the date/time">
42 # <i>date 032916212005</i>
43 </pre>
44
45 </body>
46 </subsection>
47 <subsection>
48 <title>Making your Choice</title>
49 <body>
50
51 <p>
52 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 tarball from the Internet or, if you are booted from one of the Gentoo
55 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 </p>
61
62 <ul>
63 <li><uri link="#doc_chap2">Default: Using a Stage from the Internet</uri></li>
64 <li>
65 <uri link="#doc_chap3">Alternative: Using a Stage from the Installation CD</uri>
66 </li>
67 </ul>
68
69 </body>
70 </subsection>
71 </section>
72 <section>
73 <title>Default: Using a Stage from the Internet</title>
74 <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 download a stage. If you have <c>links</c> available, then you can immediately
90 surf to <uri link="/main/en/mirrors.xml">the Gentoo mirrorlist</uri> and
91 choose a mirror close to you.
92 </p>
93
94 <p>
95 If you don't have <c>links</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>links</c> at your disposal.
107 </p>
108
109 <p>
110 Pick the <path>releases/</path> directory, followed by your architecture (for
111 instance <path>x86/</path>) and the Gentoo version (<path>2006.0/</path>) to
112 finish up with the <path>stages/</path> directory. There you should see all
113 available stage files for your architecture (they might be stored within
114 subdirectories named to the individual subarchitectures). Select one and press
115 <c>D</c> to download. When you're finished, press <c>Q</c> to quit the browser.
116 </p>
117
118 <pre caption="Surfing to the mirror listing with links">
119 # <i>links http://www.gentoo.org/main/en/mirrors.xml</i>
120
121 <comment>(If you need proxy support with links:)</comment>
122 # <i>links -http-proxy proxy.server.com:8080 http://www.gentoo.org/main/en/mirrors.xml</i>
123 </pre>
124
125 <p>
126 Make sure you download a <b>stage3</b> tarball - installations using a stage1
127 or stage2 tarball are not supported anymore.
128 </p>
129
130 <p>
131 If you want to check the integrity of the downloaded stage tarball, use
132 <c>md5sum</c> and compare the output with the MD5 checksum provided on the
133 mirror. For instance, to check the validity of the x86 stage tarball:
134 </p>
135
136 <pre caption="Example checking integrity of a stage tarball">
137 # <i>md5sum -c stage3-x86-2006.0.tar.bz2.DIGESTS</i>
138 stage3-x86-2006.0.tar.bz2: OK
139 </pre>
140
141 </body>
142 </subsection>
143 <subsection>
144 <title>Unpacking the Stage Tarball</title>
145 <body>
146
147 <p>
148 Now unpack your downloaded stage onto your system. We use <c>tar</c> to proceed
149 as it is the easiest method:
150 </p>
151
152 <pre caption="Unpacking the stage">
153 # <i>tar xvjpf stage3-*.tar.bz2</i>
154 </pre>
155
156 <p>
157 Make sure that you use the same options (<c>xvjpf</c>). The <c>x</c> stands for
158 <e>Extract</e>, the <c>v</c> for <e>Verbose</e> to see what happens during the
159 extraction process (optional), the <c>j</c> for <e>Decompress with bzip2</e>,
160 the <c>p</c> for <e>Preserve permissions</e> and the <c>f</c> to denote that we
161 want to extract a file, not standard input.
162 </p>
163
164 <note>
165 Some architectures (e.g. MIPS) Installation CDs and boot images rely upon the
166 <c>tar</c> built into BusyBox which doesn't currently support the <c>v</c>
167 option. Use the <c>xjpf</c> options instead.
168 </note>
169
170 <p>
171 Now that the stage is installed, continue with <uri
172 link="#installing_portage">Installing Portage</uri>.
173 </p>
174
175 </body>
176 </subsection>
177 </section>
178 <section>
179 <title>Alternative: Using a Stage from the Installation CD</title>
180 <subsection>
181 <title>Extracting the Stage Tarball</title>
182 <body>
183
184 <impo>
185 If you are on x86 and using the Installer LiveCD, you will <e>not</e> have
186 stages on your CD. You will have to follow instructions for <uri
187 link="#doc_chap2">Using a Stage Tarball from the Internet</uri>.
188 </impo>
189
190 <p>
191 The stages on the CD reside in the <path>/mnt/cdrom/stages</path> directory. To
192 see a listing of available stages, use <c>ls</c>:
193 </p>
194
195 <pre caption="List all available stages">
196 # <i>ls /mnt/cdrom/stages</i>
197 </pre>
198
199 <p>
200 If the system replies with an error, you may need to mount the CD-ROM first:
201 </p>
202
203 <pre caption="Mounting the CD-ROM">
204 # <i>ls /mnt/cdrom/stages</i>
205 ls: /mnt/cdrom/stages: No such file or directory
206 # <i>mount /dev/cdroms/cdrom0 /mnt/cdrom</i>
207 # <i>ls /mnt/cdrom/stages</i>
208 </pre>
209
210 <p>
211 Now go into your Gentoo mountpoint (usually <path>/mnt/gentoo</path>):
212 </p>
213
214 <pre caption="Changing directory to /mnt/gentoo">
215 # <i>cd /mnt/gentoo</i>
216 </pre>
217
218 <p>
219 We will now extract the stage tarball of your choice. We will do this with
220 <c>tar</c>. Make sure you use the same options (<c>xvjpf</c>). The <c>v</c>
221 argument is optional and not supported in some <c>tar</c> versions. In the
222 next example, we extract the stage tarball
223 <path>stage3-&lt;subarch&gt;-2006.0.tar.bz2</path>. Be sure to substitute
224 the tarball filename with your stage.
225 </p>
226
227 <pre caption="Extracting the stage tarball">
228 # <i>tar xvjpf /mnt/cdrom/stages/stage3-&lt;subarch&gt;-2006.0.tar.bz2</i>
229 </pre>
230
231 <p>
232 Now that the stage is installed, continue with <uri
233 link="#installing_portage">Installing Portage</uri>.
234 </p>
235
236 </body>
237 </subsection>
238 </section>
239 <section id="installing_portage">
240 <title>Installing Portage</title>
241 <subsection>
242 <title>Unpacking a Portage Snapshot</title>
243 <body>
244
245 <p>
246 You now have to install a Portage snapshot, a collection of files that inform
247 Portage what software titles you can install, which profiles are available, etc.
248 </p>
249
250 </body>
251 </subsection>
252 <subsection id="installing_from_Internet">
253 <title>Download and Install a Portage Snapshot</title>
254 <body>
255
256 <p>
257 Go to the mountpoint where you mounted your filesystem (most likely
258 <path>/mnt/gentoo</path>):
259 </p>
260
261 <pre caption="Going to the Gentoo mountpoint">
262 # <i>cd /mnt/gentoo</i>
263 </pre>
264
265 <p>
266 Fire up <c>links</c> (or <c>lynx</c>) and go to our <uri
267 link="/main/en/mirrors.xml">Gentoo mirror list</uri>. Pick a mirror close to
268 you and open the <path>snapshots/</path> directory. There, download the latest
269 Portage snapshot by selecting it and pressing <c>D</c>.
270 </p>
271
272 <pre caption="Browsing the Gentoo mirrorlist">
273 # <i>links http://www.gentoo.org/main/en/mirrors.xml</i>
274 </pre>
275
276 <p>
277 Now exit your browser by pressing <c>Q</c>. You will now have a Portage snapshot
278 stored in <path>/mnt/gentoo</path>. In the next step, we extract the Portage
279 snapshot onto your filesystem. Make sure that you use the exact command; the
280 last option is a capital <c>C</c>, not <c>c</c>.
281 </p>
282
283 <pre caption="Extracting the Portage snapshot">
284 <comment>(Substitute &lt;date&gt; with the datestamp of the downloaded snapshot)</comment>
285 # <i>tar xvjf /mnt/gentoo/portage-&lt;date&gt;.tar.bz2 -C /mnt/gentoo/usr</i>
286 </pre>
287
288 </body>
289 </subsection>
290 </section>
291
292 <section id="compile_options">
293 <title>Configuring the Compile Options</title>
294 <subsection>
295 <title>Introduction</title>
296 <body>
297
298 <p>
299 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 </p>
305
306 <note>
307 A commented listing of all possible variables can be found in
308 <path>/mnt/gentoo/etc/make.conf.example</path>. For a successful Gentoo
309 installation you'll only need to set the variables which are mentioned beneath.
310 </note>
311
312 <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 # <i>nano -w /mnt/gentoo/etc/make.conf</i>
319 </pre>
320
321 <p>
322 As you probably noticed, the <path>make.conf.example</path> file is
323 structured in a generic way: commented lines start with "#", other lines define
324 variables using the <c>VARIABLE="content"</c> syntax. The <path>make.conf</path>
325 file uses the same syntax. Several of those variables are discussed next.
326 </p>
327
328 </body>
329 </subsection>
330 <subsection>
331 <title>CHOST</title>
332 <body>
333
334 <p>
335 The <c>CHOST</c> variable declares the target build host for your system. This
336 variable should already be set to the correct value. <brite>Do not edit
337 it</brite> as that might break your system. If the <c>CHOST</c> variable does
338 not look correct to you, you might be using the wrong stage3 tarball.
339 </p>
340
341 </body>
342 </subsection>
343 <subsection>
344 <title>CFLAGS and CXXFLAGS</title>
345 <body>
346
347 <p>
348 The <c>CFLAGS</c> and <c>CXXFLAGS</c> variables define the optimization flags
349 for the <c>gcc</c> C and C++ compiler respectively. Although we define those
350 generally here, you will only have maximum performance if you optimize these
351 flags for each program separately. The reason for this is because every program
352 is different.
353 </p>
354
355 <p>
356 In <path>make.conf</path> you should define the optimization flags you think
357 will make your system the most responsive <e>generally</e>. Don't place
358 experimental settings in this variable; too much optimization can make
359 programs behave bad (crash, or even worse, malfunction).
360 </p>
361
362 <p>
363 We will not explain all possible optimization options. If you want to know
364 them all, read the <uri link="http://gcc.gnu.org/onlinedocs/">GNU
365 Online Manual(s)</uri> or the <c>gcc</c> info page (<c>info gcc</c> -- only
366 works on a working Linux system). The <path>make.conf.example</path> file
367 itself also contains lots of examples and information; don't forget to read it
368 too.
369 </p>
370
371 <p>
372 A first setting is the <c>-march=</c> flag, which specifies the name of the
373 target architecture. Possible options are described in the
374 <path>make.conf.example</path> file (as comments). For instance, for the x86
375 Athlon XP architecture:
376 </p>
377
378 <pre caption="The GCC march setting">
379 <comment># AMD64 users who want to use a native 64 bit system should use -march=k8</comment>
380 <comment>#EM64T users should use -march=nocona</comment>
381 -march=athlon-xp
382 </pre>
383
384 <p>
385 A second one is the <c>-O</c> flag (that is a capital O, not a zero),
386 which specifies the <c>gcc</c> optimization
387 class flag. Possible classes are <c>s</c> (for size-optimized),
388 <c>0</c> (zero - for no optimizations), <c>1</c>, <c>2</c> or <c>3</c> for more
389 speed-optimization flags (every class has the same flags as the one before, plus
390 some extras). For instance, for a class-2 optimization:
391 </p>
392
393 <pre caption="The GCC O setting">
394 -O2
395 </pre>
396
397 <p>
398 Another popular optimization flag is <c>-pipe</c> (use pipes rather than
399 temporary files for communication between the various stages of compilation).
400 </p>
401
402 <p>
403 Mind you that using <c>-fomit-frame-pointer</c> (which doesn't keep the frame
404 pointer in a register for functions that don't need one) might have serious
405 repercussions on the debugging of applications!
406 </p>
407
408 <p>
409 When you define the <c>CFLAGS</c> and <c>CXXFLAGS</c>, you should combine
410 several optimization flags, like in the following example:
411 </p>
412
413 <pre caption="Defining the CFLAGS and CXXFLAGS variable">
414 CFLAGS="-march=athlon-xp -pipe -O2" <comment># AMD64 users should use march=k8</comment>
415 <comment># EM64T users should use march=nocona</comment>
416 CXXFLAGS="${CFLAGS}" <comment># Use the same settings for both variables</comment>
417 </pre>
418
419 </body>
420 </subsection>
421 <subsection>
422 <title>MAKEOPTS</title>
423 <body>
424
425 <p>
426 With <c>MAKEOPTS</c> you define how many parallel compilations should occur when
427 you install a package. A good choice is the number of CPUs in your system plus
428 one, but this guideline isn't always perfect.
429 </p>
430
431 <pre caption="MAKEOPTS for a regular, 1-CPU system">
432 MAKEOPTS="-j2"
433 </pre>
434
435 </body>
436 </subsection>
437 <subsection>
438 <title>Ready, Set, Go!</title>
439 <body>
440
441 <p>
442 Update your <path>/mnt/gentoo/etc/make.conf</path> to your own preference and
443 save (<c>nano</c> users would hit <c>Ctrl-X</c>). You are now ready to continue
444 with <uri link="?part=1&amp;chap=6">Installing the Gentoo Base System</uri>.
445 </p>
446
447 </body>
448 </subsection>
449 </section>
450 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20