/[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.16 - (show annotations) (download) (as text)
Sat Dec 7 20:32:03 2002 UTC (14 years, 10 months ago) by zhen
Branch: MAIN
Changes since 1.15: +656 -776 lines
File MIME type: application/xml
organzied and fixed bugs

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

  ViewVC Help
Powered by ViewVC 1.1.20