/[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.85 - (show annotations) (download) (as text)
Fri Nov 11 17:27:15 2005 UTC (8 years, 8 months ago) by swift
Branch: MAIN
Changes since 1.84: +9 -203 lines
File MIME type: application/xml
#105809 - Moving bootstrapping/system to FAQ, outside handbook

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/1.0 -->
6
7 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-system.xml,v 1.84 2005/08/16 22:14:44 neysx Exp $ -->
8
9 <sections>
10
11 <version>2.12</version>
12 <date>2005-11-11</date>
13
14 <section>
15 <title>Chrooting</title>
16 <subsection>
17 <title>Optional: Selecting Mirrors</title>
18 <body>
19
20 <p>
21 In order to download source code quickly it is recommended to select a fast
22 mirror. Portage will look in your <path>make.conf</path> file for the
23 GENTOO_MIRRORS variable and use the mirrors listed therein. You can surf to
24 our <uri link="/main/en/mirrors.xml">mirror list</uri> and search
25 for a mirror (or mirrors) close to you (as those are most frequently the
26 fastest ones), but we provide a nice tool called <c>mirrorselect</c> which
27 provides you with a nice interface to select the mirrors you want.
28 </p>
29
30 <pre caption="Using mirrorselect for the GENTOO_MIRRORS variable">
31 # <i>mirrorselect -i -o &gt;&gt; /mnt/gentoo/etc/make.conf</i>
32 </pre>
33
34 <warn>
35 Do not select any IPv6 mirrors. Our stages currently do not support IPv6.
36 </warn>
37
38 <p>
39 A second important setting is the SYNC setting in <path>make.conf</path>. This
40 variable contains the rsync server you want to use when updating your Portage
41 tree (the collection of ebuilds, scripts containing all the information Portage
42 needs to download and install software). Although you can manually enter a SYNC
43 server for yourself, <c>mirrorselect</c> can ease that operation for you:
44 </p>
45
46 <pre caption="Selecting an rsync mirror using mirrorselect">
47 # <i>mirrorselect -i -r -o &gt;&gt; /mnt/gentoo/etc/make.conf</i>
48 </pre>
49
50 <p>
51 After running <c>mirrorselect</c> it is adviseable to double-check the settings
52 in <path>/mnt/gentoo/etc/make.conf</path> !
53 </p>
54
55 </body>
56 </subsection>
57 <subsection>
58 <title>Copy DNS Info</title>
59 <body>
60
61 <p>
62 One thing still remains to be done before we enter the new environment and that
63 is copying over the DNS information in <path>/etc/resolv.conf</path>. You need
64 to do this to ensure that networking still works even after entering the new
65 environment. <path>/etc/resolv.conf</path> contains the nameservers for your
66 network.
67 </p>
68
69 <pre caption="Copy over DNS information">
70 <comment>(The "-L" option is needed to make sure we don't copy a symbolic link)</comment>
71 # <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</i>
72 </pre>
73
74 </body>
75 </subsection>
76 <subsection>
77 <title>Mounting the proc Filesystem</title>
78 <body>
79
80 <p>
81 Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to
82 allow the installation to use the kernel-provided information even within the
83 chrooted environment.
84 </p>
85
86 <pre caption="Mounting /proc">
87 # <i>mount -t proc none /mnt/gentoo/proc</i>
88 </pre>
89
90 </body>
91 </subsection>
92 <subsection>
93 <title>Entering the new Environment</title>
94 <body>
95
96 <p>
97 Now that all partitions are initialized and the base environment
98 installed, it is time to enter our new installation environment by
99 <e>chrooting</e> into it. This means that we change from the current
100 installation environment (Installation CD or other installation medium) to your
101 installation system (namely the initialized partitions).
102 </p>
103
104 <p>
105 This chrooting is done in three steps. First we will change the root
106 from <path>/</path> (on the installation medium) to <path>/mnt/gentoo</path>
107 (on your partitions) using <c>chroot</c>. Then we will create a new environment
108 using <c>env-update</c>, which essentially creates environment variables.
109 Finally, we load those variables into memory using <c>source</c>.
110 </p>
111
112 <pre caption = "Chrooting into the new environment">
113 # <i>chroot /mnt/gentoo /bin/bash</i>
114 # <i>env-update</i>
115 * Caching service dependencies...
116 # <i>source /etc/profile</i>
117 </pre>
118
119 <p>
120 Congratulations! You are now inside your own Gentoo Linux environment.
121 Of course it is far from finished, which is why the installation still
122 has some sections left :-)
123 </p>
124
125 </body>
126 </subsection>
127 </section>
128
129 <section>
130 <title>Configuring Portage</title>
131 <subsection>
132 <title>Updating the Portage tree</title>
133 <body>
134
135 <p>
136 You should now update your Portage tree to the latest version. <c>emerge
137 --sync</c> does this for you.
138 </p>
139
140 <pre caption="Updating the Portage tree">
141 # <i>emerge --sync</i>
142 <comment>(If you're using a slow terminal like some framebuffers or a serial
143 console, you can add the --quiet option to speed up this process:)</comment>
144 # <i>emerge --sync --quiet</i>
145 </pre>
146
147 <p>
148 If you are behind a firewall that blocks rsync traffic, you can use
149 <c>emerge-webrsync</c> which will download and install a portage snapshot for
150 you.
151 </p>
152
153 <p>
154 If you are warned that a new Portage version is available and that you should
155 update Portage, you should ignore it. Portage will be updated for you later
156 on during the installation.
157 </p>
158
159 </body>
160 </subsection>
161 <subsection>
162 <title>Choosing the Right Profile</title>
163 <body>
164
165 <p>
166 First, a small definition is in place.
167 </p>
168
169 <p>
170 A profile is a building block for any Gentoo system. Not only does it specify
171 default values for CHOST, CFLAGS and other important variables, it also locks
172 the system to a certain range of package versions. This is all maintained by the
173 Gentoo developers.
174 </p>
175
176 <p>
177 Previously, such a profile was barely touched by the user. However, x86, hppa
178 and alpha users can choose between two profiles, one for a 2.4 kernel and one
179 for a 2.6 kernel. This requirement has been imposed to improve the integration
180 of the 2.6 kernels. The ppc and ppc64 architectures have several profiles
181 available as well. We will talk about those later.
182 </p>
183
184 <p>
185 You can see what profile you are currently using with the following command:
186 </p>
187
188 <pre caption="Verifying system profile">
189 # <i>ls -FGg /etc/make.profile</i>
190 lrwxrwxrwx 1 48 Apr 8 18:51 /etc/make.profile -> ../usr/portage/profiles/default-linux/x86/2005.1/
191 </pre>
192
193 <p>
194 If you are using one of the aforementioned three architectures, the default
195 profile will provide you with a Linux 2.6-based system. This is the recommended
196 default, but you have the option of choosing another profile too.
197 </p>
198
199 <p>
200 Some users may wish to install a system based on the older Linux 2.4 profile.
201 If you have good reason to do this, then you should first check that an
202 additional profile exists. On x86, we can do this with the following command:
203 </p>
204
205 <pre caption="Finding out if an additional profile exists">
206 # <i>ls -d /usr/portage/profiles/default-linux/x86/2005.1/2.4</i>
207 /usr/portage/profiles/default-linux/x86/2005.1/2.4
208 </pre>
209
210 <p>
211 The above example shows that the additional 2.4 profile exists (i.e. it didn't
212 complain about missing file or directory). It is recommended that you stay with
213 the default, but if you wish to switch, you can do so with as follows:
214 </p>
215
216 <pre caption="Switching to a 2.4 profile">
217 <comment>(Make sure you use the right architecture, the example below is for x86)</comment>
218 # <i>ln -snf /usr/portage/profiles/default-linux/x86/2005.1/2.4 /etc/make.profile</i>
219 <comment>(List the files in the 2.4 profile)</comment>
220 # <i>ls -FGg /etc/make.profile/</i>
221 total 12
222 -rw-r--r-- 1 939 Dec 10 14:06 packages
223 -rw-r--r-- 1 347 Dec 3 2004 parent
224 -rw-r--r-- 1 573 Dec 3 2004 virtuals
225 </pre>
226
227 <p>
228 For ppc, there are a number of new profiles provided with 2005.1.
229 </p>
230
231 <pre caption="PPC Profiles">
232 <comment>(Generic PPC profile, for all PPC machines)</comment>
233 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/2005.1/ppc /etc/make.profile</i>
234 <comment>(G3 profile)</comment>
235 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/2005.1/ppc/G3 /etc/make.profile</i>
236 <comment>(G3 Pegasos profile)</comment>
237 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/2005.1/ppc/G3/Pegasos/ /etc/make.profile</i>
238 <comment>(G4 (Altivec) profile)</comment>
239 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/2005.1/ppc/G4 /etc/make.profile</i>
240 <comment>(G4 Pegasos profile)</comment>
241 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/2005.1/ppc/G4/Pegasos/ /etc/make.profile</i>
242 </pre>
243
244 <p>
245 For ppc64, there are a number of new profiles provided with 2005.1.
246 </p>
247
248 <pre caption="PPC64 Profiles">
249 <comment>(Generic 64bit userland PPC64 profile, for all PPC64 machines)</comment>
250 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/2005.1/ppc64/64bit-userland /etc/make.profile</i>
251 <comment>(Generic 32bit userland PPC64 profile, for all PPC64 machines)</comment>
252 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/2005.1/ppc64/32bit-userland /etc/make.profile</i>
253 <comment>(Each type of userland has sub profiles as follows, with (userland) replaced with the chosen userland from above)</comment>
254 <comment>(970 profile for JS20)</comment>
255 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/2005.1/ppc64/(userland)/970 /etc/make.profile</i>
256 <comment>(G5 profile)</comment>
257 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/2005.1/ppc64/(userland)/970/pmac /etc/make.profile</i>
258 <comment>(POWER3 profile)</comment>
259 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/2005.1/ppc64/(userland)/power3 /etc/make.profile</i>
260 <comment>(POWER4 profile)</comment>
261 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/2005.1/ppc64/(userland)/power4 /etc/make.profile</i>
262 <comment>(POWER5 profile)</comment>
263 # <i>ln -snf /usr/portage/profiles/default-linux/ppc/2005.1/ppc64/(userland)/power5 /etc/make.profile</i>
264 <comment>(The multilib profile is not stable as of this release.)</comment>
265 </pre>
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 minus
293 sign in front). <e>gnome gtk -kde -qt</e> will compile your programs with gnome
294 (and gtk) support, and not with kde (and qt) support, making your system fully
295 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 qt 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. Up until now
345 after compiling <c>glibc</c> a full set of all available locales will be
346 created. As of now you can activate the <c>userlocales</c> USE flag and specify
347 only the locales you will need in <path>/etc/locales.build</path>. Only do this
348 if you know what locales to choose.
349 </p>
350
351 <pre caption="Activate the userlocales USE flag especially for glibc">
352 # <i>mkdir -p /etc/portage</i>
353 # <i>echo "sys-libs/glibc userlocales" >> /etc/portage/package.use</i>
354 </pre>
355
356 <p>
357 Now specify the locales you want to be able to use:
358 </p>
359
360 <pre caption="Opening /etc/locales.build">
361 # <i>nano -w /etc/locales.build</i>
362 </pre>
363
364 <p>
365 The following locales are an example to get both English (United States) and
366 German (Germany) with the accompanying character formats (like UTF-8).
367 </p>
368
369 <pre caption="Specify your locales">
370 en_US/ISO-8859-1
371 en_US.UTF-8/UTF-8
372 de_DE/ISO-8859-1
373 de_DE@euro/ISO-8859-15
374 </pre>
375
376 <p>
377 Now continue with <uri link="?part=1&amp;chap=7">Configuring the Kernel</uri>.
378 </p>
379
380 </body>
381 </subsection>
382 </section>
383 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20