/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-system.xml
Gentoo

Contents of /xml/htdocs/doc/en/handbook/hb-install-system.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.105 - (hide annotations) (download) (as text)
Mon Feb 12 21:55:42 2007 UTC (7 years, 9 months ago) by nightmorph
Branch: MAIN
Changes since 1.104: +23 -4 lines
File MIME type: application/xml
added bind mount /sys for bug 166069

1 swift 1.26 <?xml version='1.0' encoding='UTF-8'?>
2     <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3    
4 swift 1.6 <!-- The content of this document is licensed under the CC-BY-SA license -->
5 nightmorph 1.93 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 swift 1.6
7 nightmorph 1.105 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-system.xml,v 1.104 2006/11/02 09:50:33 neysx Exp $ -->
8 swift 1.11
9 swift 1.3 <sections>
10 swift 1.56
11 neysx 1.101 <abstract>
12     After installing and configuring a stage3, the eventual result is that you
13     have a Gentoo base system at your disposal. This chapter describes how
14     to progress to that state.
15     </abstract>
16    
17 nightmorph 1.105 <version>7.6</version>
18     <date>2007-02-12</date>
19 swift 1.56
20 swift 1.1 <section>
21 swift 1.3 <title>Chrooting</title>
22 swift 1.1 <subsection>
23 swift 1.2 <title>Optional: Selecting Mirrors</title>
24     <body>
25    
26     <p>
27 swift 1.70 In order to download source code quickly it is recommended to select a fast
28     mirror. Portage will look in your <path>make.conf</path> file for the
29     GENTOO_MIRRORS variable and use the mirrors listed therein. You can surf to
30     our <uri link="/main/en/mirrors.xml">mirror list</uri> and search
31     for a mirror (or mirrors) close to you (as those are most frequently the
32     fastest ones), but we provide a nice tool called <c>mirrorselect</c> which
33     provides you with a nice interface to select the mirrors you want.
34     </p>
35    
36     <pre caption="Using mirrorselect for the GENTOO_MIRRORS variable">
37     # <i>mirrorselect -i -o &gt;&gt; /mnt/gentoo/etc/make.conf</i>
38     </pre>
39    
40 swift 1.71 <warn>
41     Do not select any IPv6 mirrors. Our stages currently do not support IPv6.
42     </warn>
43    
44 swift 1.70 <p>
45     A second important setting is the SYNC setting in <path>make.conf</path>. This
46     variable contains the rsync server you want to use when updating your Portage
47     tree (the collection of ebuilds, scripts containing all the information Portage
48     needs to download and install software). Although you can manually enter a SYNC
49     server for yourself, <c>mirrorselect</c> can ease that operation for you:
50 swift 1.2 </p>
51    
52 swift 1.70 <pre caption="Selecting an rsync mirror using mirrorselect">
53     # <i>mirrorselect -i -r -o &gt;&gt; /mnt/gentoo/etc/make.conf</i>
54 swift 1.2 </pre>
55    
56     <p>
57 swift 1.70 After running <c>mirrorselect</c> it is adviseable to double-check the settings
58     in <path>/mnt/gentoo/etc/make.conf</path> !
59 swift 1.2 </p>
60    
61     </body>
62 swift 1.3 </subsection>
63     <subsection>
64 swift 1.5 <title>Copy DNS Info</title>
65     <body>
66    
67     <p>
68 swift 1.24 One thing still remains to be done before we enter the new environment and that
69     is copying over the DNS information in <path>/etc/resolv.conf</path>. You need
70 swift 1.5 to do this to ensure that networking still works even after entering the new
71     environment. <path>/etc/resolv.conf</path> contains the nameservers for your
72     network.
73     </p>
74    
75     <pre caption="Copy over DNS information">
76 swift 1.35 <comment>(The "-L" option is needed to make sure we don't copy a symbolic link)</comment>
77     # <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</i>
78 swift 1.18 </pre>
79    
80     </body>
81     </subsection>
82 nightmorph 1.105 <subsection test="not(func:keyval('arch')='IA64')">
83 neysx 1.88 <title>Mounting the /proc and /dev Filesystems</title>
84 swift 1.43 <body>
85    
86     <p>
87     Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to
88 neysx 1.88 allow the installation to use the kernel-provided information within the
89     chrooted environment, and then mount-bind the <path>/dev</path> filesystem.
90 swift 1.43 </p>
91    
92 neysx 1.88 <pre caption="Mounting /proc and /dev">
93 swift 1.43 # <i>mount -t proc none /mnt/gentoo/proc</i>
94 neysx 1.88 # <i>mount -o bind /dev /mnt/gentoo/dev</i>
95 swift 1.43 </pre>
96    
97     </body>
98     </subsection>
99 nightmorph 1.105 <subsection test="func:keyval('arch')='IA64'">
100     <title>Mounting the /proc, /sys and /dev Filesystems</title>
101     <body>
102    
103     <p>
104     Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to
105     allow the installation to use the kernel-provided information within the
106     chrooted environment, and then mount-bind the <path>/dev</path> and
107     <path>/sys</path> filesystems.
108     </p>
109    
110     <pre caption="Mounting /proc /sys and /dev">
111     # <i>mount -t proc none /mnt/gentoo/proc</i>
112     # <i>mount -o bind /dev /mnt/gentoo/dev</i>
113     # <i>mount -o bind /sys /mnt/gentoo/sys</i>
114     </pre>
115    
116     </body>
117     </subsection>
118 swift 1.43 <subsection>
119 swift 1.2 <title>Entering the new Environment</title>
120 swift 1.1 <body>
121    
122     <p>
123 swift 1.19 Now that all partitions are initialized and the base environment
124 swift 1.1 installed, it is time to enter our new installation environment by
125 swift 1.9 <e>chrooting</e> into it. This means that we change from the current
126 swift 1.72 installation environment (Installation CD or other installation medium) to your
127 swift 1.19 installation system (namely the initialized partitions).
128 swift 1.1 </p>
129    
130     <p>
131     This chrooting is done in three steps. First we will change the root
132 swift 1.2 from <path>/</path> (on the installation medium) to <path>/mnt/gentoo</path>
133     (on your partitions) using <c>chroot</c>. Then we will create a new environment
134     using <c>env-update</c>, which essentially creates environment variables.
135 swift 1.1 Finally, we load those variables into memory using <c>source</c>.
136     </p>
137    
138     <pre caption = "Chrooting into the new environment">
139     # <i>chroot /mnt/gentoo /bin/bash</i>
140     # <i>env-update</i>
141 neysx 1.92 >> Regenerating /etc/ld.so.cache...
142 swift 1.1 # <i>source /etc/profile</i>
143 rane 1.87 # <i>export PS1="(chroot) $PS1"</i>
144 swift 1.1 </pre>
145    
146     <p>
147     Congratulations! You are now inside your own Gentoo Linux environment.
148 swift 1.10 Of course it is far from finished, which is why the installation still
149 swift 1.1 has some sections left :-)
150     </p>
151    
152     </body>
153 swift 1.3 </subsection>
154 swift 1.85 </section>
155    
156     <section>
157     <title>Configuring Portage</title>
158 swift 1.3 <subsection>
159 swift 1.64 <title>Updating the Portage tree</title>
160 swift 1.2 <body>
161    
162     <p>
163 swift 1.69 You should now update your Portage tree to the latest version. <c>emerge
164     --sync</c> does this for you.
165 swift 1.2 </p>
166    
167 dertobi123 1.40 <pre caption="Updating the Portage tree">
168 cam 1.50 # <i>emerge --sync</i>
169 neysx 1.78 <comment>(If you're using a slow terminal like some framebuffers or a serial
170     console, you can add the --quiet option to speed up this process:)</comment>
171     # <i>emerge --sync --quiet</i>
172 swift 1.13 </pre>
173    
174     <p>
175 swift 1.75 If you are behind a firewall that blocks rsync traffic, you can use
176     <c>emerge-webrsync</c> which will download and install a portage snapshot for
177     you.
178     </p>
179    
180     <p>
181 swift 1.13 If you are warned that a new Portage version is available and that you should
182 rane 1.94 update Portage, you should do it now using <c>emerge portage</c> command.
183 swift 1.13 </p>
184 swift 1.8
185     </body>
186     </subsection>
187 swift 1.72 <subsection>
188     <title>Choosing the Right Profile</title>
189     <body>
190    
191     <p>
192     First, a small definition is in place.
193     </p>
194    
195     <p>
196     A profile is a building block for any Gentoo system. Not only does it specify
197     default values for CHOST, CFLAGS and other important variables, it also locks
198     the system to a certain range of package versions. This is all maintained by the
199     Gentoo developers.
200     </p>
201    
202 nightmorph 1.102 <p test="contains('Alpha x86', func:keyval('arch'))">
203     Previously, such a profile was barely touched by the user. However, <keyval
204     id="arch"/> users can choose between two profiles, one for a 2.4 kernel and one
205 neysx 1.79 for a 2.6 kernel. This requirement has been imposed to improve the integration
206 nightmorph 1.102 of the 2.6 kernels.
207     </p>
208    
209     <p test="contains('AMD64 arm HPPA IA64 MIPS PPC PPC64 SPARC', func:keyval('arch'))">
210     Previously, such a profile was untouched by the users. However, there may be
211     certain situations in which you may decide a profile change is necessary.
212 swift 1.72 </p>
213    
214     <p>
215 neysx 1.79 You can see what profile you are currently using with the following command:
216 swift 1.72 </p>
217    
218     <pre caption="Verifying system profile">
219 neysx 1.79 # <i>ls -FGg /etc/make.profile</i>
220 nightmorph 1.98 lrwxrwxrwx 1 48 Apr 8 18:51 /etc/make.profile -> ../usr/portage/profiles/default-linux/x86/2006.1/
221 swift 1.72 </pre>
222    
223     <p>
224 nightmorph 1.102 The default profile will provide you with a Linux 2.6-based system. This is the
225     recommended default, but you have the option of choosing another profile too.
226 neysx 1.80 </p>
227    
228     <p>
229 nightmorph 1.99 There are also <c>desktop</c> and <c>server</c> subprofiles available for some
230     architectures. Look inside the <path>2006.1/</path> profile to see if there is
231     one available for your architecture. You may wish to view the <c>desktop</c>
232     profile's <path>make.defaults</path> to determine if it fits your needs.
233     </p>
234    
235 neysx 1.104 <p test="func:keyval('arch')='AMD64'">
236 nightmorph 1.103 If you want to have a pure 64-bit environment, with no 32-bit applications or
237     libraries, you should use a non-multilib profile:
238     </p>
239    
240 neysx 1.104 <pre test="func:keyval('arch')='AMD64'" caption="Switching to a non-multilib profile">
241 nightmorph 1.103 # <i>ln -snf /usr/portage/profiles/default-linux/amd64/2006.1/no-multilib /etc/make.profile</i>
242     </pre>
243    
244 nightmorph 1.99 <p>
245 neysx 1.80 Some users may wish to install a system based on the older Linux 2.4 profile.
246     If you have good reason to do this, then you should first check that an
247     additional profile exists. On x86, we can do this with the following command:
248 swift 1.72 </p>
249    
250     <pre caption="Finding out if an additional profile exists">
251 swift 1.86 # <i>ls -d /usr/portage/profiles/default-linux/x86/no-nptl/2.4</i>
252     /usr/portage/profiles/default-linux/x86/no-nptl/2.4
253 swift 1.72 </pre>
254    
255     <p>
256 neysx 1.80 The above example shows that the additional 2.4 profile exists (i.e. it didn't
257     complain about missing file or directory). It is recommended that you stay with
258 nightmorph 1.102 the default, but if you wish to switch, you can do so as follows:
259 swift 1.72 </p>
260    
261 neysx 1.79 <pre caption="Switching to a 2.4 profile">
262     <comment>(Make sure you use the right architecture, the example below is for x86)</comment>
263 swift 1.86 # <i>ln -snf /usr/portage/profiles/default-linux/x86/no-nptl/2.4 /etc/make.profile</i>
264 neysx 1.79 <comment>(List the files in the 2.4 profile)</comment>
265     # <i>ls -FGg /etc/make.profile/</i>
266     total 12
267     -rw-r--r-- 1 939 Dec 10 14:06 packages
268     -rw-r--r-- 1 347 Dec 3 2004 parent
269     -rw-r--r-- 1 573 Dec 3 2004 virtuals
270 swift 1.72 </pre>
271    
272 nightmorph 1.102 <p test="func:keyval('arch')='PPC'">
273 nightmorph 1.99 For ppc, there are a number of new profiles provided with 2006.1:
274 swift 1.83 </p>
275    
276 nightmorph 1.102 <pre test="func:keyval('arch')='PPC'" caption="PPC Profiles">
277 josejx 1.91 <comment>(Generic PPC profile, for all PPC machines, minimal)</comment>
278 nightmorph 1.98 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc32/2006.1 /etc/make.profile</i>
279 swift 1.83 <comment>(G3 profile)</comment>
280 nightmorph 1.98 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc32/2006.1/G3 /etc/make.profile</i>
281 swift 1.83 <comment>(G3 Pegasos profile)</comment>
282 nightmorph 1.98 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc32/2006.1/G3/Pegasos/ /etc/make.profile</i>
283 swift 1.83 <comment>(G4 (Altivec) profile)</comment>
284 nightmorph 1.98 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc32/2006.1/G4 /etc/make.profile</i>
285 fox2mike 1.90 <comment>(G4 (Altivec) Pegasos profile)</comment>
286 nightmorph 1.98 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc32/2006.1/G4/Pegasos/ /etc/make.profile</i>
287 swift 1.83 </pre>
288    
289 nightmorph 1.102 <p test="func:keyval('arch')='PPC64'">
290 nightmorph 1.99 For ppc64, there are a number of new profiles provided with 2006.1:
291 swift 1.83 </p>
292    
293 nightmorph 1.102 <pre test="func:keyval('arch')='PPC64'" caption="PPC64 Profiles">
294 swift 1.83 <comment>(Generic 64bit userland PPC64 profile, for all PPC64 machines)</comment>
295 nightmorph 1.98 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc64/2006.1/64bit-userland /etc/make.profile</i>
296 swift 1.83 <comment>(Generic 32bit userland PPC64 profile, for all PPC64 machines)</comment>
297 nightmorph 1.98 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc64/2006.1/32bit-userland /etc/make.profile</i>
298 swift 1.83 <comment>(Each type of userland has sub profiles as follows, with (userland) replaced with the chosen userland from above)</comment>
299     <comment>(970 profile for JS20)</comment>
300 nightmorph 1.98 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc64/2006.1/(userland)/970 /etc/make.profile</i>
301 swift 1.83 <comment>(G5 profile)</comment>
302 nightmorph 1.98 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc64/2006.1/(userland)/970/pmac /etc/make.profile</i>
303 swift 1.83 <comment>(POWER3 profile)</comment>
304 nightmorph 1.98 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc64/2006.1/(userland)/power3 /etc/make.profile</i>
305 swift 1.83 <comment>(POWER4 profile)</comment>
306 nightmorph 1.98 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc64/2006.1/(userland)/power4 /etc/make.profile</i>
307 swift 1.83 <comment>(POWER5 profile)</comment>
308 nightmorph 1.98 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/ppc64/2006.1/(userland)/power5 /etc/make.profile</i>
309 swift 1.83 <comment>(The multilib profile is not stable as of this release.)</comment>
310     </pre>
311    
312 swift 1.72 </body>
313     </subsection>
314 swift 1.28 <subsection id="configure_USE">
315 swift 1.21 <title>Configuring the USE variable</title>
316     <body>
317    
318     <p>
319     <c>USE</c> is one of the most powerful variables Gentoo provides to its users.
320     Several programs can be compiled with or without optional support for certain
321     items. For instance, some programs can be compiled with gtk-support, or with
322     qt-support. Others can be compiled with or without SSL support. Some programs
323     can even be compiled with framebuffer support (svgalib) instead of X11 support
324     (X-server).
325     </p>
326    
327     <p>
328     Most distributions compile their packages with support for as much as possible,
329     increasing the size of the programs and startup time, not to mention an enormous
330 swift 1.24 amount of dependencies. With Gentoo you can define what options a package
331 swift 1.21 should be compiled with. This is where <c>USE</c> comes into play.
332     </p>
333    
334     <p>
335     In the <c>USE</c> variable you define keywords which are mapped onto
336     compile-options. For instance, <e>ssl</e> will compile ssl-support in the
337 nightmorph 1.100 programs that support it. <e>-X</e> will remove X-server support (note the
338     minus sign in front). <e>gnome gtk -kde -qt3 -qt4</e> will compile your
339     programs with gnome (and gtk) support, and not with kde (and qt) support,
340     making your system fully tweaked for GNOME.
341 swift 1.21 </p>
342    
343     <p>
344 swift 1.68 The default <c>USE</c> settings are placed in the <path>make.defaults</path>
345     files of your profile. You will find <path>make.defaults</path> files in the
346     directory which <path>/etc/make.profile</path> points to and all parent
347     directories as well. The default <c>USE</c> setting is the sum of all <c>USE</c>
348     settings in all <path>make.defaults</path> files. What you place in
349 swift 1.21 <path>/etc/make.conf</path> is calculated against these defaults settings. If
350     you add something to the <c>USE</c> setting, it is added to the default list. If
351     you remove something from the <c>USE</c> setting (by placing a minus sign in
352     front of it) it is removed from the default list (if it was in the default list
353     at all). <e>Never</e> alter anything inside the <path>/etc/make.profile</path>
354     directory; it gets overwritten when you update Portage!
355     </p>
356    
357     <p>
358     A full description on <c>USE</c> can be found in the second part of the Gentoo
359 neysx 1.52 Handbook, <uri link="?part=2&amp;chap=2">USE flags</uri>. A full description on
360     the available USE flags can be found on your system in
361 swift 1.23 <path>/usr/portage/profiles/use.desc</path>.
362     </p>
363    
364     <pre caption="Viewing available USE flags">
365     # <i>less /usr/portage/profiles/use.desc</i>
366 swift 1.45 <comment>(You can scroll using your arrow keys, exit by pressing 'q')</comment>
367 swift 1.23 </pre>
368    
369     <p>
370     As an example we show a <c>USE</c> setting for a KDE-based system with DVD, ALSA
371     and CD Recording support:
372 swift 1.21 </p>
373    
374     <pre caption="Opening /etc/make.conf">
375     # <i>nano -w /etc/make.conf</i>
376     </pre>
377    
378     <pre caption="USE setting">
379 nightmorph 1.100 USE="-gtk -gnome qt3 qt4 kde dvd alsa cdr"
380 swift 1.21 </pre>
381    
382 swift 1.69 </body>
383     </subsection>
384     <subsection>
385     <title>Optional: GLIBC Locales</title>
386     <body>
387    
388 dertobi123 1.53 <p>
389 rane 1.95 You will probably only use one or maybe two locales on your system. You can
390 rane 1.96 specify locales you will need in <path>/etc/locale.gen</path>.
391 dertobi123 1.53 </p>
392    
393 rane 1.95 <pre caption="Opening /etc/locale.gen">
394     # <i>nano -w /etc/locale.gen</i>
395 dertobi123 1.53 </pre>
396    
397     <p>
398 rane 1.95 The following locales are an example to get both English (United States) and
399     German (Germany) with the accompanying character formats (like UTF-8).
400 dertobi123 1.53 </p>
401    
402 rane 1.95 <pre caption="Specify your locales">
403     en_US ISO-8859-1
404     en_US.UTF-8 UTF-8
405     de_DE ISO-8859-1
406     de_DE@euro ISO-8859-15
407 bennyc 1.60 </pre>
408    
409 swift 1.67 <p>
410 rane 1.95 The next step is to run <c>locale-gen</c>. It will generate all the locales you
411     have specified in the <path>/etc/locale.gen</path> file.
412 swift 1.67 </p>
413    
414 rane 1.97 <note>
415     <c>locale-gen</c> is available in <c>glibc-2.3.6-r4</c> and newer. If you have
416     an older version of glibc, you should update it now.
417     </note>
418    
419 swift 1.1 <p>
420 swift 1.85 Now continue with <uri link="?part=1&amp;chap=7">Configuring the Kernel</uri>.
421 swift 1.28 </p>
422    
423     </body>
424     </subsection>
425     </section>
426 swift 1.3 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20