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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.21 - (show annotations) (download) (as text)
Wed Jan 1 06:06:11 2003 UTC (15 years, 2 months ago) by drobbins
Branch: MAIN
Changes since 1.20: +180 -132 lines
File MIME type: application/xml
Updated for 1.4_rc2

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

  ViewVC Help
Powered by ViewVC 1.1.20