/[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.118 - (show annotations) (download) (as text)
Wed Mar 16 07:43:58 2011 UTC (3 years, 5 months ago) by nightmorph
Branch: MAIN
Changes since 1.117: +6 -6 lines
File MIME type: application/xml
use different bind mount, bug 253681

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

  ViewVC Help
Powered by ViewVC 1.1.20