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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.17 - (show annotations) (download) (as text)
Sat Dec 7 20:40:51 2002 UTC (16 years, 1 month ago) by zhen
Branch: MAIN
Changes since 1.16: +8 -0 lines
File MIME type: application/xml
fix for bug #11601

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

  ViewVC Help
Powered by ViewVC 1.1.20