/[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.124 - (show annotations) (download) (as text)
Fri Jun 29 16:12:20 2012 UTC (2 years, 2 months ago) by swift
Branch: MAIN
Changes since 1.123: +7 -5 lines
File MIME type: application/xml
Fix bug #420159 - Add bind-mounting of /sys

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

  ViewVC Help
Powered by ViewVC 1.1.20