/[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.123 - (show annotations) (download) (as text)
Sun May 6 18:44:46 2012 UTC (2 years, 2 months ago) by swift
Branch: MAIN
Changes since 1.122: +8 -3 lines
File MIME type: application/xml
Add hint about using other terminals or consoles in chroot environment, thanks to Maciej Nowak for suggesting to add it.

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

  ViewVC Help
Powered by ViewVC 1.1.20