/[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.112 - (show annotations) (download) (as text)
Sun Oct 4 18:37:42 2009 UTC (5 years, 1 month ago) by nightmorph
Branch: MAIN
Changes since 1.111: +29 -13 lines
File MIME type: application/xml
Quick fixes for autobuilds and all stuff (i think) found on the autobuilds tracker bug -- x86 and amd64 only at this time. should be good for Gentoo's 10th anniversary on these two arches

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.111 2008/05/15 06:56:48 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.0</version>
18 <date>2009-10-04</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>
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 </body>
62 </subsection>
63 <subsection>
64 <title>Copy DNS Info</title>
65 <body>
66
67 <p>
68 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 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 <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/</i>
78 </pre>
79
80 </body>
81 </subsection>
82 <subsection test="not(func:keyval('arch')='IA64')">
83 <title>Mounting the /proc and /dev Filesystems</title>
84 <body>
85
86 <p>
87 Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to
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 </p>
91
92 <pre caption="Mounting /proc and /dev">
93 # <i>mount -t proc none /mnt/gentoo/proc</i>
94 # <i>mount -o bind /dev /mnt/gentoo/dev</i>
95 </pre>
96
97 </body>
98 </subsection>
99 <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 <subsection>
119 <title>Entering the new Environment</title>
120 <body>
121
122 <p>
123 Now that all partitions are initialized and the base environment
124 installed, it is time to enter our new installation environment by
125 <e>chrooting</e> into it. This means that we change from the current
126 installation environment (Installation CD or other installation medium) to your
127 installation system (namely the initialized partitions).
128 </p>
129
130 <p>
131 This chrooting is done in three steps. First we will change the root
132 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 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 >> Regenerating /etc/ld.so.cache...
142 # <i>source /etc/profile</i>
143 # <i>export PS1="(chroot) $PS1"</i>
144 </pre>
145
146 <p>
147 Congratulations! You are now inside your own Gentoo Linux environment.
148 Of course it is far from finished, which is why the installation still
149 has some sections left :-)
150 </p>
151
152 </body>
153 </subsection>
154 </section>
155
156 <section>
157 <title>Configuring Portage</title>
158 <subsection>
159 <title>Updating the Portage tree</title>
160 <body>
161
162 <p>
163 You should now update your Portage tree to the latest version. <c>emerge
164 --sync</c> does this for you.
165 </p>
166
167 <pre caption="Updating the Portage tree">
168 # <i>emerge --sync</i>
169 <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 </pre>
173
174 <p>
175 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 If you are warned that a new Portage version is available and that you should
182 update Portage, you should do it now using <c>emerge --oneshot portage</c>.
183 </p>
184
185 </body>
186 </subsection>
187 <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 USE, 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 <p>
203 Previously, such a profile was untouched by the users. However, there may be
204 certain situations in which you may decide a profile change is necessary.
205 </p>
206
207 <p>
208 You can see what profile you are currently using with the following command:
209 </p>
210
211 <pre caption="Verifying system profile">
212 # <i>eselect profile list</i>
213 Available profile symlink targets:
214 [1] <keyval id="profile"/> *
215 [2] <keyval id="profile"/>/desktop
216 [3] <keyval id="profile"/>/server
217 </pre>
218
219 <p>
220 The default profile will provide you with a Linux 2.6-based system. This is the
221 recommended default, but you have the option of choosing another profile too.
222 </p>
223
224 <p>
225 There are also <c>desktop</c> and <c>server</c> subprofiles available for some
226 architectures. Running <c>eselect profile list</c> will show all available
227 profiles.
228 </p>
229
230 <p>
231 After viewing the available profiles for your architecture, you can use a
232 different one if you wish:
233 </p>
234
235 <pre caption="Changing profiles">
236 # <i>eselect profile set 2</i>
237 </pre>
238
239 <p test="func:keyval('arch')='AMD64'">
240 If you want to have a pure 64-bit environment, with no 32-bit applications or
241 libraries, you should use a non-multilib profile:
242 </p>
243
244 <pre test="func:keyval('arch')='AMD64'" caption="Switching to a non-multilib profile">
245 # <i>eselect profile list</i>
246 Available profile symlink targets:
247 [1] <keyval id="profile"/> *
248 [2] <keyval id="profile"/>/desktop
249 [3] <keyval id="profile"/>/no-multilib
250 [4] <keyval id="profile"/>/server
251 <comment>(Choose the no-multilib profile)</comment>
252 # <i>eselect profile set 3</i>
253 <comment>(Verify the change)</comment>
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 </pre>
261
262 <note>
263 The <c>developer</c> subprofile is specifically for Gentoo Linux development
264 tasks. It is <e>not</e> meant to help set up general development environments.
265 </note>
266
267 </body>
268 </subsection>
269 <subsection id="configure_USE">
270 <title>Configuring the USE variable</title>
271 <body>
272
273 <p>
274 <c>USE</c> is one of the most powerful variables Gentoo provides to its users.
275 Several programs can be compiled with or without optional support for certain
276 items. For instance, some programs can be compiled with gtk-support, or with
277 qt-support. Others can be compiled with or without SSL support. Some programs
278 can even be compiled with framebuffer support (svgalib) instead of X11 support
279 (X-server).
280 </p>
281
282 <p>
283 Most distributions compile their packages with support for as much as possible,
284 increasing the size of the programs and startup time, not to mention an enormous
285 amount of dependencies. With Gentoo you can define what options a package
286 should be compiled with. This is where <c>USE</c> comes into play.
287 </p>
288
289 <p>
290 In the <c>USE</c> variable you define keywords which are mapped onto
291 compile-options. For instance, <e>ssl</e> will compile ssl-support in the
292 programs that support it. <e>-X</e> will remove X-server support (note the
293 minus sign in front). <e>gnome gtk -kde -qt3 -qt4</e> will compile your
294 programs with gnome (and gtk) support, and not with kde (and qt) support,
295 making your system fully tweaked for GNOME.
296 </p>
297
298 <p>
299 The default <c>USE</c> settings are placed in the <path>make.defaults</path>
300 files of your profile. You will find <path>make.defaults</path> files in the
301 directory which <path>/etc/make.profile</path> points to and all parent
302 directories as well. The default <c>USE</c> setting is the sum of all <c>USE</c>
303 settings in all <path>make.defaults</path> files. What you place in
304 <path>/etc/make.conf</path> is calculated against these defaults settings. If
305 you add something to the <c>USE</c> setting, it is added to the default list. If
306 you remove something from the <c>USE</c> setting (by placing a minus sign in
307 front of it) it is removed from the default list (if it was in the default list
308 at all). <e>Never</e> alter anything inside the <path>/etc/make.profile</path>
309 directory; it gets overwritten when you update Portage!
310 </p>
311
312 <p>
313 A full description on <c>USE</c> can be found in the second part of the Gentoo
314 Handbook, <uri link="?part=2&amp;chap=2">USE flags</uri>. A full description on
315 the available USE flags can be found on your system in
316 <path>/usr/portage/profiles/use.desc</path>.
317 </p>
318
319 <pre caption="Viewing available USE flags">
320 # <i>less /usr/portage/profiles/use.desc</i>
321 <comment>(You can scroll using your arrow keys, exit by pressing 'q')</comment>
322 </pre>
323
324 <p>
325 As an example we show a <c>USE</c> setting for a KDE-based system with DVD, ALSA
326 and CD Recording support:
327 </p>
328
329 <pre caption="Opening /etc/make.conf">
330 # <i>nano -w /etc/make.conf</i>
331 </pre>
332
333 <pre caption="USE setting">
334 USE="-gtk -gnome qt3 qt4 kde dvd alsa cdr"
335 </pre>
336
337 </body>
338 </subsection>
339 <subsection>
340 <title>Optional: glibc Locales</title>
341 <body>
342
343 <p>
344 You will probably only use one or maybe two locales on your system. You can
345 specify locales you will need in <path>/etc/locale.gen</path>.
346 </p>
347
348 <pre caption="Opening /etc/locale.gen">
349 # <i>nano -w /etc/locale.gen</i>
350 </pre>
351
352 <p>
353 The following locales are an example to get both English (United States) and
354 German (Germany) with the accompanying character formats (like UTF-8).
355 </p>
356
357 <pre caption="Specify your locales">
358 en_US ISO-8859-1
359 en_US.UTF-8 UTF-8
360 de_DE ISO-8859-1
361 de_DE@euro ISO-8859-15
362 </pre>
363
364 <p>
365 The next step is to run <c>locale-gen</c>. It will generate all the locales you
366 have specified in the <path>/etc/locale.gen</path> file.
367 </p>
368
369 <p>
370 Now continue with <uri link="?part=1&amp;chap=7">Configuring the Kernel</uri>.
371 </p>
372
373 </body>
374 </subsection>
375 </section>
376 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20