/[gentoo]/xml/htdocs/doc/en/gentoo-x86-quickinstall.xml
Gentoo

Contents of /xml/htdocs/doc/en/gentoo-x86-quickinstall.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.79 - (hide annotations) (download) (as text)
Mon Sep 24 07:51:53 2007 UTC (6 years, 11 months ago) by jkt
Branch: MAIN
Changes since 1.78: +8 -3 lines
File MIME type: application/xml
#193409, new users should follow the handbook instead

1 swift 1.1 <?xml version='1.0' encoding="UTF-8"?>
2 jkt 1.79 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoo-x86-quickinstall.xml,v 1.78 2007/06/01 22:58:24 rane Exp $ -->
3 swift 1.8
4     <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
5    
6 neysx 1.52 <guide link="/doc/en/gentoo-x86-quickinstall.xml" lang="en">
7 neysx 1.31 <title>Gentoo Linux x86 Quick Install Guide</title>
8 swift 1.38
9     <author title="Author">
10 neysx 1.52 <mail link="neysx@gentoo.org">Xavier Neys</mail>
11     </author>
12     <author title="Author">
13 nightmorph 1.67 <mail link="swift@gentoo.org">Sven Vermeulen</mail>
14 swift 1.1 </author>
15 swift 1.38 <author title="Author">Steven Wagner</author>
16 swift 1.1
17     <abstract>
18 neysx 1.52 The Quick install guide covers the Gentoo install process in a non-verbose
19     manner. Its purpose is to allow users to perform a stage3 install in no time.
20     Users should already have prior experience with installing Gentoo Linux if they
21     want to follow this guide.
22 swift 1.2 </abstract>
23    
24 swift 1.44 <!-- The content of this document is licensed under the CC-BY-SA license -->
25     <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
26 swift 1.1 <license/>
27 swift 1.2
28 jkt 1.79 <version>20</version>
29     <date>2007-09-24</date>
30 neysx 1.52
31     <chapter>
32     <title>Introduction</title>
33     <section>
34     <body>
35    
36     <p>
37     This guide contains all commands you should use to complete a stage3
38     installation of Gentoo. You need a connection to the Internet to download the
39     stage3 and Portage snapshots.
40     </p>
41    
42     <p>
43 jkt 1.79 New users should read the <uri link="/doc/en/handbook/index.xml">Handbook</uri>
44     as it gives a better overview about the installation process.
45     </p>
46    
47     <p>
48 neysx 1.52 Timing output follows all commands that take more than a couple of seconds to
49 nightmorph 1.63 finish. Commands were timed on an AMD 2000 1.66 Ghz PC with 512 MB of RAM and
50 neysx 1.52 two SATA disks connected to a hardware controller.
51     </p>
52    
53     <pre caption="Test box specs">
54     <comment>(The following specs and the timing information should help you determine
55     a rough estimate of the time you need to complete your install)</comment>
56    
57     # <i>grep bogo /proc/cpuinfo</i>
58 rane 1.55 bogomips : 3337.81
59 neysx 1.52
60     # <i>hdparm -tT /dev/sda</i>
61     /dev/sda:
62     Timing cached reads: 1100 MB in 2.00 seconds = 549.97 MB/sec
63     Timing buffered disk reads: 224 MB in 3.01 seconds = 74.36 MB/sec
64    
65     # <i>grep MemTotal /proc/meminfo</i>
66     MemTotal: 509248 kB
67     </pre>
68    
69     </body>
70     </section>
71     </chapter>
72 swift 1.1
73     <chapter>
74 neysx 1.31 <title>Quick Install Guide</title>
75 aaby 1.7 <section>
76 swift 1.38 <title>Installation Media</title>
77     <body>
78    
79     <p>
80     Download a CD from one of our <uri link="/main/en/mirrors.xml">mirrors</uri>.
81 neysx 1.52 You can find the minimal CD ISO in
82     <path>releases/x86/&lt;release&gt;/installcd</path> or the LiveCD ISO in
83     <path>releases/x86/&lt;release&gt;/livecd</path>. The <e>minimal</e>
84     installation CD is only useful for Internet-based installations. You can use
85     the <e>LiveCD</e> to perform a networkless installation as documented in the
86 neysx 1.73 <uri link="/doc/en/handbook/2007.0/handbook-x86.xml">2007.0 x86 installation
87 neysx 1.52 handbook</uri>. The minimal CD is recommended.
88 swift 1.38 </p>
89    
90     <p>
91 neysx 1.52 <uri link="/doc/en/faq.xml#isoburning">Burn</uri> the CD and boot it.
92 swift 1.38 </p>
93    
94 neysx 1.52 </body>
95     </section>
96     <section>
97     <title>Booting the CD</title>
98     <body>
99    
100 swift 1.38 <p>
101 neysx 1.52 Press
102     <c>F2</c> at the boot screen to find out what boot options exist. You can
103     either start <c>gentoo</c> or <c>gentoo-nofb</c>, the latter disables the
104     framebuffer. If you booted the LiveCD, don't forget to add the <c>nox</c>
105     option to prevent the X graphical environment from starting. Several options
106     allow to enable or disable some features. If all goes well, your hardware will
107     be detected and all modules will be loaded. If the kernel fails to boot
108     properly or if your computer hangs during the boot procedure, you may have to
109 neysx 1.62 experiment with different configurations. The safest way is probably to use the
110 rane 1.55 <c>nodetect</c> option and then load required modules explicitly.
111 neysx 1.52 </p>
112    
113     <pre caption="Boot the minimal CD">
114     Gentoo Linux Installation LiveCD http://www.gentoo.org
115     Enter to Boot; F1 for kernels F2 for options.
116     boot: <i>gentoo-nofb</i>
117     <comment>(or in case of problems)</comment>
118     boot: <i>gentoo-nofb nodetect</i>
119     </pre>
120    
121     </body>
122     </section>
123     <section>
124     <title>Optional: loading modules</title>
125     <body>
126    
127     <p>
128     If you used the <c>nodetect</c> option, once booted, load the required modules.
129     You need to enable networking and have access to your disks. The <c>lspci</c>
130     command can help you identify your hardware.
131 swift 1.38 </p>
132    
133 neysx 1.52 <pre caption="Load required modules">
134     livecd root # <i>lspci</i>
135     <comment>(Use lspci's output to identify required modules)</comment>
136    
137     <comment>(The following is an example, adapt it to your hardware)</comment>
138     livecd root # <i>modprobe 3w-9xxx</i>
139     livecd root # <i>modprobe r8169</i>
140     </pre>
141    
142 swift 1.38 </body>
143     </section>
144     <section>
145     <title>Network Configuration</title>
146 swift 1.1 <body>
147    
148     <p>
149 swift 1.38 If your network does not work already, you can use <c>net-setup</c> to configure
150     your network. You might need to load support for your network card using
151     <c>modprobe</c> prior to the configuration. If you have ADSL, use
152 nightmorph 1.59 <c>pppoe-setup</c> and <c>pppoe-start</c>. For PPTP support, first edit
153 swift 1.38 <path>/etc/ppp/chap-secrets</path> and <path>/etc/ppp/options.pptp</path> and
154     then use <c>pptp &lt;server&nbsp;ip&gt;</c>.
155     </p>
156    
157     <p>
158     For wireless access, use <c>iwconfig</c> to set the wireless parameters and then
159 swift 1.44 use either <c>net-setup</c> again or run <c>ifconfig</c>, <c>dhcpcd</c> and/or
160 swift 1.38 <c>route</c> manually.
161 swift 1.1 </p>
162    
163     <p>
164 swift 1.44 If you are behind a proxy, do not forget to initialize your system using
165 swift 1.38 <c>export http_proxy</c>, <c>ftp_proxy</c> and <c>RSYNC_PROXY</c>.
166     </p>
167    
168 neysx 1.52 <pre caption="Configure networking the guided way">
169     livecd root # <i>net-setup eth0</i>
170     </pre>
171    
172     <p>
173     Alternatively, you can start networking manually. The following example assigns
174 rane 1.55 the IP address 192.168.1.10 to your PC and defines 192.168.1.1 as your router
175 neysx 1.52 and name server.
176     </p>
177    
178     <pre caption="Configure networking the manual way">
179     livecd root # <i>ifconfig eth0 192.168.1.10/24</i>
180 neysx 1.75 livecd root # <i>route add default gw 192.168.1.1</i>
181 nightmorph 1.59 livecd root # <i>echo nameserver 192.168.1.1 &gt; /etc/resolv.conf</i>
182 neysx 1.52 </pre>
183    
184     <p>
185     The installation CD allows you to start an <c>sshd</c> server, add additional
186     users, run <c>irssi</c> (a command-line chat client) and surf the web using
187     <c>lynx</c> or <c>links</c>.
188     </p>
189    
190     </body>
191     </section>
192     <section>
193     <title>Optional: connect to your new box over ssh</title>
194     <body>
195    
196     <p>
197     The most interesting feature is of course <c>sshd</c>. You can start it and
198     then connect from another machine and cut and paste commands from this guide.
199     </p>
200    
201     <pre caption="Start sshd">
202     livecd root # <i>time /etc/init.d/sshd start</i>
203     * Generating hostkey ...
204     <comment>(sshd generates the key and displays more output)</comment>
205     * starting sshd ... [ok]
206    
207     real 0m13.688s
208     user 0m9.420s
209     sys 0m0.090s
210     </pre>
211    
212     <p>
213     Now, set the root password on the liveCD so that you can connect to it from
214     another PC. Please note that allowing root to connect over ssh is not
215     recommended under normal circumstances. If you can't trust your local network,
216     use a long and complex password, you should use it only once as it will
217 rane 1.53 disappear after your first reboot.
218 neysx 1.52 </p>
219    
220     <pre caption="Set the root password">
221     livecd root # <i>passwd</i>
222     New UNIX password: <comment>type_a_password</comment>
223     Retype new UNIX password: <comment>type_a_password</comment>
224     passwd: password updated successfully
225     </pre>
226    
227     <p>
228     Now, you can start a terminal on another PC and connect to your new box, follow
229     the rest of this guide in another window, and cut and paste commands.
230     </p>
231    
232     <pre caption="Connect to your new box from another PC">
233 rane 1.55 <comment>(Use the IP address of your new box)</comment>
234 neysx 1.52 $ <i>ssh root@192.168.1.10</i>
235     The authenticity of host '192.168.1.10 (192.168.1.10)' can't be established.
236     RSA key fingerprint is 96:e7:2d:12:ac:9c:b0:94:90:9f:40:89:b0:45:26:8f.
237     Are you sure you want to continue connecting (yes/no)? <i>yes</i>
238     Warning: Permanently added '192.168.1.10' (RSA) to the list of known hosts.
239     Password: <comment>type_the_password</comment>
240     </pre>
241    
242 swift 1.38 </body>
243     </section>
244     <section>
245     <title>Preparing the Disks</title>
246     <body>
247    
248     <p>
249     Use <c>fdisk</c> or <c>cfdisk</c> to create your partition layout. You need at
250 neysx 1.52 least a swap partition (type 82) and one Linux partition (type 83). The
251     following scenario creates a <path>/boot</path>, a swap and a main partition
252     as used in our handbook. The device name is likely to be either
253     <path>/dev/sda</path> for a SATA or SCSI disk, or <path>/dev/hda</path> for an
254     IDE disk.
255     </p>
256    
257     <pre caption="Create the partitions">
258     livecd ~ # <i>fdisk /dev/sda</i>
259    
260     <comment>(The rest of this guide uses the following partitioning scheme)</comment>
261     livecd ~ # <i>fdisk -l /dev/sda</i>
262    
263     Disk /dev/sda: 599.9 GB, 599978409984 bytes
264     255 heads, 63 sectors/track, 72943 cylinders
265     Units = cylinders of 16065 * 512 = 8225280 bytes
266    
267     Device Boot Start End Blocks Id System
268     /dev/sda1 1 12 96358+ 83 Linux
269     /dev/sda2 13 110 787185 82 Linux swap / Solaris
270     /dev/sda3 111 72943 585031072+ 83 Linux
271     </pre>
272 swift 1.38
273     <p>
274     Use <c>mke2fs</c>, <c>mke2fs -j</c>, <c>mkreiserfs</c>, <c>mkfs.xfs</c> and
275 swift 1.44 <c>mkfs.jfs</c> to create file systems on your Linux partitions. Initialize your
276 swift 1.38 swap partition using <c>mkswap</c> and <c>swapon</c>.
277     </p>
278    
279 neysx 1.52 <pre caption="Create the file systems and activate swap">
280     <comment>(ext2 is all you need on the /boot partition)</comment>
281     livecd ~ # <i>mke2fs /dev/sda1</i>
282    
283     <comment>(Let's use ext3 on the main partition)</comment>
284 nightmorph 1.74 livecd ~ # <i>mke2fs -j /dev/sda3</i>
285 neysx 1.52
286     <comment>(Create and activate swap)</comment>
287     livecd ~ # <i>mkswap /dev/sda2 &amp;&amp; swapon /dev/sda2</i>
288     </pre>
289    
290 swift 1.38 <p>
291     Mount the freshly created file systems on <path>/mnt/gentoo</path>. Create
292     directories for the other mount points (like <path>/mnt/gentoo/boot</path>) if
293 neysx 1.52 you need them and mount them too.
294 swift 1.38 </p>
295    
296 neysx 1.52 <pre caption="Mount the file systems">
297     livecd ~ # <i>mount /dev/sda3 /mnt/gentoo</i>
298     livecd ~ # <i>mkdir /mnt/gentoo/boot</i>
299     livecd ~ # <i>mount /dev/sda1 /mnt/gentoo/boot</i>
300     </pre>
301    
302 swift 1.38 </body>
303     </section>
304     <section>
305     <title>Setting Up The Stage</title>
306     <body>
307    
308     <p>
309 neysx 1.52 First make sure your date and time is set correctly using <c>date
310     MMDDhhmmYYYY</c>. Use UTC time.
311 swift 1.38 </p>
312    
313 neysx 1.52 <pre caption="Set the date and UTC time">
314     <comment>(Check the clock)</comment>
315     livecd ~ # <i>date</i>
316     Mon Mar 6 00:14:13 UTC 2006
317    
318     <comment>(Set the current date and time if required)</comment>
319     livecd ~ # <i>date 030600162006</i> <comment>(Format is MMDDhhmmYYYY)</comment>
320     Mon Mar 6 00:16:00 UTC 2006
321     </pre>
322    
323 swift 1.38 <p>
324 neysx 1.52 Next, download a stage from one of our <uri
325     link="/main/en/mirrors.xml">mirrors</uri>. Go to <path>/mnt/gentoo</path> and
326     unpack the stage using <c>tar xjpf &lt;stage3 tarball&gt;</c>.
327 swift 1.38 </p>
328    
329 neysx 1.52 <pre caption="Download a stage3 archive">
330     livecd ~ # <i>cd /mnt/gentoo</i>
331     livecd gentoo # <i>links http://www.gentoo.org/main/en/mirrors.xml</i>
332 neysx 1.73 <comment>(Pick a mirror, move to the releases/x86/current/stages directory highlight the
333     stage3 of your choice, probably the i686 stage3 and press D to download it)</comment>
334 neysx 1.52
335     <comment>(<b>Or</b> download it directly with wget without choosing a nearby mirror)</comment>
336     livecd ~ # <i>cd /mnt/gentoo</i>
337 neysx 1.73 livecd gentoo # <i>wget ftp://gentoo.osuosl.org/pub/gentoo/releases/x86/current/stages/stage3-i686*tar.bz2</i>
338 neysx 1.52 </pre>
339    
340     <pre caption="Unpack the stage3 archive">
341     livecd gentoo # <i>time tar xjpf stage3*</i>
342    
343     real 1m13.157s
344     user 1m2.920s
345     sys 0m7.230s
346     </pre>
347    
348 swift 1.38 <p>
349 neysx 1.52 Install the latest Portage snapshot. Proceed as for the stage3 archive: choose
350     a nearby mirror from our <uri link="/main/en/mirrors.xml">list</uri>, download
351     the latest snapshot and unpack it.
352 swift 1.47 </p>
353    
354 neysx 1.52 <pre caption="Download the latest Portage snapshot">
355     livecd gentoo # <i>cd /mnt/gentoo/usr</i>
356     livecd usr # <i>links http://www.gentoo.org/main/en/mirrors.xml</i>
357     <comment>(Pick a mirror, move to the snapshots/ directory,
358     highlight <b>portage-latest.tar.bz2</b> and press D to download it)</comment>
359    
360     <comment>(<b>Or</b> download it directly with wget without choosing a nearby mirror)</comment>
361     livecd gentoo # <i>cd /mnt/gentoo/usr</i>
362     livecd usr # <i>wget http://gentoo.osuosl.org/snapshots/portage-latest.tar.bz2</i>
363     </pre>
364    
365     <pre caption="Unpack the Portage snapshot">
366     livecd usr # <i>time tar xjf portage*</i>
367    
368     real 0m51.523s
369     user 0m28.680s
370     sys 0m12.840s
371     </pre>
372    
373     </body>
374     </section>
375     <section>
376     <title>Chrooting</title>
377     <body>
378    
379 swift 1.47 <p>
380 neysx 1.52 Mount the <path>/proc</path> file system, copy over the
381     <path>/etc/resolv.conf</path> file, then chroot into your Gentoo environment.
382 swift 1.38 </p>
383    
384 neysx 1.52 <pre caption="Chroot">
385     livecd usr # <i>cd /</i>
386     livecd / # <i>mount -t proc proc /mnt/gentoo/proc</i>
387     livecd / # <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/</i>
388     livecd / # <i>chroot /mnt/gentoo /bin/bash</i>
389     livecd / # <i>env-update &amp;&amp; source /etc/profile</i>
390     >>> Regenerating /etc/ld.so.cache...
391     </pre>
392    
393 swift 1.38 </body>
394     </section>
395     <section>
396 neysx 1.73 <title>Set your time zone</title>
397 swift 1.38 <body>
398    
399     <p>
400 nightmorph 1.74 Set your time zone information by using the correct listing in
401     <path>/usr/share/zoneinfo</path>.
402 swift 1.38 </p>
403    
404 nightmorph 1.71 <pre caption="Setting your timezone">
405 nightmorph 1.74 livecd / # <i>ls /usr/share/zoneinfo</i>
406 neysx 1.73 <comment>(Using Brussels as an example)</comment>
407 neysx 1.75 livecd / # <i>cp /usr/share/zoneinfo/Europe/Brussels /etc/localtime</i>
408 nightmorph 1.74
409 neysx 1.52 livecd / # <i>date</i>
410     Wed Mar 8 00:46:05 CET 2006
411 swift 1.1 </pre>
412    
413 neysx 1.52 </body>
414     </section>
415     <section>
416     <title>Set your host and domain name</title>
417     <body>
418 swift 1.1
419     <p>
420 neysx 1.52 Set your host name in <path>/etc/conf.d/hostname</path> and
421     <path>/etc/hosts</path>. In the following example, we use <c>mybox</c> as host
422     name and <c>at.myplace</c> as domain name. You can either edit the config
423     files with <c>nano</c> or use the following commands:
424 swift 1.1 </p>
425    
426 neysx 1.52 <pre caption="Set host and domain name">
427     livecd / # <i>cd /etc</i>
428     livecd etc # <i>echo "127.0.0.1 mybox.at.myplace mybox localhost" > hosts</i>
429     livecd etc # <i>sed -i -e 's/HOSTNAME.*/HOSTNAME="mybox"/' conf.d/hostname</i>
430     <comment>(Use defined host name and check)</comment>
431     livecd etc # <i>hostname mybox</i>
432     livecd etc # <i>hostname -f</i>
433     mybox.at.myplace
434     </pre>
435 swift 1.38
436     </body>
437     </section>
438     <section>
439     <title>Kernel Configuration</title>
440     <body>
441    
442 swift 1.1 <p>
443 nightmorph 1.69 Install a kernel source (usually <c>gentoo-sources</c>), configure it, compile
444     it and copy the <path>arch/i386/boot/bzImage</path> file to <path>/boot</path>.
445 neysx 1.52 </p>
446    
447     <pre caption="Install a kernel source, compile it and install the kernel">
448 neysx 1.61 livecd etc # <i>time emerge gentoo-sources</i>
449 neysx 1.52
450     real 2m51.435s
451     user 0m58.220s
452     sys 0m29.890s
453 neysx 1.61 livecd etc # <i>cd /usr/src/linux</i>
454 neysx 1.52 livecd linux # <i>make menuconfig</i>
455     <comment>(Configure your kernel)</comment>
456     livecd linux # <i>time make -j2</i>
457    
458     <comment>(Elapsed time depends highly on the options you selected)</comment>
459     real 3m51.962s
460     user 3m27.060s
461     sys 0m24.310s
462 swift 1.38
463 neysx 1.52 livecd linux # <i>make modules_install</i>
464     livecd linux # <i>cp arch/i386/boot/bzImage /boot/kernel</i>
465     </pre>
466 swift 1.1
467 swift 1.38 </body>
468     </section>
469     <section>
470 neysx 1.52 <title>Configure the system</title>
471 swift 1.38 <body>
472 swift 1.1
473     <p>
474 neysx 1.52 Edit your <path>/etc/fstab</path> and replace <c>BOOT</c>, <c>ROOT</c> and
475     <c>SWAP</c> with the actual partition names. Don't forget to check that the
476     file systems match your installation.
477 swift 1.1 </p>
478    
479 swift 1.38 <pre caption="Example fstab">
480 neysx 1.52 livecd linux # <i>cd /etc</i>
481     livecd etc # <i>nano -w fstab</i>
482     /dev/<i>sda1</i> /boot ext2 noauto,noatime 1 2
483     /dev/<i>sda3</i> / ext3 noatime 0 1
484     /dev/<i>sda2</i> none swap sw 0 0
485 swift 1.1 </pre>
486    
487     <p>
488 neysx 1.52 Configure your network in <path>/etc/conf.d/net</path>. Add the <c>net.eth0</c>
489     init script to the default run level. If you have multiple NICs, symlink them
490     to the <c>net.eth0</c> init script and add them to the default run level as
491     well. Either edit <path>/etc/conf.d/net</path> with <c>nano</c> or use the
492     following commands:
493     </p>
494    
495     <pre caption="Configure networking">
496     livecd etc # <i>cd conf.d</i>
497     livecd conf.d # <i>echo 'config_eth0=( "192.168.1.10/24" )' >> net</i>
498 nightmorph 1.74 livecd conf.d # <i>echo 'routes_eth0=( "default via 192.168.1.1" )' >> net</i>
499 neysx 1.52 livecd conf.d # <i>rc-update add net.eth0 default</i>
500     <comment>(If you compiled your network card driver as a module,
501     add it to /etc/modules.autoload.d/kernel-2.6)</comment>
502     livecd conf.d # <i>echo r8169 >> /etc/modules.autoload.d/kernel-2.6</i>
503     <comment>(If you want to reconnect via ssh after you have rebooted your new box:)</comment>
504     livecd conf.d # <i>rc-update add sshd default</i>
505 swift 1.1 </pre>
506    
507 neysx 1.52 <note>
508 nightmorph 1.70 Emerge <c>pcmciautils</c> if you need support for PCMCIA cards.
509 neysx 1.52 </note>
510 swift 1.1
511 swift 1.38 <p>
512     Set the root password using <c>passwd</c>.
513     </p>
514 swift 1.1
515 neysx 1.52 <pre caption="Set the root password">
516     livecd conf.d # <i>passwd</i>
517     New UNIX password: <comment>type_the_password</comment>
518     Retype new UNIX password: <comment>type_the_password_again</comment>
519     passwd: password updated successfully
520     </pre>
521    
522 swift 1.1 <p>
523 nightmorph 1.77 Edit <path>/etc/conf.d/clock</path> to define the time zone you used
524     previously.
525     </p>
526    
527     <pre caption="Edit /etc/conf.d/clock">
528     livecd conf.d # <i>nano -w /etc/conf.d/clock</i>
529     TIMEZONE="Europe/Brussels"
530     </pre>
531    
532     <p>
533 neysx 1.73 Check the system configuration in <path>/etc/rc.conf</path>,
534     <path>/etc/conf.d/rc</path>, <path>/etc/conf.d/keymaps</path> and edit any of
535     those files if required.
536 swift 1.1 </p>
537    
538 neysx 1.52 <pre caption="Optional: edit some config files">
539     livecd conf.d # <i>nano -w /etc/rc.conf</i>
540     livecd conf.d # <i>nano -w /etc/conf.d/rc</i>
541     livecd conf.d # <i>nano -w /etc/conf.d/keymaps</i>
542     </pre>
543    
544 swift 1.38 </body>
545     </section>
546     <section>
547     <title>Installing System Tools</title>
548     <body>
549    
550     <p>
551 neysx 1.52 Install a system logger like <c>syslog-ng</c> and a cron daemon like
552     <c>vixie-cron</c>, and add them to the default run level.
553 swift 1.38 </p>
554 swift 1.1
555 neysx 1.52 <note>
556     Cron daemons depend on an MTA. <c>mail-mta/ssmtp</c> will be pulled in as a
557     dependency. If you want to use a more advanced MTA, you might want to install
558     it now. If you are in a hurry, let ssmtp be installed and remove it later when
559     you install the MTA of your choice.
560     </note>
561    
562     <pre caption="Install a syslogger and a cron daemon">
563     livecd conf.d # <i>time emerge syslog-ng vixie-cron</i>
564    
565     real 1m52.699s
566     user 1m1.630s
567     sys 0m35.220s
568     livecd conf.d # <i>rc-update add syslog-ng default</i>
569     livecd conf.d # <i>rc-update add vixie-cron default</i>
570     </pre>
571 swift 1.1
572 swift 1.38 <p>
573     Install the necessary file system tools (<c>xfsprogs</c>, <c>reiserfsprogs</c>
574 nightmorph 1.70 or <c>jfsutils</c>) and networking tools (<c>dhcpcd</c> or <c>ppp</c>) if you
575     need any.
576 swift 1.38 </p>
577 swift 1.1
578 neysx 1.52 <pre caption="Install extra tools if required">
579 neysx 1.75 livecd conf.d # <i>emerge xfsprogs</i> <comment>(If you use the XFS file system)</comment>
580     livecd conf.d # <i>emerge jfsutils</i> <comment>(If you use the JFS file system)</comment>
581     livecd conf.d # <i>emerge reiserfsprogs</i> <comment>(If you use the Reiser file system)</comment>
582     livecd conf.d # <i>emerge dhcpcd</i> <comment>(If you need a DHCP client)</comment>
583     livecd conf.d # <i>emerge ppp</i> <comment>(If you need PPPoE ADSL connectivity)</comment>
584 neysx 1.52 </pre>
585    
586 swift 1.38 </body>
587     </section>
588     <section>
589     <title>Configuring the Bootloader</title>
590     <body>
591 swift 1.1
592     <p>
593 neysx 1.52 Emerge <c>grub</c> or <c>lilo</c>. Configure either
594     <path>/boot/grub/grub.conf</path> or <path>/etc/lilo.conf</path> and install
595     the bootloader you have emerged.
596     </p>
597    
598     <p>
599     <b>1. Using grub</b>
600 swift 1.1 </p>
601    
602 neysx 1.52 <pre caption="Emerge grub and edit its configuration file">
603     livecd conf.d # <i>time emerge grub</i>
604    
605     real 1m8.634s
606     user 0m39.460s
607     sys 0m15.280s
608     livecd conf.d # <i>nano -w /boot/grub/grub.conf</i>
609     </pre>
610    
611 swift 1.38 <pre caption="Example grub.conf">
612 swift 1.9 default 0
613 neysx 1.52 timeout 10
614 swift 1.9
615 neysx 1.52 title=Gentoo
616 swift 1.38 root (hd0,0)
617 neysx 1.52 kernel /boot/kernel root=/dev/sda3
618     </pre>
619    
620     <pre caption="Install grub">
621     livecd conf.d # <i>grub</i>
622     Probing devices to guess BIOS drives. This may take a long time.
623    
624     grub> <i>root (hd0,0)</i>
625     Filesystem type is ext2fs, partition type 0x83
626    
627     grub> <i>setup (hd0)</i>
628     Checking if "/boot/grub/stage1" exists... yes
629     Checking if "/boot/grub/stage2" exists... yes
630     Checking if "/boot/grub/e2fs_stage1_5" exists... yes
631     Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
632     succeeded
633     Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 /boot/
634     grub/menu.lst"... succeeded
635     Done.
636    
637     grub> <i>quit</i>
638     </pre>
639    
640     <p>
641     Now, proceed with the <uri link="#reboot">rebooting section</uri>.
642     </p>
643    
644     <p>
645     <b>2. Using lilo</b>
646     </p>
647 swift 1.38
648 neysx 1.52 <pre caption="Emerge lilo and edit its configuration file">
649     livecd conf.d # <i>time emerge lilo</i>
650 swift 1.38
651 neysx 1.52 real 0m47.016s
652     user 0m22.770s
653     sys 0m5.980s
654     livecd conf.d # <i>nano -w /etc/lilo.conf</i>
655 swift 1.9 </pre>
656    
657 swift 1.38 <pre caption="Example lilo.conf">
658 neysx 1.52 boot=/dev/sda
659 swift 1.9 prompt
660 swift 1.11 timeout=50
661 swift 1.9 default=gentoo
662    
663 neysx 1.52 image=/boot/kernel
664     label=Gentoo
665 swift 1.38 read-only
666 neysx 1.52 root=/dev/sda3
667     </pre>
668 swift 1.38
669 neysx 1.52 <pre caption="Install lilo">
670     livecd conf.d # <i>lilo</i>
671     Added Gentoo *
672     </pre>
673    
674     </body>
675     </section>
676     <section id="reboot">
677     <title>Reboot</title>
678     <body>
679    
680     <p>
681     Exit the chrooted environment, unmount all file systems and reboot:
682     </p>
683    
684     <pre caption="Reboot">
685     livecd conf.d # <i>exit</i>
686     livecd / # <i>umount /mnt/gentoo/proc /mnt/gentoo/boot /mnt/gentoo</i>
687     livecd / # <i>reboot</i>
688     <comment>(Don't forget to remove the CD)</comment>
689     </pre>
690    
691     </body>
692     </section>
693     <section id="after-reboot">
694     <title>Finalizing the Installation</title>
695     <body>
696    
697     <note>
698 rane 1.54 The <b>total</b> elapsed time between the display of the boot prompt on the
699     minimal CD and the display of the login prompt after the reboot was
700 neysx 1.52 <b>00:42:31</b> on our test box. Yes, less than one hour! Note that this time
701     also includes the stage3, Portage snapshot and several packages download time
702     and the time spent configuring the kernel.
703     </note>
704    
705     <p>
706     Log in as <c>root</c>, then add one or more users for daily use with
707     <c>useradd</c>.
708     </p>
709    
710     <pre caption="Connect to your new box from another PC">
711     <comment>(Clean up your known_hosts file because your new box
712     has generated a new definitive hostkey)</comment>
713     $ <i>nano -w ~/.ssh/known_hosts</i>
714     <comment>(Look for the IP of your new PC and delete the line,
715     then save the file and exit nano)</comment>
716    
717 rane 1.55 <comment>(Use the IP address of your new box)</comment>
718 neysx 1.52 $ <i>ssh root@192.168.1.10</i>
719     The authenticity of host '192.168.1.10 (192.168.1.10)' can't be established.
720     RSA key fingerprint is 96:e7:2d:12:ac:9c:b0:94:90:9f:40:89:b0:45:26:8f.
721     Are you sure you want to continue connecting (yes/no)? <i>yes</i>
722     Warning: Permanently added '192.168.1.10' (RSA) to the list of known hosts.
723     Password: <comment>type_the_password</comment>
724     </pre>
725    
726     <pre caption="Add a new user">
727     mybox ~ # <i>adduser -g users -G lp,wheel,audio,cdrom,portage,cron -m john</i>
728     mybox ~ # <i>passwd john</i>
729     New UNIX password: <comment>Set John's password</comment>
730     Retype new UNIX password: <comment>Type John's password again</comment>
731     passwd: password updated successfully
732     </pre>
733    
734     </body>
735     </section>
736     <section>
737     <title>Last configuration touches</title>
738     <body>
739    
740     <p>
741 rane 1.78 Start by selecting nearby mirrors either by defining the <c>SYNC</c> and
742 neysx 1.52 <c>GENTOO_MIRRORS</c> variables in <path>/etc/make.conf</path> or by using
743     <c>mirrorselect</c>. You can also define the number of concurrent compilation
744     processes at this point.
745     </p>
746    
747     <pre caption="Use mirrorselect and set MAKEOPTS">
748     mybox ~ # <i>emerge mirrorselect</i>
749     mybox ~ # <i>mirrorselect -i -o >> /etc/make.conf</i>
750     mybox ~ # <i>mirrorselect -i -r -o >> /etc/make.conf</i>
751     <comment>(Usually, (the number of processors + 1) is a good value)</comment>
752     mybox ~ # <i>echo 'MAKEOPTS="-j2"' >> /etc/make.conf</i>
753     </pre>
754    
755     <p>
756 rane 1.56 Now is a good time to enable or disable some USE flags. Run <c>emerge -vpe
757     world</c> to list all currently installed packages and their enabled and
758     disabled USE flags. Either edit <path>/etc/make.conf</path> or use the
759     following command to define the USE variable:
760 neysx 1.52 </p>
761    
762     <pre caption="View USE flags in use and enable or disable some">
763     mybox ~ # <i>emerge -vpe world</i>
764     <comment>(Portage displays the packages and their USE flags, as an example, let's
765 nightmorph 1.70 disable ipv6 and fortran, and enable unicode)</comment>
766     mybox ~ # <i>echo 'USE="nptl nptlonly -ipv6 -fortran unicode"' >> /etc/make.conf</i>
767 neysx 1.52 </pre>
768    
769     <p>
770 nightmorph 1.70 Recent versions of glibc use <path>/etc/locale.gen</path> to define locale
771 nightmorph 1.72 settings.
772 neysx 1.52 </p>
773    
774     <pre caption="Define locales">
775 neysx 1.73 mybox ~ # <i>cd /etc</i>
776     mybox etc # <i>nano -w locale.gen</i>
777 swift 1.1 </pre>
778    
779     <p>
780 neysx 1.52 Last but not least, you may want to alter the <c>CFLAGS</c> variable in your
781     <path>/etc/make.conf</path> to optimise the code to your specific needs. Please
782     note that using a long list of flags is rarely needed and can even lead to a
783     broken system. It is recommended to specify the processor type in the
784     <c>march</c> option and stick to <c>-O2 -pipe</c>.
785 swift 1.1 </p>
786    
787 swift 1.38 <p>
788 neysx 1.52 You may also want to switch to <b>~x86</b>. You should only do this if you can
789     deal with the odd broken ebuild or package. If you'd rather keep your system
790     stable, don't add the <c>ACCEPT_KEYWORDS</c> variable. Adding
791     <c>FEATURES="parallel-fetch ccache"</c> is also a good idea.
792     </p>
793    
794     <pre caption="Last edit of make.conf">
795     mybox etc # <i>nano -w make.conf</i>
796     <comment>(Set -march to your CPU type in CFLAGS)</comment>
797     CFLAGS="-O2 -march=<i>athlon-xp</i> -pipe"
798     <comment>(Add the following line)</comment>
799     FEATURES="parallel-fetch ccache"
800     <comment>(Only add the following if you know what you're doing)</comment>
801     ACCEPT_KEYWORDS="~x86"
802     </pre>
803    
804     <p>
805     You might want to recompile your whole system twice to make full use of your
806     latest configuration changes. It would take quite a long time to complete and
807 nightmorph 1.59 yield minimal speed benefits. You can let your system optimise itself gradually
808     over time when new versions of packages are released. However, recompiling is
809     a still good idea from the standpoint of maintaining system consistency. Please
810     see the <uri link="/doc/en/gcc-upgrading.xml">Gentoo GCC Upgrading Guide</uri>
811     for a discussion on the benefits of ensuring a consistently built system and
812     world.
813 swift 1.38 </p>
814    
815 neysx 1.52 <p>
816     Recompiling only the packages that have already been updated since the release
817     or that are affected by your new USE flags will take enough time. You might
818     also have to remove packages that block your upgrade. Look for "[blocks
819     <brite>B</brite> ]" in the output of <c>emerge -vpuD --newuse world</c> and
820     use <c>emerge -C</c> to remove them.
821     </p>
822    
823     <pre caption="Update your packages">
824     <comment>(Install ccache)</comment>
825     mybox etc # <i>emerge ccache</i>
826    
827 rane 1.58 <comment>(Please note that the switch to ~x86 causes many packages to be upgraded)</comment>
828 neysx 1.52 mybox etc # <i>emerge -vpuD --newuse world</i>
829     <comment>(Take a good look at the package list and their USE flags,
830     remove blocking packages if any, and start the lengthy process)</comment>
831     mybox etc # <i>time emerge -vuD --newuse world</i>
832     <comment>(79 packages have been (re)compiled)</comment>
833    
834     real 180m13.276s
835     user 121m22.905s
836     sys 36m31.472s
837    
838     <comment>(Remerge libtool to avoid further potential problems)</comment>
839     mybox etc # <i>emerge libtool</i>
840    
841     <comment>(Update config files, make sure you <b>do not</b> let etc-update
842     update config files you have edited)</comment>
843     mybox etc # <i>etc-update</i>
844    
845     <comment>(If perl has been updated, you should run the perl-cleaner script)</comment>
846     mybox etc # <i>time perl-cleaner all</i>
847     real 1m6.495s
848     user 0m42.699s
849     sys 0m10.641s
850    
851     <comment>(In case of a major upgrade of python, you should run the python-updater script)</comment>
852     mybox etc # <i>python-updater</i>
853     </pre>
854    
855 swift 1.38 </body>
856     </section>
857     <section>
858 neysx 1.52 <title>What to do next</title>
859 swift 1.38 <body>
860    
861     <p>
862 neysx 1.52 Depending on what your new Gentoo machine is supposed to do, you will probably
863     want to install server applications or a desktop system. Just as an example,
864     <c>emerge gnome</c> and <c>emerge kde</c> have been timed on the ~x86 system
865     installed as describe above. Both have been installed from the same starting
866     point.
867 swift 1.38 </p>
868    
869     <p>
870 neysx 1.52 You should check our <uri link="/doc/en/">documentation index</uri> to find out
871     how to install and configure the applications of your choice.
872 swift 1.38 </p>
873 swift 1.1
874 neysx 1.52 <impo>
875     The following is only an example. It is in no way meant as a recommended setup.
876     </impo>
877    
878     <pre caption="Emerge GNOME">
879     mybox etc # <i>emerge -vp gnome</i>
880     <comment>(Look at the list of packages and their USE flags,
881     then edit make.conf if required.</comment>
882     mybox etc # <i>nano -w /etc/make.conf</i>
883 rane 1.58 <comment>(The following USE flags have been defined)</comment>
884 neysx 1.52 USE="nptl nptlonly -ipv6 -fortran unicode svg hal dbus \
885 nightmorph 1.65 -kde -qt3 -qt4 -arts -eds -esd gnome gstreamer gtk firefox"
886 neysx 1.52
887     mybox etc # <i>time emerge gnome</i>
888     <comment>(326 packages have been emerged)</comment>
889    
890     real 520m44.532s
891     user 339m21.144s
892     sys 146m22.337s
893     </pre>
894    
895     <pre caption="Emerge KDE">
896     mybox etc # <i>emerge -vp kde-meta</i>
897     <comment>(Look at the list of packages and their USE flags,
898     then edit make.conf if required.</comment>
899     mybox etc # <i>nano -w /etc/make.conf</i>
900     <comment>The following USE flags have been defined)</comment>
901     USE="nptl nptlonly -ipv6 -fortran unicode svg hal dbus \
902 nightmorph 1.65 kde qt3 qt4 -arts -eds -esd -gnome -gstreamer -gtk -firefox"
903 neysx 1.52
904     mybox etc # <i>time emerge kde-meta</i>
905     <comment>(391 packages have been emerged)</comment>
906    
907     real 1171m25.318s
908     user 851m26.393s
909     sys 281m45.629s
910     </pre>
911 neysx 1.31
912 aaby 1.7 </body>
913     </section>
914 neysx 1.49 </chapter>
915 swift 1.1 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20