/[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.122 - (hide annotations) (download) (as text)
Sun Apr 22 10:45:58 2012 UTC (2 years, 5 months ago) by swift
Branch: MAIN
Changes since 1.121: +4 -9 lines
File MIME type: application/xml
Fix bug #395515 - Do not refer to 2.6 kernel in default profile

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 swift 1.122 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-system.xml,v 1.121 2012/04/08 20:20:55 cam 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 swift 1.122 <version>14</version>
18     <date>2012-04-22</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 jkt 1.119 provides you with a nice interface to select the mirrors you want. Just
34     navigate to the mirrors of choice and press spacebar to select one or more
35     mirrors.
36 swift 1.70 </p>
37    
38     <pre caption="Using mirrorselect for the GENTOO_MIRRORS variable">
39     # <i>mirrorselect -i -o &gt;&gt; /mnt/gentoo/etc/make.conf</i>
40     </pre>
41    
42     <p>
43     A second important setting is the SYNC setting in <path>make.conf</path>. This
44     variable contains the rsync server you want to use when updating your Portage
45     tree (the collection of ebuilds, scripts containing all the information Portage
46     needs to download and install software). Although you can manually enter a SYNC
47     server for yourself, <c>mirrorselect</c> can ease that operation for you:
48 swift 1.2 </p>
49    
50 swift 1.70 <pre caption="Selecting an rsync mirror using mirrorselect">
51     # <i>mirrorselect -i -r -o &gt;&gt; /mnt/gentoo/etc/make.conf</i>
52 swift 1.2 </pre>
53    
54     <p>
55 swift 1.70 After running <c>mirrorselect</c> it is adviseable to double-check the settings
56     in <path>/mnt/gentoo/etc/make.conf</path> !
57 swift 1.2 </p>
58    
59 nightmorph 1.113 <note>
60     If you want to manually set a SYNC server in <path>make.conf</path>, you should
61     check out the <uri link="/main/en/mirrors-rsync.xml">community mirrors
62     list</uri> for the mirrors closest to you. We recommend choosing a
63     <e>rotation</e>, such as <c>rsync.us.gentoo.org</c>, rather than choosing a
64     single mirror. This helps spread out the load and provides a failsafe in case a
65     specific mirror is offline.
66     </note>
67    
68 swift 1.2 </body>
69 swift 1.3 </subsection>
70     <subsection>
71 swift 1.5 <title>Copy DNS Info</title>
72     <body>
73    
74     <p>
75 swift 1.24 One thing still remains to be done before we enter the new environment and that
76     is copying over the DNS information in <path>/etc/resolv.conf</path>. You need
77 swift 1.5 to do this to ensure that networking still works even after entering the new
78     environment. <path>/etc/resolv.conf</path> contains the nameservers for your
79     network.
80     </p>
81    
82     <pre caption="Copy over DNS information">
83 swift 1.35 <comment>(The "-L" option is needed to make sure we don't copy a symbolic link)</comment>
84 nightmorph 1.107 # <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/</i>
85 swift 1.18 </pre>
86    
87     </body>
88     </subsection>
89 nightmorph 1.105 <subsection test="not(func:keyval('arch')='IA64')">
90 neysx 1.88 <title>Mounting the /proc and /dev Filesystems</title>
91 swift 1.43 <body>
92    
93     <p>
94 jkt 1.119 In a few moments, we will change the Linux root towards the new location. To
95     make sure that the new environment works properly, we need to make certain file
96     systems available there as well.
97     </p>
98    
99     <p>
100 swift 1.43 Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to
101 neysx 1.88 allow the installation to use the kernel-provided information within the
102     chrooted environment, and then mount-bind the <path>/dev</path> filesystem.
103 swift 1.43 </p>
104    
105 neysx 1.88 <pre caption="Mounting /proc and /dev">
106 swift 1.43 # <i>mount -t proc none /mnt/gentoo/proc</i>
107 nightmorph 1.118 # <i>mount --rbind /dev /mnt/gentoo/dev</i>
108 swift 1.43 </pre>
109    
110     </body>
111     </subsection>
112 nightmorph 1.105 <subsection test="func:keyval('arch')='IA64'">
113     <title>Mounting the /proc, /sys and /dev Filesystems</title>
114     <body>
115    
116     <p>
117     Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to
118     allow the installation to use the kernel-provided information within the
119     chrooted environment, and then mount-bind the <path>/dev</path> and
120     <path>/sys</path> filesystems.
121     </p>
122    
123     <pre caption="Mounting /proc /sys and /dev">
124     # <i>mount -t proc none /mnt/gentoo/proc</i>
125 nightmorph 1.118 # <i>mount --rbind /dev /mnt/gentoo/dev</i>
126     # <i>mount --rbind /sys /mnt/gentoo/sys</i>
127 nightmorph 1.105 </pre>
128    
129     </body>
130     </subsection>
131 swift 1.43 <subsection>
132 swift 1.2 <title>Entering the new Environment</title>
133 swift 1.1 <body>
134    
135     <p>
136 swift 1.19 Now that all partitions are initialized and the base environment
137 swift 1.1 installed, it is time to enter our new installation environment by
138 swift 1.9 <e>chrooting</e> into it. This means that we change from the current
139 swift 1.72 installation environment (Installation CD or other installation medium) to your
140 swift 1.19 installation system (namely the initialized partitions).
141 swift 1.1 </p>
142    
143     <p>
144     This chrooting is done in three steps. First we will change the root
145 swift 1.2 from <path>/</path> (on the installation medium) to <path>/mnt/gentoo</path>
146     (on your partitions) using <c>chroot</c>. Then we will create a new environment
147     using <c>env-update</c>, which essentially creates environment variables.
148 swift 1.1 Finally, we load those variables into memory using <c>source</c>.
149     </p>
150    
151     <pre caption = "Chrooting into the new environment">
152     # <i>chroot /mnt/gentoo /bin/bash</i>
153     # <i>env-update</i>
154 neysx 1.92 >> Regenerating /etc/ld.so.cache...
155 swift 1.1 # <i>source /etc/profile</i>
156 rane 1.87 # <i>export PS1="(chroot) $PS1"</i>
157 swift 1.1 </pre>
158    
159     <p>
160     Congratulations! You are now inside your own Gentoo Linux environment.
161 swift 1.10 Of course it is far from finished, which is why the installation still
162 swift 1.1 has some sections left :-)
163     </p>
164    
165     </body>
166 swift 1.3 </subsection>
167 swift 1.85 </section>
168    
169     <section>
170     <title>Configuring Portage</title>
171 swift 1.3 <subsection>
172 swift 1.64 <title>Updating the Portage tree</title>
173 swift 1.2 <body>
174    
175     <p>
176 swift 1.69 You should now update your Portage tree to the latest version. <c>emerge
177     --sync</c> does this for you.
178 swift 1.2 </p>
179    
180 dertobi123 1.40 <pre caption="Updating the Portage tree">
181 cam 1.50 # <i>emerge --sync</i>
182 neysx 1.78 <comment>(If you're using a slow terminal like some framebuffers or a serial
183     console, you can add the --quiet option to speed up this process:)</comment>
184     # <i>emerge --sync --quiet</i>
185 swift 1.13 </pre>
186    
187     <p>
188 swift 1.75 If you are behind a firewall that blocks rsync traffic, you can use
189     <c>emerge-webrsync</c> which will download and install a portage snapshot for
190     you.
191     </p>
192    
193     <p>
194 swift 1.13 If you are warned that a new Portage version is available and that you should
195 nightmorph 1.110 update Portage, you should do it now using <c>emerge --oneshot portage</c>.
196 swift 1.13 </p>
197 swift 1.8
198     </body>
199     </subsection>
200 swift 1.72 <subsection>
201     <title>Choosing the Right Profile</title>
202     <body>
203    
204     <p>
205     First, a small definition is in place.
206     </p>
207    
208     <p>
209     A profile is a building block for any Gentoo system. Not only does it specify
210 nightmorph 1.112 default values for USE, CFLAGS and other important variables, it also locks
211 swift 1.72 the system to a certain range of package versions. This is all maintained by the
212     Gentoo developers.
213     </p>
214    
215 nightmorph 1.106 <p>
216 nightmorph 1.102 Previously, such a profile was untouched by the users. However, there may be
217     certain situations in which you may decide a profile change is necessary.
218 swift 1.72 </p>
219    
220     <p>
221 neysx 1.79 You can see what profile you are currently using with the following command:
222 swift 1.72 </p>
223    
224     <pre caption="Verifying system profile">
225 nightmorph 1.112 # <i>eselect profile list</i>
226     Available profile symlink targets:
227     [1] <keyval id="profile"/> *
228     [2] <keyval id="profile"/>/desktop
229     [3] <keyval id="profile"/>/server
230 swift 1.72 </pre>
231    
232     <p>
233 swift 1.122 As you can see, there are also <c>desktop</c> and <c>server</c> subprofiles available for some
234 nightmorph 1.112 architectures. Running <c>eselect profile list</c> will show all available
235     profiles.
236 nightmorph 1.99 </p>
237    
238     <p>
239 nightmorph 1.112 After viewing the available profiles for your architecture, you can use a
240     different one if you wish:
241 swift 1.72 </p>
242    
243 nightmorph 1.106 <pre caption="Changing profiles">
244 nightmorph 1.112 # <i>eselect profile set 2</i>
245 swift 1.72 </pre>
246    
247 nightmorph 1.106 <p test="func:keyval('arch')='AMD64'">
248     If you want to have a pure 64-bit environment, with no 32-bit applications or
249     libraries, you should use a non-multilib profile:
250 swift 1.72 </p>
251    
252 nightmorph 1.106 <pre test="func:keyval('arch')='AMD64'" caption="Switching to a non-multilib profile">
253 nightmorph 1.112 # <i>eselect profile list</i>
254     Available profile symlink targets:
255     [1] <keyval id="profile"/> *
256     [2] <keyval id="profile"/>/desktop
257     [3] <keyval id="profile"/>/no-multilib
258     [4] <keyval id="profile"/>/server
259     <comment>(Choose the no-multilib profile)</comment>
260     # <i>eselect profile set 3</i>
261     <comment>(Verify the change)</comment>
262     # <i>eselect profile list</i>
263     Available profile symlink targets:
264     [1] <keyval id="profile"/>
265     [2] <keyval id="profile"/>/desktop
266     [3] <keyval id="profile"/>/no-multilib *
267     [4] <keyval id="profile"/>/server
268 swift 1.83 </pre>
269    
270 nightmorph 1.111 <note>
271     The <c>developer</c> subprofile is specifically for Gentoo Linux development
272     tasks. It is <e>not</e> meant to help set up general development environments.
273     </note>
274    
275 swift 1.72 </body>
276     </subsection>
277 swift 1.28 <subsection id="configure_USE">
278 swift 1.21 <title>Configuring the USE variable</title>
279     <body>
280    
281     <p>
282     <c>USE</c> is one of the most powerful variables Gentoo provides to its users.
283     Several programs can be compiled with or without optional support for certain
284     items. For instance, some programs can be compiled with gtk-support, or with
285     qt-support. Others can be compiled with or without SSL support. Some programs
286     can even be compiled with framebuffer support (svgalib) instead of X11 support
287     (X-server).
288     </p>
289    
290     <p>
291     Most distributions compile their packages with support for as much as possible,
292     increasing the size of the programs and startup time, not to mention an enormous
293 swift 1.24 amount of dependencies. With Gentoo you can define what options a package
294 swift 1.21 should be compiled with. This is where <c>USE</c> comes into play.
295     </p>
296    
297     <p>
298     In the <c>USE</c> variable you define keywords which are mapped onto
299     compile-options. For instance, <e>ssl</e> will compile ssl-support in the
300 nightmorph 1.100 programs that support it. <e>-X</e> will remove X-server support (note the
301 nightmorph 1.115 minus sign in front). <e>gnome gtk -kde -qt4</e> will compile your
302 nightmorph 1.100 programs with gnome (and gtk) support, and not with kde (and qt) support,
303     making your system fully tweaked for GNOME.
304 swift 1.21 </p>
305    
306     <p>
307 swift 1.68 The default <c>USE</c> settings are placed in the <path>make.defaults</path>
308     files of your profile. You will find <path>make.defaults</path> files in the
309     directory which <path>/etc/make.profile</path> points to and all parent
310     directories as well. The default <c>USE</c> setting is the sum of all <c>USE</c>
311     settings in all <path>make.defaults</path> files. What you place in
312 swift 1.21 <path>/etc/make.conf</path> is calculated against these defaults settings. If
313     you add something to the <c>USE</c> setting, it is added to the default list. If
314     you remove something from the <c>USE</c> setting (by placing a minus sign in
315     front of it) it is removed from the default list (if it was in the default list
316     at all). <e>Never</e> alter anything inside the <path>/etc/make.profile</path>
317     directory; it gets overwritten when you update Portage!
318     </p>
319    
320     <p>
321     A full description on <c>USE</c> can be found in the second part of the Gentoo
322 neysx 1.52 Handbook, <uri link="?part=2&amp;chap=2">USE flags</uri>. A full description on
323     the available USE flags can be found on your system in
324 swift 1.23 <path>/usr/portage/profiles/use.desc</path>.
325     </p>
326    
327     <pre caption="Viewing available USE flags">
328     # <i>less /usr/portage/profiles/use.desc</i>
329 swift 1.45 <comment>(You can scroll using your arrow keys, exit by pressing 'q')</comment>
330 swift 1.23 </pre>
331    
332     <p>
333     As an example we show a <c>USE</c> setting for a KDE-based system with DVD, ALSA
334     and CD Recording support:
335 swift 1.21 </p>
336    
337     <pre caption="Opening /etc/make.conf">
338     # <i>nano -w /etc/make.conf</i>
339     </pre>
340    
341     <pre caption="USE setting">
342 nightmorph 1.115 USE="-gtk -gnome qt4 kde dvd alsa cdr"
343 swift 1.21 </pre>
344    
345 swift 1.69 </body>
346     </subsection>
347 swift 1.28 </section>
348 swift 1.3 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20