/[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.73 - (show annotations) (download) (as text)
Wed Apr 11 10:17:50 2007 UTC (7 years, 6 months ago) by neysx
Branch: MAIN
Changes since 1.72: +27 -21 lines
File MIME type: application/xml
Made quick guides consistent, fixed prompts and time zone setting

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

  ViewVC Help
Powered by ViewVC 1.1.20