/[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.130 - (show annotations) (download) (as text)
Tue Jan 8 19:18:37 2013 UTC (22 months, 2 weeks ago) by swift
Branch: MAIN
Changes since 1.129: +5 -3 lines
File MIME type: application/xml
Fix bug #449192 (missed a step, or counted a step too much). Fix by Chema Alonso with some minor modification

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.129 2013/01/02 19:28:52 swift 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>22</version>
18 <date>2013-01-08</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. Just
34 navigate to the mirrors of choice and press spacebar to select one or more
35 mirrors.
36 </p>
37
38 <pre caption="Using mirrorselect for the GENTOO_MIRRORS variable">
39 # <i>mirrorselect -i -o &gt;&gt; /mnt/gentoo/etc/portage/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 </p>
49
50 <pre caption="Selecting an rsync mirror using mirrorselect">
51 # <i>mirrorselect -i -r -o &gt;&gt; /mnt/gentoo/etc/portage/make.conf</i>
52 </pre>
53
54 <p>
55 After running <c>mirrorselect</c> it is adviseable to double-check the settings
56 in <path>/mnt/gentoo/etc/portage/make.conf</path> !
57 </p>
58
59 <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 </body>
69 </subsection>
70 <subsection>
71 <title>Copy DNS Info</title>
72 <body>
73
74 <p>
75 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 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 <comment>(The "-L" option is needed to make sure we don't copy a symbolic link)</comment>
84 # <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/</i>
85 </pre>
86
87 </body>
88 </subsection>
89 <subsection test="not(func:keyval('arch')='IA64')">
90 <title>Mounting the necessary Filesystems</title>
91 <body>
92
93 <p>
94 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 Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to
101 allow the installation to use the kernel-provided information within the
102 chrooted environment, and then mount-bind the <path>/dev</path> and
103 <path>/sys</path> filesystems.
104 </p>
105
106 <pre caption="Mounting /proc and /dev">
107 # <i>mount -t proc none /mnt/gentoo/proc</i>
108 # <i>mount --rbind /sys /mnt/gentoo/sys</i>
109 # <i>mount --rbind /dev /mnt/gentoo/dev</i>
110 </pre>
111
112 </body>
113 </subsection>
114 <subsection test="func:keyval('arch')='IA64'">
115 <title>Mounting the /proc, /sys and /dev Filesystems</title>
116 <body>
117
118 <p>
119 Mount the <path>/proc</path> filesystem on <path>/mnt/gentoo/proc</path> to
120 allow the installation to use the kernel-provided information within the
121 chrooted environment, and then mount-bind the <path>/dev</path> and
122 <path>/sys</path> filesystems.
123 </p>
124
125 <pre caption="Mounting /proc /sys and /dev">
126 # <i>mount -t proc none /mnt/gentoo/proc</i>
127 # <i>mount --rbind /dev /mnt/gentoo/dev</i>
128 # <i>mount --rbind /sys /mnt/gentoo/sys</i>
129 </pre>
130
131 </body>
132 </subsection>
133 <subsection>
134 <title>Entering the new Environment</title>
135 <body>
136
137 <p>
138 Now that all partitions are initialized and the base environment
139 installed, it is time to enter our new installation environment by
140 <e>chrooting</e> into it. This means that we change from the current
141 installation environment (Installation CD or other installation medium) to your
142 installation system (namely the initialized partitions).
143 </p>
144
145 <p>
146 This chrooting is done in three steps. First we will change the root
147 from <path>/</path> (on the installation medium) to <path>/mnt/gentoo</path>
148 (on your partitions) using <c>chroot</c>. Then we will reload some settings, as
149 provided by <path>/etc/profile</path>, in memory using <c>source</c>.
150 The last step is to redefine the primary prompt to help us remember that we are
151 inside a chroot environment.
152 </p>
153
154 <pre caption = "Chrooting into the new environment">
155 # <i>chroot /mnt/gentoo /bin/bash</i>
156 # <i>source /etc/profile</i>
157 # <i>export PS1="(chroot) $PS1"</i>
158 </pre>
159
160 <p>
161 Congratulations! You are now inside your own Gentoo Linux environment.
162 Of course it is far from finished, which is why the installation still
163 has some sections left :-)
164 </p>
165
166 <p>
167 If you at any time would need another terminal or console to access the chroot
168 environment, all you need to do is to execute the above steps again.
169 </p>
170
171 </body>
172 </subsection>
173 </section>
174
175 <section id="installing_portage">
176 <title>Configuring Portage</title>
177 <subsection>
178 <title>Unpacking a Portage Snapshot</title>
179 <body>
180
181 <p>
182 You now have to install a Portage snapshot, a collection of files that inform
183 Portage what software titles you can install, which profiles are available, etc.
184 The contents of this snapshot will be extracted to <path>/usr/portage</path>.
185 </p>
186
187 <p>
188 We recommend the use of <c>emerge-webrsync</c>. This will fetch the latest
189 portage snapshot (which Gentoo releases on a daily basis) from one of our mirrors
190 and install it onto your system.
191 </p>
192
193 <pre caption="Running emerge-webrsync to install a Portage snapshot">
194 # <i>mkdir /usr/portage</i>
195 # <i>emerge-webrsync</i>
196 </pre>
197
198 </body>
199 </subsection>
200 <subsection>
201 <title>Optional: Updating the Portage tree</title>
202 <body>
203
204 <p>
205 You can now update your Portage tree to the latest version. <c>emerge
206 --sync</c> will use the rsync protocol to update the Portage tree (which
207 you fetched earlier on through <c>emerge-webrsync</c>) to the latest state.
208 </p>
209
210 <pre caption="Updating the Portage tree">
211 # <i>emerge --sync</i>
212 <comment>(If you're using a slow terminal like some framebuffers or a serial
213 console, you can add the --quiet option to speed up this process:)</comment>
214 # <i>emerge --sync --quiet</i>
215 </pre>
216
217 <p>
218 If you are behind a firewall that blocks rsync traffic, you safely ignore this
219 step as you already have a quite up-to-date Portage tree.
220 </p>
221
222 <p>
223 If you are warned that a new Portage version is available and that you should
224 update Portage, you should do it now using <c>emerge --oneshot portage</c>.
225 </p>
226
227 </body>
228 </subsection>
229 <subsection>
230 <title>Choosing the Right Profile</title>
231 <body>
232
233 <p>
234 First, a small definition is in place.
235 </p>
236
237 <p>
238 A profile is a building block for any Gentoo system. Not only does it specify
239 default values for USE, CFLAGS and other important variables, it also locks
240 the system to a certain range of package versions. This is all maintained by the
241 Gentoo developers.
242 </p>
243
244 <p>
245 Previously, such a profile was untouched by the users. However, there may be
246 certain situations in which you may decide a profile change is necessary.
247 </p>
248
249 <p>
250 You can see what profile you are currently using with the following command:
251 </p>
252
253 <pre caption="Verifying system 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"/>/server
259 </pre>
260
261 <p>
262 As you can see, there are also <c>desktop</c> and <c>server</c> subprofiles available for some
263 architectures. Running <c>eselect profile list</c> will show all available
264 profiles.
265 </p>
266
267 <p>
268 After viewing the available profiles for your architecture, you can use a
269 different one if you wish:
270 </p>
271
272 <pre caption="Changing profiles">
273 # <i>eselect profile set 2</i>
274 </pre>
275
276 <p test="func:keyval('arch')='AMD64'">
277 If you want to have a pure 64-bit environment, with no 32-bit applications or
278 libraries, you should use a non-multilib profile:
279 </p>
280
281 <pre test="func:keyval('arch')='AMD64'" caption="Switching to a non-multilib profile">
282 # <i>eselect profile list</i>
283 Available profile symlink targets:
284 [1] <keyval id="profile"/> *
285 [2] <keyval id="profile"/>/desktop
286 [3] <keyval id="profile"/>/no-multilib
287 [4] <keyval id="profile"/>/server
288 <comment>(Choose the no-multilib profile)</comment>
289 # <i>eselect profile set 3</i>
290 <comment>(Verify the change)</comment>
291 # <i>eselect profile list</i>
292 Available profile symlink targets:
293 [1] <keyval id="profile"/>
294 [2] <keyval id="profile"/>/desktop
295 [3] <keyval id="profile"/>/no-multilib *
296 [4] <keyval id="profile"/>/server
297 </pre>
298
299 <note>
300 The <c>developer</c> subprofile is specifically for Gentoo Linux development
301 tasks. It is <e>not</e> meant to help set up general development environments.
302 </note>
303
304 </body>
305 </subsection>
306 <subsection id="configure_USE">
307 <title>Configuring the USE variable</title>
308 <body>
309
310 <p>
311 <c>USE</c> is one of the most powerful variables Gentoo provides to its users.
312 Several programs can be compiled with or without optional support for certain
313 items. For instance, some programs can be compiled with gtk-support, or with
314 qt-support. Others can be compiled with or without SSL support. Some programs
315 can even be compiled with framebuffer support (svgalib) instead of X11 support
316 (X-server).
317 </p>
318
319 <p>
320 Most distributions compile their packages with support for as much as possible,
321 increasing the size of the programs and startup time, not to mention an enormous
322 amount of dependencies. With Gentoo you can define what options a package
323 should be compiled with. This is where <c>USE</c> comes into play.
324 </p>
325
326 <p>
327 In the <c>USE</c> variable you define keywords which are mapped onto
328 compile-options. For instance, <e>ssl</e> will compile ssl-support in the
329 programs that support it. <e>-X</e> will remove X-server support (note the
330 minus sign in front). <e>gnome gtk -kde -qt4</e> will compile your
331 programs with gnome (and gtk) support, and not with kde (and qt) support,
332 making your system fully tweaked for GNOME.
333 </p>
334
335 <p>
336 The default <c>USE</c> settings are placed in the <path>make.defaults</path>
337 files of your profile. You will find <path>make.defaults</path> files in the
338 directory which <path>/etc/portage/make.profile</path> points to and all parent
339 directories as well. The default <c>USE</c> setting is the sum of all <c>USE</c>
340 settings in all <path>make.defaults</path> files. What you place in
341 <path>/etc/portage/make.conf</path> is calculated against these defaults
342 settings. If you add something to the <c>USE</c> setting, it is added to the
343 default list. If you remove something from the <c>USE</c> setting (by placing
344 a minus sign in front of it) it is removed from the default list (if it was
345 in the default list at all). <e>Never</e> alter anything inside the
346 <path>/etc/portage/make.profile</path> directory; it gets overwritten when
347 you update Portage!
348 </p>
349
350 <p>
351 A full description on <c>USE</c> can be found in the second part of the Gentoo
352 Handbook, <uri link="?part=2&amp;chap=2">USE flags</uri>. A full description on
353 the available USE flags can be found on your system in
354 <path>/usr/portage/profiles/use.desc</path>.
355 </p>
356
357 <pre caption="Viewing available USE flags">
358 # <i>less /usr/portage/profiles/use.desc</i>
359 <comment>(You can scroll using your arrow keys, exit by pressing 'q')</comment>
360 </pre>
361
362 <p>
363 As an example we show a <c>USE</c> setting for a KDE-based system with DVD, ALSA
364 and CD Recording support:
365 </p>
366
367 <pre caption="Opening /etc/portage/make.conf">
368 # <i>nano -w /etc/portage/make.conf</i>
369 </pre>
370
371 <pre caption="USE setting">
372 USE="-gtk -gnome qt4 kde dvd alsa cdr"
373 </pre>
374
375 </body>
376 </subsection>
377 </section>
378 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20