/[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.116 - (show annotations) (download) (as text)
Sun Jun 13 12:02:53 2010 UTC (4 years, 4 months ago) by nightmorph
Branch: MAIN
Changes since 1.115: +4 -4 lines
File MIME type: application/xml
alpha and ia64 stages now support ipv6, bug 321713

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

  ViewVC Help
Powered by ViewVC 1.1.20