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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.18 - (show annotations) (download) (as text)
Wed Dec 18 01:18:06 2002 UTC (15 years, 1 month ago) by zhen
Branch: MAIN
Changes since 1.17: +56 -48 lines
File MIME type: application/xml
enhancements to stage explanations and bootdisk section

1 <?xml version="1.0" encoding="UTF-8"?>
2 <?xml-stylesheet href="/xsl/guide.xsl" type="text/xsl"?>
3 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4 <guide link="/doc/en/gentoo-x86-install.xml">
5 <title>Gentoo Linux 1.4 Installation Instructions</title>
6 <author title="Chief Architect">
7 <mail link="drobbins@gentoo.org">Daniel Robbins</mail>
8 </author>
9 <author title="Author">Chris Houser</author>
10 <author title="Author">
11 <mail link="jerry@gentoo.org">Jerry Alexandratos</mail>
12 </author>
13 <author title="Ghost">
14 <mail link="g2boojum@gentoo.org">Grant Goodyear</mail>
15 </author>
16 <author title="Editor">
17 <mail link="zhen@gentoo.org">John P. Davis</mail>
18 </author>
19 <author title="Editor">
20 <mail link="Pierre-Henri.Jondot@wanadoo.fr">Pierre-Henri Jondot</mail>
21 </author>
22 <author title="Editor">
23 <mail link="stocke2@gentoo.org">Eric Stockbridge</mail>
24 </author>
25 <author title="Editor">
26 <mail link="rajiv@gentoo.org">Rajiv Manglani</mail>
27 </author>
28 <abstract>These instructions step you through the process of installing Gentoo
29 Linux 1.4_rc1. The Gentoo Linux installation process supports various installation
30 approaches, depending upon how much of the system you want to custom-build from
31 scratch.
32 </abstract>
33 <version>2.2</version>
34 <date>16 December 2002</date>
35 <chapter>
36 <title>About the Install</title>
37 <section>
38 <body>
39 <p>This new boot CD will boot from nearly any modern IDE CD-ROM drive, as well
40 as many SCSI CD-ROM, assuming that your CD-ROM and BIOS both support booting.
41 Included on the CD-ROM is Linux support for IDE (and PCI IDE)
42 (built-in to the kernel) as well as support for all SCSI devices (available as
43 modules). In addition, we provide modules for literally every kind of network
44 card that Linux supports, as well as tools to allow you to configure your
45 network and establish outbound <c>ssh</c> connections and download files.
46 </p>
47 <p>To install from the build CD, you will need to have a 486+ processor and
48 ideally at least 64 Megabytes of RAM. (Gentoo linux has been successfully
49 built with 64MB of RAM + 64MB of swap space, but the build process is awfully
50 slow under those conditions.) To begin the install process, first grab the
51 livecd ISO images from
52 <uri>http://www.ibiblio.org/gentoo/releases/1.4_rc1/</uri>. The three stages make our life
53 easy with Gentoo. The stage1 is for building the entire system from scratch. Stage2 is for building
54 some of the system from scratch, and stage3 saves a lot of time because it is already
55 optimized for you specific system. At the moment only the stage1 tarball is
56 stored on the livecd, but you will be able to download a stage2 or
57 stage3 tarball optimized for your system after booting the livecd.
58 </p>
59 <info>If for some reason your install gets interrupted at some point, you can reboot
60 and restart. For example, if you have partitioned, installed the stageX tarball, and
61 are ready to chroot, you can restart the install if necessary. Just re-boot with the
62 LiveCD, then mount your drives/partitions to <path>/mnt</path> as normal. Basically, you can do
63 this at about any point during the install, just not before partitioning for obvious reasons.
64 </info>
65 <warn>If you encounter a problem with any part of the install and wish
66 to report it as a bug, report it to <uri>bugs.gentoo.org</uri>. If the bug needs to be
67 moved upstream to the package maintainers (ie KDE) the <e>developers</e> will take care
68 of that.
69 </warn>
70 <p>Now, let's quickly review the install process. We'll create partitions,
71 create our filesystems, and extract either a stage1, stage2 or stage3 tarball.
72 If we are using a stage1 or stage2 tarball, we will take the appropriate steps
73 to get our systems to stage3. Once our systems are at stage3, we can configure
74 them (tweaking config files, installing a bootloader, etc) and boot them and
75 have a fully-functional Gentoo Linux system. Depending on what stage of the build
76 process you're starting from, here's what's required for installation:
77 </p>
78 <table>
79 <tr>
80 <th>stage tarball</th>
81 <th>requirements for installation</th>
82 </tr>
83 <tr>
84 <ti>1</ti>
85 <ti>partition/filesystem setup, emerge sync, bootstrap, emerge system, emerge linux sources, final configuration</ti>
86 </tr>
87 <tr>
88 <ti>2</ti>
89 <ti>partition/filesystem setup, emerge sync, emerge system, emerge linux sources, final configuration</ti>
90 </tr>
91 <tr>
92 <ti>3</ti>
93 <ti>partition/filesystem setup, emerge sync, final configuration</ti>
94 </tr>
95 </table>
96 </body>
97 </section>
98 </chapter>
99 <chapter>
100 <title>Booting</title>
101 <section>
102 <body>
103 <p>Start by booting the livecd. You'll be
104 greeted with a lot of text output
105 followed by the normal Gentoo Linux boot sequence.
106 Login as &quot;root&quot; (just hit &lt;enter&gt; for the password),
107 and then use the <c>passwd</c> command to change the root
108 password. (This root password is only for this installation session.
109 The reason for changing the password is that you will have to connect
110 to the net to complete the installation. Connecting to the internet with
111 the default root password is a <i>really</i> bad idea!)
112 You should have a root (&quot;<c>#</c>&quot;) prompt on the current
113 console, and can also open new consoles by typing alt-f2, alt-f3, etc and then
114 hitting enter.
115 </p>
116 <p>Next, you will be greeted with instructions for setting up your network,
117 and optional PCI autodetection. The PCI autodetection process will automatically
118 load the appropriate kernel modules for many popular PCI SCSI and ethernet
119 devices. After this, you should have a root (&quot;<c>#</c>&quot;) prompt on the current
120 console, and can also open new consoles by typing Alt-F2, Alt-F3, etc and then
121 hitting enter.
122 </p>
123 </body>
124 </section>
125 </chapter>
126 <chapter>
127 <title>Load Kernel Modules</title>
128 <section>
129 <body>
130 <p>Hopefully you need only type <c>pci-setup</c> at the root prompt to
131 autodetect the hardware on your system and to load the appropriate
132 kernel modules.
133 </p>
134 <p>If the PCI autodetection missed some of your hardware, you
135 will have to load the appropriate modules manually.
136 To view a list of all available network card modules, type <c>ls
137 /lib/modules/*/kernel/drivers/net/*</c>. To load a particular module,
138 type:
139 </p>
140 <pre caption="PCI Modules Configuration">
141 # <c>modprobe pcnet32</c>
142 <comment>(replace pcnet32 with your NIC module)</comment>
143 </pre>
144 <p>Now, if you want to be able to access any SCSI hardware that wasn't detected
145 during the PCI autodetection process, you'll need to load the appropriate
146 modules from /lib/modules, again using <c>modprobe</c>:
147 </p>
148 <pre caption="Loading SCSI Modules">
149 # <c>modprobe aic7xxx</c>
150 # <c>modprobe sd_mod</c>
151 </pre>
152 <p><c>aic7xxx</c> supports your SCSI controller and <c>sd_mod</c> supports SCSI hard disks.
153 <note>
154 Support for a SCSI CD-ROMs in build-in in the kernel.
155 </note></p>
156 <p>If you are using hardware RAID, you need to load the
157 ATA-RAID modules for your RAID controller.
158 </p>
159 <pre caption="Loading RAID Modules">
160 # <c>insmod ataraid</c>
161 # <c>insmod pdcraid</c>
162 <comment>(Promise Raid Controller)</comment>
163 # <c>insmod hptraid</c>
164 <comment>(Highpoint Raid Controller)</comment>
165 </pre>
166 <p>The Gentoo LiveCD should have enabled DMA on your disks, but if it did not,
167 <c>hdparm</c> can be used to set DMA on your drives. </p>
168 <pre caption="Setting DMA"><comment>Replace hdX with your disk device. </comment>
169 # <c>hdparm -d 1 /dev/hdX </c><comment>Enables DMA </comment>
170 # <c>hdparm -X66 /dev/hdX </c><comment>Enables Ultra-DMA </comment></pre>
171 </body>
172 </section>
173 </chapter>
174 <chapter>
175 <title>Loading PCMCIA Kernel Modules</title>
176 <section>
177 <body>
178 <p>If you have a PCMCIA network card, you will need to do some additional
179 trickery.
180 </p>
181 <warn>To avoid problems with <c>cardmgr</c>, you <e>must</e> run it <e>before</e> you enter the chroot
182 portion of the install. </warn>
183 <pre caption="Loading PCMCIA Modules">
184 # <i>insmod pcmcia_core</i>
185 # <i>insmod i82365</i>
186 # <i>insmod ds</i>
187 # <i>cardmgr -f</i>
188 </pre>
189 <p>As cardmgr detects which hardware is present, your speaker should emit a
190 few reassuring beeps, and your PCMCIA network card should hum to life. You can
191 of course insert the PCMCIA card after loading cardmgr too, if that's
192 preferable. (Technically, you need not run
193 <i>cardmgr</i> if you know exactly which module your PCMCIA card requires.
194 But if you don't, loading all PCMCIA modules and see which sticks won't work,
195 as all PCMCIA modules load obligingly and hang around for a PCMCIA card to
196 drop by. <i>cardmgr</i> will also unload the module(s) for any card when you
197 remove it). </p>
198 </body>
199 </section>
200 </chapter>
201 <chapter>
202 <title>Configuring Networking</title>
203 <section>
204 <title> PPPoE configuration</title>
205 <body>
206 <p>Assuming you need PPPoE to connect to the internet, the livecd (any version) has
207 made things easy for you by including <i>rp-pppoe</i>. Use the provided <i>adsl-setup </i>
208 script to configure your connection. You will be prompted for the ethernet
209 device that is connected to your adsl modem, your username and password,
210 the IPs of your DNS servers, and if you need a basic firewall or not. </p>
211 <pre caption="Configuring PPPoE">
212 # <c> adsl-setup </c>
213 # <c> adsl-start </c>
214 </pre>
215 <p>If something goes wrong, double-check that you correctly typed
216 your username and password by looking at <path>/etc/ppp/pap-secrets</path> or
217 <path>/etc/ppp/chap-secrets</path>, and make sure you are using the right ethernet device. </p>
218 </body>
219 </section>
220 <section>
221 <title> Automatic Network Configuration </title>
222 <body>
223 <p>The Gentoo Linux install lets you configure a working network, allowing you to use
224 <c>ssh</c>, <c>scp</c> or <c>wget</c> as needed before even beginning the installation process.
225 Even if you don't need to do these things now, you should go ahead and set up networking now.
226 Once networking is up, Portage will be able to use your configured network once you are inside
227 the chroot environment (required for installing Gentoo Linux).
228 The simplest way to set up networking is to run our new <c>net-setup</c>
229 script. </p>
230 <pre caption="Net-Setup Script">
231 # <c>net-setup eth0</c>
232 </pre>
233 <p>Of course, if you prefer, you may still set up networking manually. </p>
234 </body>
235 </section>
236 <section>
237 <title>Manual DHCP Configuration</title>
238 <body>
239 <p>Network configuration is simple with DHCP; If your ISP is not using
240 DHCP, skip down to the static configuration section below. </p>
241 <pre caption="Network configuration with DHCP">
242 # <c>dhcpcd eth0</c>
243 </pre>
244 <note>Some ISPs require you to provide a hostname. To do that,
245 add a <c>-h myhostname</c> flag to the dhcpcd command line above.
246 </note>
247 <p>If you receive <i>dhcpConfig</i> warnings, don't panic; the errors
248 are most likely cosmetic. Skip down to Network testing below.</p>
249 </body>
250 </section>
251 <section>
252 <title>Manual Static Configuration</title>
253 <body>
254 <p>We need to setup just enough networking so that we can download
255 sources for the system build, as well as the required localhost interface.
256 Type in the following commands, replacing
257 $IFACE with your network interface (typically <c>eth0</c>), $IPNUM
258 with your IP address, $BCAST with your broadcast address, and $NMASK
259 with your network mask. For the <c>route</c> command, replace
260 $GTWAY with your default gateway.
261 </p>
262 <pre caption="Static IP Network Configuration">
263 # <c>ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK</c>
264 # <c>/sbin/route add -net default gw $GTWAY netmask 0.0.0.0 metric 1</c>
265 </pre>
266 <p>Now it's time to create the <path>/etc/resolv.conf</path>
267 file so that name resolution (finding Web/FTP sites by name, rather than just by IP address) will work.</p>
268 <p>Here's a template to follow for creating your /etc/resolv.conf file: </p>
269 <pre caption="/etc/resolv.conf template">
270 domain mydomain.com
271 nameserver 10.0.0.1
272 nameserver 10.0.0.2
273 </pre>
274 <p>Replace <c>10.0.0.1</c> and <c>10.0.0.2</c> with the IP addresses of your
275 primary and secondary DNS servers respectively.</p>
276 </body>
277 </section>
278 <section>
279 <title>Proxy Configuration</title>
280 <body>
281 <p>If you are behind a proxy, it is necessary to configure your proxy before
282 you continue. We will export some variables to set up the proxy accordingly.
283 </p>
284 <pre caption="Setting a Proxy">
285 # <c>export http_proxy=&quot;machine.company.com:1234&quot; </c>
286 # <c>export ftp_proxy=&quot;$http_proxy&quot; </c>
287 # <c>export RSYNC_PROXY=&quot;$http_proxy&quot; </c>
288 </pre>
289 </body>
290 </section>
291 <section>
292 <title>Network Testing</title>
293 <body>
294 <p>Now that your network has been configured, the <c>/sbin/ifconfig -a</c> command should show
295 that your network card is working (look for <e>UP</e> and <e>RUNNING</e> in the output). </p>
296 <pre caption="/sbin/ifconfig for a working network card">
297 eth0 Link encap:Ethernet HWaddr 00:50:BA:8F:61:7A
298 inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
299 inet6 addr: fe80::50:ba8f:617a/10 Scope:Link
300 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
301 RX packets:1498792 errors:0 dropped:0 overruns:0 frame:0
302 TX packets:1284980 errors:0 dropped:0 overruns:0 carrier:0
303 collisions:1984 txqueuelen:100
304 RX bytes:485691215 (463.1 Mb) TX bytes:123951388 (118.2 Mb)
305 Interrupt:11
306 </pre>
307 <p>You may want to also try pinging your ISP's DNS server (found in <path>/etc/resolv.conf</path>),
308 and a website of choice, just to make sure that your packets are reaching the net, DNS name
309 resolution is working correctly, etc.
310 </p>
311 <pre caption="Further Network Testing">
312 # <c>ping www.some_website.com </c>
313 </pre>
314 </body>
315 </section>
316 <section>
317 <title>Networking is go!</title>
318 <body>
319 <p>Networking should now be configured and useable. You should be able to use the included
320 <c>ssh</c>, <c>scp</c> and <c>wget</c> commands to connect to other machines on your LAN or the Internet.</p>
321 </body>
322 </section>
323 </chapter>
324 <chapter>
325 <title>Partition Configuration</title>
326 <section>
327 <body>
328 <p>Now that the kernel can see the network card and disk controllers, it's time
329 to set up disk partitions for Gentoo Linux.
330 </p>
331 <p>Here's a quick overview of the standard Gentoo Linux partition layout.
332 We're going to create at least three partitions: a swap partition, a root
333 partition (to hold the bulk of Gentoo Linux), and a special boot partition.
334 The boot partition is designed to hold the GRUB or LILO boot loader information as well as
335 your Linux kernel(s). The boot partition gives us a safe place to store
336 everything related to booting Linux. During normal day-to-day Gentoo Linux use,
337 your boot partition should remain <e>unmounted</e>. This prevents your kernel
338 from being made unavailable to GRUB (due to filesystem corruption) in the event
339 of a system crash, preventing the chicken-and-egg problem where GRUB can't read
340 your kernel (since your filesystem isn't consistent) but you can't bring your
341 filesystem back to a consistent state (since you can't boot!)
342 </p>
343 <p>Now, on to filesystem types. Right now, you have four filesystem options:
344 XFS, ext2, ext3 (journaling) and ReiserFS. ext2 is the tried and true Linux
345 filesystem but doesn't have metadata journaling. ext3 is the new version of
346 ext2 with both metadata journaling and ordered data writes, effectively
347 providing data journaling as well. ReiserFS is a B*-tree based filesystem
348 that has very good small file performance, and greatly outperforms both ext2 and
349 ext3 when dealing with small files (files less than 4k), often by a factor of
350 10x-15x. ReiserFS also scales extremely well and has metadata journaling.
351 As of kernel 2.4.18+, ReiserFS is finally rock-solid and highly recommended.
352 XFS is a filesystem with metadata journaling that
353 is fully supported under Gentoo Linux's <path>xfs-sources</path> kernel, but be warned that it
354 is highly unstable at this time.
355 </p>
356 <p>If you're looking for the most standard filesystem, use ext2. If you're looking
357 for the most rugged journalled filesystem, use ext3. If you're looking for a
358 high-performance filesystem with journaling support, use ReiserFS; both ext3 and ReiserFS are
359 mature and refined. Please be careful with XFS; this filesystem has a tendency to fry lots of data
360 if the system crashes or you lose power. Originally, it seemed like a promising filesystem but it
361 now appears that this tendency to lose data is a major achilles' heel.
362 Here are our basic recommended filesystem
363 sizes and types:
364 </p>
365 <table>
366 <tr>
367 <th>Partition</th>
368 <th>Size</th>
369 <th>Type</th>
370 <th>example device</th>
371 </tr>
372 <tr>
373 <ti>boot partition, containing kernel(s) and boot information</ti>
374 <ti>100 Megabytes</ti>
375 <ti>ext2/3 highly recommended (easiest); if ReiserFS then mount with <c>-o notail</c></ti>
376 <ti>/dev/hda1</ti>
377 </tr>
378 <tr>
379 <ti>swap partition (no longer a 128 Megabyte limit)</ti>
380 <ti>&gt;=2*Amount of RAM in this system is recommended but no longer (as of kernel 2.4.10) required</ti>
381 <ti>Linux swap</ti>
382 <ti>/dev/hda2</ti>
383 </tr>
384 <tr>
385 <ti>root partition, containing main filesystem (/usr, /home, etc)</ti>
386 <ti>&gt;=1.5 Gigabytes</ti>
387 <ti>ReiserFS, ext3 recommended; ext2 ok</ti>
388 <ti>/dev/hda3</ti>
389 </tr>
390 </table>
391 <p>Before creating your partitions, it is a <e>very</e> good idea to initialize the
392 beginning of your HD using <c>dd</c>. Doing this will ensure that you have no issues with
393 mounting previously <i>fat32</i> partitions, like <path>/boot</path>
394 for example. To do this you would do:
395 </p>
396 <pre caption="Initializing first 1024 Sectors of HD">
397 # <c>dd if=/dev/zero of=/dev/hdaBOOT bs=1024 count=1024 </c>
398 <comment>BOOT is the partition that holds your <path>/boot</path>.</comment>
399 </pre>
400 <p>At this point, create your partitions using fdisk. Note that your partitions
401 should be of type 82 if swap and 83 for regular filesystems (whether ReiserFS <e>or</e> ext2/3). </p>
402 <note><i>cfdisk</i> is included on the install CD, and it is *considerably* easier to use than
403 <i>fdisk</i>. Just type <c>cfdisk</c> to run it. By default cfdisk work with <b>/dev/hda</b>. If /dev/hda is not hard disk you want to partition, give the right value to cfdisk as a parameter. For example: <c>cfdisk /dev/hde</c></note>
404 <note>Changes to the partitions don't reflect on-the-fly, so please reboot after using fdisk or cfdisk.</note>
405 <note>If you are using RAID your partitions will be a little
406 different.
407 You will have the partitions like this:
408 <path>/dev/ataraid/discX/partY</path>
409 X is the arrays you have made, so if you only have made 1
410 array, then it will
411 be disc0.Y is the partition number as in <path>/dev/hdaY</path>
412 </note>
413 <p>Once you've created your partitions, it's time to initialize
414 the filesystems that will be used to house our data. Initialize swap as follows:</p>
415 <pre caption="Initializing Swap">
416 # <c>mkswap /dev/hda2</c>
417 </pre>
418 <p>You can use the <c>mke2fs</c> command to create ext2 filesystems.</p>
419 <pre caption="Creating an ext2 Filesystem">
420 # <i>mke2fs /dev/hda1</i>
421 </pre>
422 <p>To create an XFS filesystem, use the <c>mkfs.xfs</c> command.</p>
423 <pre caption="Creating a XFS Filesystem">
424 # <c>mkfs.xfs /dev/hda3</c>
425 </pre>
426 <note>
427 You may want to add a couple of additional flags to the <c>mkfs.xfs</c> command: <c>-d agcount=3 -l size=32m</c>.
428 The <c>-d agcount=3</c> command will lower
429 the number of allocation groups. XFS will insist on using at least 1 allocation group per 4 GB of your partition,
430 so, for example, if you hava a 20 GB partition you will need a minimum agcount of 5.
431 The <c>-l size=32m</c> command increases the journal size to 32 Mb, increasing performance.
432 </note>
433 <warn>
434 If you are installing an XFS partition over a previous ReiserFS partition,
435 later attempts to mount may fail without an explicit <c>mount -t xfs</c>.
436 The solution is to zero out the partition before creating the XFS filesystem:
437 <c>dd if=/dev/zero of=/dev/hd<comment>x</comment> bs=1k</c>.
438 </warn>
439 <p>If you'd like to use ext3, you can create ext3 filesystems using <c>mke2fs -j</c>.</p>
440 <pre caption="Creating an ext3 Filesystem">
441 # <c>mke2fs -j /dev/hda3</c>
442 </pre>
443 <p>To create ReiserFS filesystems, use the <c>mkreiserfs</c> command.</p>
444 <pre caption="Creating a ReiserFS Filesystem">
445 # <c>mkreiserfs /dev/hda3</c>
446 </pre>
447 <note>You can find out more about using ext3 under Linux 2.4 at
448 <uri>http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html</uri>.
449 </note>
450 </body>
451 </section>
452 </chapter>
453 <chapter>
454 <title>Mount Partitions</title>
455 <section>
456 <body>
457 <p>Now, we'll activate our new swap, since we may need the additional virtual memory that
458 provides later:
459 </p>
460 <pre caption="Activating Swap">
461 # <c>swapon /dev/hda2</c>
462 </pre>
463 <p>Next, we'll create the <path>/mnt/gentoo</path> and <path>/mnt/gentoo/boot</path> mountpoints,
464 and we'll mount our filesystems to these mountpoints. </p>
465 <pre caption="Creating Mount Points">
466 # <c>mkdir /mnt/gentoo</c>
467 # <c>mount /dev/hda3 /mnt/gentoo</c>
468 # <c>mkdir /mnt/gentoo/boot</c>
469 # <c>mount /dev/hda1 /mnt/gentoo/boot</c>
470 </pre>
471 <p>
472 If you are setting up Gentoo
473 Linux with a separate <path>/usr</path> or <path>/var</path>, these would get mounted to
474 <path>/mnt/gentoo/usr</path> and <path>/mnt/gentoo/var</path>, respectively.
475 </p>
476 <impo>If your <e>boot</e> partition (the one holding the kernel) is ReiserFS, be sure to mount it
477 with the <c>-o notail</c> option so GRUB gets properly installed. Make sure
478 that <c>notail</c> ends up in your new <path>/etc/fstab</path> boot partition entry, too.
479 We'll get to that in a bit.
480 </impo>
481 <impo>If you are having problems mounting your boot partition with ext2, try using
482 <c>mount /dev/hXX /mnt/gentoo/boot -t ext2 </c> </impo>
483 </body>
484 </section>
485 </chapter>
486 <chapter>
487 <title>Obtaining the Desired 'stage-x' Tarball</title>
488 <section>
489 <body>
490 <p>If you want to start from a stage1 tarball, then you're already set
491 to go; you can find the stage1 tarball in <path>/cdroot/nocompress</path>.
492 On the other hand, if you would prefer to start from a stage2 or stage3
493 tarball that has been optimized for your architecture you can download it
494 (into <path>/mnt/gentoo</path> would be the simplest)
495 from one of the Gentoo mirror sites. </p>
496 <pre caption="Downloading Required Stages">
497 # <c>cd /mnt/gentoo</c>
498 <comment>Use lynx to get the URL for your tarball</comment>
499 # <c>lynx http://www.ibiblio.org/pub/Linux/distributions/gentoo/releases/1.4_rc1/x86/</c>
500 # <c>wget <comment>insert required stage tarball here.</comment></c>
501 </pre>
502 </body>
503 </section>
504 </chapter>
505 <chapter>
506 <title>Unpacking the Stage Tarballs</title>
507 <section>
508 <body>
509 <p>Now it's time to extract the compressed stage tarball of your choice to <path>/mnt/gentoo</path>.
510 Then, we'll <c>chroot</c> over to the new Gentoo Linux build installation.
511 </p>
512 <impo>Be sure to use the <c>p</c> option with <c>tar</c>. Forgetting to do this will
513 cause certain files to contain incorrect permissions.</impo>
514 <p>If you are using the &quot;from scratch, build everything&quot; install method,
515 you will want to use the <path>stage1-ix86-1.4_beta.tbz2</path> image.
516 If you're using one of our bigger CDs, you'll also have a choice of a stage2 and stage3 image.
517 These images allow you to save time at the expense of configurability (we've already chosen
518 compiler optimizations and default USE variables for you.)
519 </p>
520 <pre caption="Unpacking the Stages">
521 # <c>cd /mnt/gentoo</c>
522 # <c>tar -xvjpf /path/to/stage?-*.tbz2</c>
523 # <c>mount -o bind /proc /mnt/gentoo/proc</c>
524 # <c>cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</c>
525 </pre>
526 <pre caption="Entering the chroot Environment">
527 # <c>chroot /mnt/gentoo /bin/bash</c>
528 # <c>env-update</c>
529 Regenerating /etc/ld.so.cache...
530 # <c>source /etc/profile</c>
531 </pre>
532 <p>After you execute these commands, you'll be &quot;inside&quot; your new Gentoo Linux environment.
533 </p>
534 </body>
535 </section>
536 </chapter>
537 <chapter>
538 <title>Getting the Current Portage Tree using Rsync</title>
539 <section>
540 <body>
541 <p>Now, you'll need to run <c>emerge sync</c>. This will make sure that
542 you have the most current copy of the Portage tree. </p>
543 <pre caption="Updating Using Rsync">
544 # <c>emerge sync</c>
545 </pre>
546 <p>The Portage tree will be downloaded and stored in <path>/usr/portage</path>;
547 it's about 90Mb in size without tarballs.
548 </p>
549 </body>
550 </section>
551 </chapter>
552 <chapter>
553 <title>Setting Gentoo optimizations (make.conf)</title>
554 <section>
555 <body>
556 <p>Now that you have a working copy of the Portage tree, people using stage1 to
557 install will need to bootstrap their Gentoo Linux system as follows. First
558 edit the file <path>/etc/make.conf</path>. In this file, you should set your
559 <c>USE</c> flags, which specify optional functionality that you would
560 like to be built into packages; generally, the defaults (an <e>empty</e>
561 or unset <c>USE</c> variable) are fine.
562 More information on <c>USE</c> flags can be found
563 <uri link="http://www.gentoo.org/doc/en/use-howto.xml">here</uri>.
564 </p>
565 <p>You also should set appropriate <c>CHOST</c>, <c>CFLAGS</c> and
566 <c>CXXFLAGS</c> settings for the kind of system that you are creating
567 (commented examples can be found further down in the file.) Your best friend
568 is <path>man gcc</path> to figure out what additional <c>CFLAGS</c> and
569 <code>CXXFLAGS</code> are available. Search for 'Optimization'.
570 </p>
571 <p>If necessary, you can also set proxy information here if you are behind a
572 firewall.
573 </p>
574 <pre caption="Setting make.conf Options">
575 # <c>nano -w /etc/make.conf</c> <comment>(Adjust these settings)</comment>
576 </pre>
577 <note>
578 People who need to substantially tweak the build process should take a look at
579 the <path>/etc/make.globals</path> file. This file comprises gentoo defaults and
580 should never be touched. If the defaults do not suffice, then new values should
581 be put in <path>/etc/make.conf</path>, as entries in <path>make.conf</path>
582 <comment>override</comment> the entries in <path>make.globals</path>. If you're
583 interested in tweaking USE settings, look in <path>/etc/make.profile/make.defaults</path>.
584 If you want to turn off any USE settings found here, add an appropriate <c>USE=&quot;-foo&quot;</c>
585 in /etc/make.conf (to turn off the <c>foo</c> USE setting.)
586 </note>
587 </body>
588 </section>
589 </chapter>
590 <chapter>
591 <title>Starting from Stage1</title>
592 <section>
593 <body>
594 <p>The stage1 tarball is for ultimate tweakage. If you have picked this tarball,
595 you are most likely looking to have an uber-optimized system. Have fun, because optimization
596 is what Gentoo Linux is all about!
597 </p>
598 <p>Now, it's time to start the &quot;bootstrap&quot; process. This process takes about two hours on
599 my 1200Mhz AMD Athlon system. During this time, the extracted build image will be prepped
600 for compiling the rest of the system. The GNU compiler suite will be built, as well as the GNU C library.
601 These are time consuming builds and make up the bulk of the bootstrap process.
602 </p>
603 <pre caption="Bootstrapping">
604 # <c>cd /usr/portage</c>
605 # <c>scripts/bootstrap.sh</c>
606 </pre>
607 <p>The &quot;bootstrap&quot; process will now begin.
608 </p>
609 <note>
610 Portage by default uses <c>/var/tmp</c> during package building, often
611 using several hundred megabytes of temporary storage. If you would like to
612 change where Portage stores these temporary files, set a new PORTAGE_TMPDIR <e>before</e>
613 starting the bootstrap process, as follows:
614 </note>
615 <pre caption="Changing Portage's Storage Path">
616 # <c>export PORTAGE_TMPDIR=&quot;/otherdir/tmp&quot;</c>
617 </pre>
618 <p><c>bootstrap.sh</c> will build <c>binutils</c>, <c>gcc</c>, <c>gettext</c>,
619 and <c>glibc</c>, rebuilding <c>binutils</c>, <c>gcc</c>, and <c>gettext</c>
620 after <c>glibc</c>. Needless to say, this process takes a while.
621 Have a nice nap. Once this process completes, your system will be equivalent to a &quot;stage2&quot; system.
622 </p>
623 </body>
624 </section>
625 </chapter>
626 <chapter>
627 <title>Starting from Stage2</title>
628 <section>
629 <body>
630 <p>The stage2 tarball already has the bootstrapping done for you. All that you have
631 to do is install the rest of the system.
632 </p>
633 <note>
634 If you haven't done so, please edit <path>/etc/make.conf</path> to your flavor.
635 </note>
636 <pre caption="Installing the Rest of the System">
637 # <c>export CONFIG_PROTECT=&quot;&quot;</c>
638 # <c>emerge -p system</c>
639 <comment>[lists the packages to be installed]</comment>
640 # <c>emerge system</c>
641 </pre>
642 <note>The <c>export CONFIG_PROTECT=&quot;&quot;</c> line ensures that any new scripts
643 installed to <path>/etc</path> will overwrite the old scripts (stored in
644 <path>sys-apps/baselayout</path>), bypassing Portage's new config file
645 management support. Type <c>emerge --help config</c> for more details.</note>
646 <p>It's going to take a while
647 to finish building the entire base system. Your reward is that it will be
648 thoroughly optimized for your system. The drawback is that you have to find a
649 way to keep yourself occupied for some time to come. The author suggests &quot;Star
650 Wars - Super Bombad Racing&quot; for the PS2. When this process completes, your system
651 will be the equivalent of a stage3 system.
652 </p>
653 </body>
654 </section>
655 </chapter>
656 <chapter>
657 <title>Starting from Stage3</title>
658 <section>
659 <body>
660 <p>The stage3 tarball is already configured for your system. There is not much to do for this stage,
661 but it is a very good idea to update your system to the newest available packages. </p>
662 <note>If you have not already edited <path>/etc/make.conf</path> to fit your specifications,
663 now would be a good time to do so. </note>
664 <pre caption="Getting up-to-date">
665 # <c>emerge sync</c>
666 # <c>emerge -up world</c>
667 <comment>lists [<i>packages</i>] to be installed</comment>
668 # <c>emerge -u world</c>
669 </pre>
670 </body>
671 </section>
672 </chapter>
673 <chapter>
674 <title>Final Steps: Timezone</title>
675 <section>
676 <body>
677 <p>At this point, you should have system that's ready for final configuration.
678 We'll start the configuration process by setting the timezone. By setting the timezone before building
679 the kernel we ensure that users get reasonable <c>uname -a</c> output.
680 </p>
681 <p>Look for your timezone (or GMT if you using Greenwich Mean Time) in
682 <path>/usr/share/zoneinfo</path>. Then, make a symbolic link by typing:
683 </p>
684 <pre caption="Creating a symbolic link for timezome">
685 # <c>ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime</c>
686 </pre>
687 <p>You might also want to check <path>/etc/rc.conf</path> to make sure your timezone settings
688 are correct.
689 </p>
690 </body>
691 </section>
692 </chapter>
693 <chapter>
694 <title>Final steps: kernel and system logger</title>
695 <section>
696 <body>
697 <note>
698 If you haven't done so, please edit <path>/etc/make.conf</path> to your flavor.
699 </note>
700 <p>You now need to merge Linux source ebuilds. Here are the ones we currently
701 offer:
702 </p>
703 <table>
704 <tr>
705 <th>ebuild</th>
706 <th>description</th>
707 </tr>
708 <tr>
709 <ti>
710 <path>gentoo-sources</path>
711 </ti>
712 <ti>Our own performance and functionality-enhanced kernel based on -ac.</ti>
713 </tr>
714 <tr>
715 <ti>
716 <path>xfs-sources</path>
717 </ti>
718 <ti>A snapshot of the SGI XFS CVS Linux source tree; this is the kernel to run if you want bleeding edge(cvs) xfs support.</ti>
719 </tr>
720 <tr>
721 <ti>
722 <path>openmosix-sources</path>
723 </ti>
724 <ti>A stock Linux kernel source tree patched with support for the GPL <uri link="http://www.openmosix.com">openMosix</uri> load-balancing/clustering technology</ti>
725 </tr>
726 <tr>
727 <ti>
728 <path>usermode-sources</path>
729 </ti>
730 <ti>A stock Linux kernel source tree patched with support for User-Mode Linux. (&quot;Linux inside Linux&quot; technology)</ti>
731 </tr>
732 <tr>
733 <ti>
734 <path>vanilla-sources</path>
735 </ti>
736 <ti>A stock Linux kernel source tree, just like you'd get from kernel.org</ti>
737 </tr>
738 </table>
739 <warn>Please note that <i>gentoo-sources</i> is heavily patched and may not be stable.
740 Using <i>vanilla-sources</i> might be a better idea if you encounter numerous problems. If you are using
741 <i>gentoo-sources</i> beware of <i>grsecurity</i>, especially with <i>X</i>.
742 It is best to disable <i>grsecurity</i>unless you are absolutely sure that you need it.
743 </warn>
744 <p>Choose one and then merge as follows:</p>
745 <pre caption="Emerging Kernel Sources">
746 # <c>emerge sys-kernel/gentoo-sources</c>
747 </pre>
748 <p>Once you have a Linux kernel source tree available, it's time to compile your own custom kernel.
749 </p>
750 <pre caption="Compiling the Linux Kernel">
751 # <c>cd /usr/src/linux</c>
752 # <c>make menuconfig</c>
753 # <c>make dep &amp;&amp; make clean bzImage modules modules_install</c>
754 # <c>mv /boot/bzImage /boot/bzImage.orig</c>
755 <comment>[if bzImage already exists]</comment>
756 # <c>cp /usr/src/linux/arch/i386/boot/bzImage /boot</c>
757 </pre>
758 <warn>For your kernel to function properly, there are several options that you will
759 need to ensure are in the kernel proper -- that is, they should <i>be enabled and not
760 compiled as modules</i>. You will need to enable the <i>&quot;Code maturity
761 level options --&gt; Prompt for development and/or incomplete code/drivers&quot;</i>
762 option to see several of these selections.
763 Under the &quot;File systems&quot; section, be sure to enable the <i>&quot;Device File System&quot;</i> (note that
764 you <e>don't</e> need to enable the &quot;/dev/pts file system support&quot; option). You'll also
765 need to enable the <i>&quot;Virtual Memory Filesystem&quot;</i>. Be sure to enable &quot;ReiserFS&quot; if you have
766 any ReiserFS partitions; the same goes for &quot;Ext3&quot;. If you're using XFS, enable the
767 &quot;SGI XFS filesystem support&quot;
768 option. It's always a good idea to leave ext2
769 enabled whether you are using it or not. Also, most people using IDE hard drives will
770 want to enable the &quot;USE DMA by default&quot; option; otherwise, your IDE drives may perform
771 very poorly. Of course, remember to enable &quot;IDE disk&quot; support as well -- otherwise your
772 kernel won't be able to see your IDE disks.
773 </warn>
774 <p>If you are using hardware RAID you will need to enable a couple more options in the kernel:
775 For Highpoint RAID controllers select hpt366 chipset support, support for IDE RAID controllers and Highpoint
776 370 software RAID.For Promise RAID controllers select PROMISE PDC202{46|62|65|67|68|69|70} support,
777 support for IDE RAID
778 controllers and Support Promise software RAID (Fasttrak(tm))
779 </p>
780 <p>If you use PPPoE to connect to Internet, you will need the following
781 options in the kernel (built-in or as preferably as modules) :
782 &quot;PPP (point-to-point protocol) support&quot;, &quot;PPP support for async serial ports&quot;,
783 &quot;PPP support for sync tty ports&quot;. The two compression options won't harm but
784 are not definitely needed, neither does the &quot;PPP over Ethernet&quot; option,
785 that might only be used by <i>rp-pppoe</i> when configured to do kernel mode PPPoE.
786 </p>
787 <p>If you have an IDE cd burner, then you need to enable SCSI emulation in the
788 kernel. Turn on &quot;ATA/IDE/MFM/RLL support&quot; ---&gt; &quot;IDE, ATA and ATAPI Block
789 devices&quot; ---&gt; &quot;SCSI emulation support&quot; (I usually make it a module), then
790 under &quot;SCSI support&quot; enable &quot;SCSI support&quot;, &quot;SCSI CD-ROM support&quot; and
791 &quot;SCSI generic support&quot; (again, I usually compile them as modules). If you
792 also choose to use modules, then <c>echo -e &quot;ide-scsi\nsg\nsr_mod&quot;
793 &gt;&gt; /etc/modules.autoload</c> to have them automatically added at boot time.
794 </p>
795 <note>
796 For those who prefer it,
797 it is now possible to install Gentoo Linux with a 2.2 kernel.
798 Such stability will come at a price:
799 you will lose many of the nifty features that
800 are new to the 2.4 series kernels (such as XFS and tmpfs
801 filesystems, iptables, and more), although the 2.2 kernel sources can be
802 patched with Reiserfs and devfs support.
803 Gentoo linux bootscripts require either tmpfs or ramdisk support in the kernel, so
804 2.2 kernel users need to make sure that ramdisk support is compiled in (ie, not a module).
805 It is <comment>vital</comment> that a <e>gentoo=notmpfs</e> flag be added to the kernel
806 line in <path>/boot/grub/grub.conf</path> for the 2.2 kernel so that a ramdisk is mounted
807 for the bootscripts instead of tmpfs. If you choose not to use devfs, then
808 <e>gentoo=notmpfs,nodevfs</e> should be used instead.
809 </note>
810 <p>Your new custom kernel (and modules) are now installed. Now you need to choose a system
811 logger that you would like to install. We offer sysklogd, which is the traditional set
812 of system logging daemons. We also have msyslog and syslog-ng as well as metalog. Power users seem
813 to gravitate away from sysklogd (not very good performance) and towards the
814 newer alternatives.
815 If in doubt, you may want to try metalog, since it seems to be quite popular.
816 To merge your logger of choice, type <e>one</e> of the next four lines:
817 </p>
818 <pre caption="Emerging System Logger of Choice">
819 # <c>emerge app-admin/sysklogd</c>
820 # <c>rc-update add sysklogd default</c>
821 <comment>or</comment>
822 # <c>emerge app-admin/syslog-ng</c>
823 # <c>rc-update add syslog-ng default</c>
824 <comment>or</comment>
825 # <c>emerge app-admin/metalog</c>
826 # <c>rc-update add metalog default</c>
827 <comment>or</comment>
828 # <c>emerge app-admin/msyslog</c>
829 # <c>rc-update add msyslog default</c>
830 </pre>
831 <warn>
832 In the case of syslog-ng you need to create
833 <path>/etc/syslog-ng/syslog-ng.conf</path>.
834 See <path>/etc/syslog-ng</path>
835 for a sample configuration file.
836 </warn>
837 <impo>
838 Metalog flushes output to the disk in blocks, so messages aren't immediately recorded into
839 the system logs. If you are trying to debug a daemon, this performance-enhancing behavior
840 is less than helpful. When your Gentoo Linux system is up and running, you can send
841 metalog a USR1 signal to temporarily turn off this message buffering (meaning that
842 <i>tail -f <path>/var/log/everything/current</path></i> will now work
843 in real time, as expected),
844 and a USR2 signal to turn buffering back on
845 again.
846 </impo>
847 <p>Now, you may optionally choose a cron package that you'd like to use.
848 Right now, we offer dcron, fcron and vcron. If you don't know which one to choose,
849 you might as well grab vcron. They can be installed as follows:
850 </p>
851 <pre caption="Choosing a CRON Daemon">
852 # <c>emerge sys-apps/dcron</c>
853 # <c>crontab /etc/crontab</c>
854 <comment>or</comment>
855 # <c>emerge sys-apps/fcron</c>
856 # <c>crontab /etc/crontab</c>
857 <comment>or</comment>
858 # <c>emerge sys-apps/vcron</c>
859 <comment>You do not need to run <c>crontab /etc/crontab</c> if using vcron. </comment>
860 <comment>Don't forget to add your *cron to the proper init level. </comment>
861 # <c>rc-update add *cron default </c>
862 </pre>
863 <p>For more information how how cron works under Gentoo Linux,
864 see <uri link="http://lists.gentoo.org/pipermail/gentoo-announce/2002-April/000151.html">this announcement</uri>.</p>
865 <p>For more information on starting programs and daemons at startup, see the
866 <uri link="/doc/rc-scripts.html">rc-script guide</uri>.
867 </p>
868 </body>
869 </section>
870 </chapter>
871 <chapter>
872 <title>Final steps: Install Additional Packages</title>
873 <section>
874 <body>
875 <p>If you need rp-pppoe to connect to the net, be aware that at this point
876 it has not been installed. It would be the good time to do it. </p>
877 <pre caption="Installing rp-pppoe">
878 # <c>emerge rp-pppoe</c>
879 </pre>
880 <note> Please note that the rp-pppoe is built but not configured.
881 You will have to do it again using <c>adsl-setup</c> when you boot into your Gentoo system
882 for the first time.
883 </note>
884 <p>You may need to install some additional packages in the Portage tree
885 if you are using any optional features like XFS, ReiserFS or LVM. If you're
886 using XFS, you should emerge the <c>xfsprogs</c> ebuild:
887 </p>
888 <pre caption="Emerging Filesystem Tools">
889 # <c>emerge sys-apps/xfsprogs</c>
890 <comment>If you'd like to use ReiserFS, you should emerge the ReiserFS tools: </comment>
891 # <c> emerge sys-apps/reiserfsprogs</c>
892 <comment>If you're using LVM, you should emerge the <c>lvm-user</c> package: </comment>
893 # <c>emerge --usepkg sys-apps/lvm-user</c>
894 </pre>
895 <p>If you're a laptop user and wish to use your PCMCIA slots on your first
896 real reboot, you'll want to make sure you install the <i>pcmcia-cs</i> package.
897 </p>
898 <pre caption="Emerging PCMCIA-cs">
899 # <c>emerge sys-apps/pcmcia-cs</c>
900 </pre>
901 <warn>You will have to re-emerge <i>pcmcia-cs</i> after installation to get PCMCIA
902 to work.
903 </warn>
904 </body>
905 </section>
906 </chapter>
907 <chapter>
908 <title>Final steps: /etc/fstab</title>
909 <section>
910 <body>
911 <p>Your Gentoo Linux system is almost ready for use. All we need to do now is configure
912 a few important system files and install the GRUB boot loader.
913 The first file we need to
914 configure is <path>/etc/fstab</path>. Remember that you should use
915 the <c>notail</c> option for your boot partition if you chose to create a ReiserFS filesystem on it.
916 Remember to specify <c>ext2</c>, <c>ext3</c> or <c>reiserfs</c> filesystem types as appropriate.
917 </p>
918 <p>Use something like the <path>/etc/fstab</path> listed below, but of course be sure to replace &quot;BOOT&quot;,
919 &quot;ROOT&quot; and &quot;SWAP&quot; with the actual block devices you are using (such as <c>hda1</c>, etc.)</p>
920 <pre caption="Editing fstab"><comment>
921 # /etc/fstab: static file system information.
922 #
923 # noatime turns of atimes for increased performance (atimes normally aren't
924 # needed; notail increases performance of ReiserFS (at the expense of storage
925 # efficiency). It's safe to drop the noatime options if you want and to
926 # switch between notail and tail freely.
927
928 # &lt;fs&gt; &lt;mountpoint&gt; &lt;type&gt; &lt;opts&gt; &lt;dump/pass&gt;
929
930 # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
931 </comment>
932 /dev/BOOT /boot ext2 noauto,noatime 1 2
933 /dev/ROOT / ext3 noatime 0 1
934 /dev/SWAP none swap sw 0 0
935 /dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
936 proc /proc proc defaults 0 0
937 </pre>
938 <warn>Please notice that <i>/boot</i> is NOT mounted at boottime.
939 This is to protect the data in <i>/boot</i> from
940 corruption. If you need to access <i>/boot</i>, please mount it!
941 </warn>
942 </body>
943 </section>
944 </chapter>
945 <chapter>
946 <title>Final steps: Root Password</title>
947 <section>
948 <body>
949 <p>Before you forget, set the root password by typing: </p>
950 <pre caption="Setting the root Password">
951 # <c>passwd</c>
952 </pre>
953 </body>
954 </section>
955 </chapter>
956 <chapter>
957 <title>Final steps: /etc/hostname</title>
958 <section>
959 <body>
960 <p>Edit this file so that it contains your fully-qualified domain name on a single line,
961 i.e. <c>mymachine.mydomain.com</c>.
962 </p>
963 <pre caption="Configuring Hostname">
964 # <c>echo mymachine.mydomain.com &gt; /etc/hostname</c>
965 </pre>
966 </body>
967 </section>
968 </chapter>
969 <chapter>
970 <title>Final steps: /etc/hosts</title>
971 <section>
972 <body>
973 <p>This file contains a list of ip addresses and their associated hostnames.
974 It's used by the system to resolve the IP addresses
975 of any hostnames that may not be in your nameservers. Here's a template for this file:
976 </p>
977 <pre caption="Hosts Template">
978 127.0.0.1 localhost
979 <comment># the next line contains your IP for your local LAN, and your associated machine name</comment>
980 192.168.1.1 mymachine.mydomain.com mymachine
981 </pre>
982 <note>If you are on a DHCP network, it might be helpful to set <i>localhost</i> to your machine's
983 actual hostname. This will help GNOME and many other programs in name resolution.
984 </note>
985 </body>
986 </section>
987 </chapter>
988 <chapter>
989 <title>Final Network Configuration</title>
990 <section>
991 <body>
992 <p>Add the names of any modules that are necessary for the proper functioning of your system to
993 <path>/etc/modules.autoload</path> file (you can also add any options you
994 need to the same line.) When Gentoo Linux boots, these modules will be automatically
995 loaded. Of particular importance is your ethernet card module, if you happened to compile
996 it as a module:
997 </p>
998 <pre caption="/etc/modules.autoload"><comment>This is assuming that you are using a 3com card. Check <path>/lib/modules/`uname -r`/kernel/drivers/net</path> for your
999 card. </comment>
1000 3c59x
1001 </pre>
1002 <p>Edit the <path>/etc/conf.d/net</path> script to get your network configured for your
1003 first boot: </p>
1004 <pre caption="Boottime Network Configuration">
1005 # <c>nano -w /etc/conf.d/net</c>
1006 # <c>rc-update add net.eth0 default</c>
1007 </pre>
1008 <p>If you have multiple network cards you need to create additional <path>net.eth<comment>x</comment></path>
1009 scripts for each one (<comment>x</comment> = 1, 2, ...): </p>
1010 <pre caption="Multiple Network Interfaces">
1011 # <c>cd /etc/init.d</c>
1012 # <c>cp net.eth0 net.eth<comment>x</comment></c>
1013 # <c>rc-update add net.eth<comment>x</comment> default</c>
1014 </pre>
1015 <p>If you have a PCMCIA card installed, have a quick look into
1016 <path>/etc/init.d/pcmcia</path> to verify that things seem all right for your setup,
1017 then add this line to the top of <path>/etc/init.d/ethx</path>:
1018 </p>
1019 <pre caption="PCMCIA depend in /etc/init.d/net.ethx">
1020 depend() {
1021 need pcmcia
1022 }
1023 </pre>
1024 <p>This makes sure that the PCMCIA drivers are autoloaded whenever your network is loaded.
1025 </p>
1026 </body>
1027 </section>
1028 </chapter>
1029 <chapter>
1030 <title>Final steps: Configure Basic Settings (including the international keymap setting)</title>
1031 <section>
1032 <body>
1033 <pre caption="Basic Configuration">
1034 # <c>nano -w /etc/rc.conf</c>
1035 </pre>
1036 <p>Follow the directions in the file to configure the basic settings.
1037 All users will want to make sure that <c>CLOCK</c> is set to his/her
1038 liking. International keyboard users will want to set the <c>KEYMAP</c>
1039 variable (browse <path>/usr/share/keymaps</path> to see the various
1040 possibilities).
1041 </p>
1042 </body>
1043 </section>
1044 </chapter>
1045 <chapter>
1046 <title>Final steps: Configure GRUB</title>
1047 <section>
1048 <body>
1049 <p>The most critical part of understanding GRUB is getting comfortable with how GRUB
1050 refers to hard drives and partitions. Your Linux partition <path>/dev/hda1</path> is called
1051 <path>(hd0,0)</path> under GRUB. Notice the parenthesis around the hd0,0 - they are required.
1052 Hard drives count from zero rather than &quot;a&quot;, and partitions start at zero rather than one.
1053 Be aware too that with the hd devices, only harddrives are counted, not atapi-ide devices such as
1054 cdrom players, burners, and that the same construct can be used with scsi drives.
1055 (Normally they get higher numbers than ide drives except when the bios is configured
1056 to boot from scsi devices.) Assuming you have a harddrive on /dev/hda, a cdrom player on /dev/hdb,
1057 a burner on /dev/hdc and a second hardrive on /dev/hdd, for example, and no scsi harddrive
1058 <path>/dev/hdd7</path> gets translated to <path>(hd1,6)</path>.
1059
1060 It might sound tricky, and tricky it is indeed, but as we will see, grub
1061 offers a tab completion mechanism that comes handy for those of you having
1062 a lot of harddrives and partitions and who are a little lost in the
1063 grub numbering scheme. Having gotten the feel for that,
1064 it's time to install GRUB.
1065 </p>
1066 <p>The easiest way to install GRUB is to simply type <c>grub</c> at your chrooted shell prompt: </p>
1067 <pre caption="Installing GRUB">
1068 # <c>grub</c>
1069 </pre>
1070 <impo>If you are using hardware RAID this part will not work at
1071 this time.
1072 Skip to the section on making your <path>grub.conf</path>. After that we will complete the
1073 grub setup for RAID controllers
1074 </impo>
1075 <p>You'll be presented with the <c>grub&gt;</c> grub
1076 command-line prompt. Now, you need to type in the
1077 right commands to install the GRUB boot record onto your hard drive. In my example configuration,
1078 I want to install the GRUB boot record on my hard drive's MBR (master boot record), so that
1079 the first thing I see when I turn on the computer is the GRUB prompt. In my case, the commands
1080 I want to type are:
1081 </p>
1082 <pre caption="GRUB Commands">
1083 grub&gt; <c>root (hd0,0)</c>
1084 grub&gt; <c>setup (hd0)</c>
1085 grub&gt; <c>quit</c>
1086 </pre>
1087 <p>Here's how the two commands work. The first <c>root ( )</c> command tells GRUB
1088 the location of your boot partition (in our example, <path>/dev/hda1</path> or
1089 <path>(hd0,0)</path> in GRUB terminology. Then, the second <c>setup ( )
1090 </c> command tells GRUB where to install the
1091 boot record - it will be configured to look for its special files at the <c>root
1092 ( )</c> location that you specified. In my case, I want the boot record on the
1093 MBR of the hard drive, so I simply specify <path>/dev/hda</path> (also known as <path>(hd0)</path>).
1094 If I were using another boot loader and wanted to set up GRUB as a secondary boot-loader, I
1095 could install GRUB to the boot record of a particular partition. In that case,
1096 I'd specify a particular partition rather than the entire disk. Once the GRUB
1097 boot record has been successfully installed, you can type <c>quit</c> to quit GRUB.
1098
1099 <note> The tab completion mechanism of grub can be used from within grub,
1100 assuming you wrote <c> root (</c> and that you hit the TAB key, you would
1101 be prompted with a list of the available devices (not only harddrives),
1102 hitting the TAB key having written <c> root (hd</c>, grub would print the
1103 available harddrives and hitting the TAB key after writing <c> root (hd0,</c>
1104 would make grub print the list of partitions on the first harddrive.
1105
1106 Checking the syntax of the grub location with completion should really help
1107 to make the right choice.
1108 </note>
1109
1110 Gentoo Linux is now
1111 installed, but we need to create the <path>/boot/grub/grub.conf</path> file so that
1112 we get a nice GRUB boot menu when the system reboots. Here's how to do it.
1113 </p>
1114 <impo>To ensure backwards compatibility with GRUB, make sure to make a link from
1115 <i>grub.conf</i> to <i>menu.lst</i>. You can do this by doing
1116 <c>ln -s /boot/grub/grub.conf /boot/grub/menu.lst </c>. </impo>
1117 <p>Now, create the grub.conf file (<c>nano -w /boot/grub/grub.conf</c>), and add the following to it:
1118 </p>
1119 <pre caption="Grub.conf for GRUB">
1120 default 0
1121 timeout 30
1122 splashimage=(hd0,0)/boot/grub/splash.xpm.gz
1123
1124 title=My example Gentoo Linux
1125 root (hd0,0)
1126 kernel /boot/bzImage root=/dev/hda3
1127
1128 <comment> #Below is for setup using hardware RAID</comment>
1129 title=My Gentoo Linux on RAID
1130 root (hd0,0)
1131 kernel /boot/bzImage root=/dev/ataraid/discX/partY
1132
1133 <comment># Below needed only for people who dual-boot</comment>
1134 title=Windows NT Workstation
1135 root (hd0,5)
1136 chainloader +1
1137 </pre>
1138 <note>
1139 (hd0,0) should be written without any spaces inside the parentheses.
1140 </note>
1141 <impo>
1142 If you set up scsi emulation for an IDE cd burner earlier, then to get it to
1143 actually work you need to add an &quot;hdx=ide-scsi&quot; fragment to the kernel
1144 line in grub.conf (where &quot;hdx&quot; should be the device for your cd burner).
1145 </impo>
1146 <p>After saving this file, Gentoo Linux installation is complete. Selecting the first option will
1147 tell GRUB to boot Gentoo Linux without a fuss. The second part of the grub.conf file is optional,
1148 and shows you how to use GRUB to boot a bootable Windows partition.
1149 </p>
1150 <note>Above, <path>(hd0,0)</path> should point to your &quot;boot&quot; partition
1151 (<path>/dev/hda1</path> in our example config) and <path>/dev/hda3</path> should point to
1152 your root filesystem. <path>(hd0,5)</path> contains the NT boot
1153 loader.
1154 </note>
1155 <note>
1156 The path to the kernel image is relative to the boot partition. If for example you have separated boot partition <path>(hd0,0)</path> and root partition <path>(hd0,1)</path>, all paths in the grub.conf file above will become <path>/bzImage</path>.
1157 </note>
1158 <p>If you need to pass any additional options to the kernel, simply
1159 add them to the end of the <c>kernel</c> command. We're already passing one option
1160 (<c>root=/dev/hda3</c>), but you can pass others as well. In particular, you can
1161 turn off devfs by default (not recommended unless you know what you're doing) by
1162 adding the <c>gentoo=nodevfs</c> option to the <c>kernel</c> command.
1163 </p>
1164 <note>Unlike in earlier versions of Gentoo Linux, you no longer have to add
1165 <c>devfs=mount</c> to the end of the <c>kernel</c> line to enable devfs. In rc6
1166 devfs is enabled by default.
1167 </note>
1168 </body>
1169 </section>
1170 </chapter>
1171 <chapter>
1172 <title>Final steps: Configure LILO</title>
1173 <section>
1174 <body>
1175 <p>While GRUB may be the new alternative for most people, it is not always the most stable.
1176 LILO, the LInuxLOader, is the tried and true workhorse of Linux bootloaders. If you want stability
1177 and semi-ease of configure, give LILO a try.
1178 </p>
1179 <p>The first step is to emerge LILO:
1180 </p>
1181 <pre caption="Emerging LILO">
1182 # <c>emerge lilo</c>
1183 </pre>
1184 <p>Now it is time to configure LILO. I will give you a small <i>lilo.conf</i> to use, and I will explain
1185 the different parts of the file.
1186 </p>
1187 <pre caption="Example lilo.conf">
1188 boot=/dev/hda
1189 map=/boot/map
1190 install=/boot/boot.b
1191 prompt
1192 timeout=50
1193 message=/boot/message
1194 lba32
1195 default=linux
1196
1197 image=/boot/vmlinuz-2.4.20
1198 label=linux
1199 initrd=/boot/initrd-2.4.20.img
1200 read-only
1201 root=/dev/hda5
1202
1203 #For dual booting windows/other OS
1204 other=/dev/hda1
1205 label=dos
1206
1207 </pre>
1208 <li><i>boot=/dev/hda</i> tells LILO to install itself on the first hard disk on the first IDE controller. </li>
1209 <li><i>map=/boot/map</i> states the map file. In normal use, this should not be modified. </li>
1210 <li><i>install=/boot/boot.b</i> tells LILO to install the specified file as the new boot sector.
1211 In normal use, this should not be altered. If the install line is missing, LILO will
1212 assume a default of /boot/boot.b as the file to be used. </li>
1213 <li>The existence of <i>prompt</i> tells LILO to show you whatever is referenced in the message line.
1214 While it is not recommended that you remove the prompt line, if you do remove it, you can still
1215 get a prompt by holding down the [Shift] key while your machine starts to boot. </li>
1216 <li><i>timeout=50</i> sets the amount of time that LILO will wait for user input before proceeding
1217 with booting the default line entry. This is measured in tenths of a second, with 50 as the default. </li>
1218 <li><i>message=/boot/message</i> refers to the screen that LILO displays to let you select the
1219 operating system or kernel to boot. </li>
1220 <li><i>lba32</i> describes the hard disk geometry to LILO. Another common entry here is linear. You should
1221 not change this line unless you are very aware of what you are doing. Otherwise, you could put
1222 your system in an unbootable state. </li>
1223 <li><i>default=linux</i> refers to the default operating system for LILO to boot from the
1224 options listed below this line. The name linux refers to the label line below in each of the boot options. </li>
1225 <li><i>image=/boot/vmlinuz-2.4.20</i> specifies the linux kernel to boot with this particular boot option. </li>
1226 <li><i>label=linux</i> names the operating system option in the LILO screen. In this case,
1227 it is also the name referred to by the default line. </li>
1228 <li><i>initrd=/boot/initrd-2.4.20.img</i> refers to the initial ram disk image that is used at boot time
1229 to actually initialize and start the devices that makes booting the kernel possible. The initial
1230 ram disk is a collection of machine-specific drivers necessary to operate a SCSI card, hard drive, or any
1231 other device needed to load the kernel. You should never try to share initial ram disks between machines. </li>
1232 <li><i>read-only</i> specifies that the root partition (see the root line below) is read-only and cannot be
1233 altered during the boot process. </li>
1234 <li><i>root=/dev/hda5</i> tells LILO what disk partition to use as the root partition. </li>
1235 <note>Thanks to <uri link="http://www.redhat.com">Redhat.com</uri> for this information.
1236 </note>
1237 <p>After you have edited your <i>lilo.conf</i> file, it is time to run LILO to load the information
1238 into the MBR:
1239 </p>
1240 <pre caption="Running LILO">
1241 # <c>/sbin/lilo</c>
1242 </pre>
1243 <p>LILO is configured, and now your machine is ready to boot into Gentoo Linux!
1244 </p>
1245 </body>
1246 </section>
1247 </chapter>
1248 <chapter>
1249 <title>Final steps: Bootdisks</title>
1250 <section>
1251 <title>GRUB Bootdisks</title>
1252 <body>
1253 <p>It is always a good idea to make a bootdisk the first
1254 time you install any Linux distribution. This is a security
1255 blanket, and generally not a bad thing to do. If you are using hardware RAID, you <e>must</e> make a GRUB boot
1256 disk. With hardware RAID
1257 if you try to install grub from your chrooted shell it will fail. So we
1258 will make a GRUB
1259 boot disk, and when you reboot the first time we will install GRUB
1260 to the MBR. Make your
1261 bootdisk like this:
1262 </p>
1263 <pre caption="Creating a GRUB Bootdisk">
1264 # <c>mke2fs /dev/fd0</c>
1265 # <c>mount /dev/fd0 /mnt/floppy</c>
1266 # <c>mkdir -p /mnt/floppy/boot/grub</c>
1267 # <c>cp /usr/share/grub/i386-pc/stage1 /mnt/floppy/boot/grub/</c>
1268 # <c>cp /usr/share/grub/i386-pc/stage2 /mnt/floppy/boot/grub/</c>
1269
1270 # <c>grub</c>
1271
1272 grub&gt; <c>root (fd0)</c>
1273 grub&gt; <c>setup (fd0)</c>
1274 grub&gt; <c>quit</c>
1275 </pre>
1276 </body>
1277 </section>
1278 <section>
1279 <title>LILO Bootdisks</title>
1280 <body>
1281 <p>If you are using LILO, it is also a good idea to make a bootdisk:
1282 </p>
1283 <pre caption="Making a LILO Bootdisk">
1284 # <c>dd if=/boot/your_kernel of=/dev/fd0 </c>
1285 <comment>This will only work if your kernel is smaller than 1.4MB</comment>
1286 </pre>
1287 </body>
1288 </section>
1289 </chapter>
1290 <chapter>
1291 <title>Installation Complete!</title>
1292 <section>
1293 <body>
1294 <p>Now, Gentoo Linux is installed. The only remaining step is to exit the chrooted shell,
1295 udpate necessary configuration files,
1296 safely unmount your partitions
1297 and reboot the system:
1298 </p>
1299 <pre caption="Rebooting the System">
1300 # <c>etc-update</c>
1301 # <c>exit</c>
1302 <codenote>This exits the chrooted shell; you can also type <c>^D</c></codenote>
1303 # <c>cd / </c>
1304 # <c>umount /mnt/gentoo/boot</c>
1305 # <c>umount /mnt/gentoo/proc</c>
1306 # <c>umount /mnt/gentoo</c>
1307 # <c>reboot</c>
1308 </pre>
1309 <note>
1310 After rebooting, it is a good idea to run the <c>update-modules</c> command to create
1311 the <path>/etc/modules.conf</path> file. Instead of modifying this file directly, you should
1312 generally make changes to the files in <path>/etc/modules.d</path>.
1313 </note>
1314 <impo>Remember if you are running hardware RAID, you must
1315 use the bootdisk for the first reboot.
1316 then go back and install grub the way everyone else did the first
1317 time. You are done, congratulations</impo>
1318 <p>If you have any questions or would like to get involved with Gentoo Linux development,
1319 consider joining our gentoo-user and gentoo-dev mailing lists
1320 (there's a &quot;click to subscribe&quot; link on our <uri link="http://www.gentoo.org">main page</uri>).
1321 We also have a handy <uri link="http://www.gentoo.org/doc/en/desktop.xml">Desktop configuration guide</uri>
1322 that will
1323 help you to continue configuring your new Gentoo Linux system, and a useful
1324 <uri link="http://www.gentoo.org/doc/en/portage-user.xml">Portage user guide</uri>
1325 to help familiarize you with Portage basics. You can find the rest of the Gentoo Documentation
1326 <uri link="http://www.gentoo.org/main/en/docs.xml">here</uri>. If you have any other questions
1327 involving installation or anything for that matter, please check the Gentoo Linux
1328 <uri link="http://www.gentoo.org/doc/en/faq.xml">FAQ</uri>.
1329 Enjoy and welcome to Gentoo Linux!
1330 </p>
1331 </body>
1332 </section>
1333 </chapter>
1334 <chapter>
1335 <title>Gentoo-Stats</title>
1336 <section>
1337 <body>
1338 <p>The Gentoo Linux usage statistics program was started as an attempt to give the developers
1339 a way to find out about their user base. It collects information about Gentoo Linux usage to help
1340 us in set priorities our development. Installing it is completely optional, and it would be greatly
1341 appreciated if you decide to use it. Compiled statistics can be viewed at <uri>http://stats.gentoo.org/</uri>.
1342 </p>
1343 <p>The gentoo-stats server will assign a unique ID to your system.
1344 This ID is used to make sure that each system is counted only once. The ID will not be used
1345 to individually identify your system, nor will it be mached against an IP address or
1346 other personal information. Every precaution has been taken to assure your privacy in the
1347 development of this system. The following are the things that we are monitoring
1348 right now through our &quot;gentoo-stats&quot; program:
1349 </p>
1350 <ul>
1351 <li>installed packages and their version numbers</li>
1352 <li>CPU information: speed (MHz), vendor name, model name, CPU flags (like &quot;mmx&quot; or &quot;3dnow&quot;)</li>
1353 <li>memory information (total available physical RAM, total available swap space)</li>
1354 <li>PCI cards and network controller chips</li>
1355 <li>the Gentoo Linux profile your machine is using (that is, where the /etc/make.profile link is pointing to).</li>
1356 </ul>
1357 <p>We are aware that disclosure of sensitive information is a threat to most Gentoo Linux users
1358 (just as it is to the developers).
1359 </p>
1360 <ul>
1361 <li>Unless you modify the gentoo-stats program, it will never transmit sensitive
1362 information such as your passwords, configuration data, shoe size...</li>
1363 <li>Transmission of your e-mail addresses is optional and turned off by default.</li>
1364 <li>The IP address your data transmission originates from will never be logged
1365 in such a way that we can identify you. There are no &quot;IP address/system ID&quot; pairs.</li>
1366 </ul>
1367 <p>The installation is easy - just run the following commands:
1368 </p>
1369 <pre caption="Installing gentoo-stats">
1370 # <c>emerge gentoo-stats</c> <codenote>Installs gentoo-stats</codenote>
1371 # <c>gentoo-stats --new</c> <codenote>Obtains a new system ID</codenote>
1372 </pre>
1373 <p>The second command above will request a new system ID and enter it into
1374 <path>/etc/gentoo-stats/gentoo-stats.conf</path> automatically. You can view this file
1375 to see additional configuration options.
1376 </p>
1377 <p>After that, the program should be run on a regular schedule
1378 (gentoo-stats does not have to be run as root). Add this line to your <path>crontab</path>:
1379 </p>
1380 <pre caption="Updating gentoo-stats with cron">
1381 <c>0 0 * * 0,4 /usr/sbin/gentoo-stats --update &gt; /dev/null</c>
1382 </pre>
1383 <p>The <c>gentoo-stats</c> program is a simple perl script which can be
1384 viewed with your favortive pager or editor: <path>/usr/sbin/gentoo-stats</path>. </p>
1385 </body>
1386 </section>
1387 </chapter>
1388 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20