/[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.174 - (hide annotations) (download) (as text)
Tue Sep 30 09:02:43 2003 UTC (13 years, 11 months ago) by swift
Branch: MAIN
Changes since 1.173: +43 -9 lines
File MIME type: application/xml
Fix bug 29685

1 zhen 1.16 <?xml version="1.0" encoding="UTF-8"?>
2 drobbins 1.1 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3 zhen 1.3 <guide link="/doc/en/gentoo-x86-install.xml">
4 swift 1.149 <title>Gentoo Linux 1.4 Installation Instructions</title>
5     <author title="Chief Architect">
6 zhen 1.16 <mail link="drobbins@gentoo.org">Daniel Robbins</mail>
7 swift 1.149 </author>
8     <author title="Author">Chris Houser</author>
9     <author title="Author">Jerry Alexandratos</author>
10 swift 1.158 <author title="Ghost, Reviewer">
11 zhen 1.16 <mail link="g2boojum@gentoo.org">Grant Goodyear</mail>
12 swift 1.149 </author>
13     <author title="Editor">
14 zhen 1.16 <mail link="zhen@gentoo.org">John P. Davis</mail>
15 swift 1.149 </author>
16     <author title="Editor">
17 zhen 1.16 <mail link="Pierre-Henri.Jondot@wanadoo.fr">Pierre-Henri Jondot</mail>
18 swift 1.149 </author>
19     <author title="Editor">
20 zhen 1.16 <mail link="stocke2@gentoo.org">Eric Stockbridge</mail>
21 swift 1.149 </author>
22     <author title="Editor">
23 zhen 1.16 <mail link="rajiv@gentoo.org">Rajiv Manglani</mail>
24 swift 1.149 </author>
25     <author title="Editor">
26 seo 1.41 <mail link="seo@gentoo.org">Jungmin Seo</mail>
27 swift 1.149 </author>
28     <author title="Editor">
29 zhware 1.43 <mail link="zhware@gentoo.org">Stoyan Zhekov</mail>
30 swift 1.149 </author>
31     <author title="Editor">
32 jhhudso 1.75 <mail link="jhhudso@gentoo.org">Jared Hudson</mail>
33 swift 1.149 </author>
34     <author title="Editor">Colin Morey</author>
35     <author title="Editor">
36 peesh 1.96 <mail link="peesh@gentoo.org">Jorge Paulo</mail>
37 swift 1.149 </author>
38     <author title="Editor">
39 carl 1.101 <mail link="carl@gentoo.org">Carl Anderson</mail>
40 swift 1.149 </author>
41     <author title="Editor, Reviewer">
42 swift 1.142 <mail link="swift@gentoo.org">Sven Vermeulen</mail>
43 swift 1.149 </author>
44     <author title="Editor">
45 swift 1.142 <mail link="avenj@gentoo.org">Jon Portnoy</mail>
46 swift 1.149 </author>
47 antifa 1.150 <author title="Editor">
48     <mail link="klasikahl@gentoo.org">Zack Gilburd</mail>
49     </author>
50 swift 1.149 <author title="Reviewer">
51 swift 1.142 <mail link="gerrynjr@gentoo.org">Gerald J. Normandin Jr.</mail>
52 swift 1.149 </author>
53     <author title="Reviewer">
54 swift 1.142 <mail link="spyderous@gentoo.org">Donnie Berkholz</mail>
55 swift 1.149 </author>
56 swift 1.154 <author title="Reviewer">
57     <mail link="antifa@gentoo.org">Ken Nowack</mail>
58     </author>
59 swift 1.164 <author title="Editor, Reviewer">
60 bennyc 1.162 <mail link="bennyc@gentoo.org">Benny Chuang</mail>
61     </author>
62 swift 1.149
63     <abstract>
64     These instructions step you through the process of installing Gentoo
65     Linux 1.4, release version (not _rc versions). The Gentoo Linux installation
66     process supports various installation approaches, depending upon how much of
67     the system you want to custom-build from scratch.
68     </abstract>
69    
70     <license/>
71 swift 1.141
72 swift 1.174 <version>2.6.17</version>
73     <date>September 30, 2003</date>
74 swift 1.149
75     <chapter>
76     <title>About the Install</title>
77     <section>
78     <body>
79    
80     <p>
81     First, if you are new to this, welcome to Gentoo Linux! Gentoo
82     Linux can be installed in many different ways. Those who are looking
83     for a rapid install can use pre-built packages, while those who want
84     the ultimate in customizability can compile Gentoo Linux entirely
85     from the original source code. The method you choose is up to
86     you.
87     </p>
88    
89     <p>
90     One significant change in relation to the official 1.4 release is
91     our new 2-CD installation set, which can be ordered from <uri
92     link="http://store.gentoo.org">The Gentoo Linux Store</uri>, in
93 bennyc 1.165 addition to being available on our
94     <uri link="http://www.gentoo.org/main/en/mirrors.xml">mirrors</uri>.
95     We currently have 2-CD installation sets for x86 (486 and above),
96     i686 (Pentium Pro, Pentium II, Athlon/Duron and above), Pentium III,
97     Pentium 4 and Athlon XP. To see what 2-CD set is right for you, read
98     the detailed descriptions of each product in the <uri
99 swift 1.149 link="http://store.gentoo.org">store</uri>. The store descriptions
100     contain fairly comprehensive CPU compatibility information.
101     </p>
102    
103 swift 1.167 <p>
104     You can find and download the ISOs for the LiveCDs from most of our
105     mirrors. The LiveCDs for the x86 architecture are located inside the
106     <path>releases/x86/1.4/livecd/</path> subdirectory.
107     </p>
108    
109 swift 1.149 <p>So, about the 2 CD set -- here's what's on each CD. The first
110     CD ("CD 1") is called "Live CD Installation" and is a bootable CD-ROM,
111     meaning that you can put "CD 1" in your drive and run Gentoo Linux
112     directly from the CD. You can then use this CD-based version of
113     Gentoo to install Gentoo Linux 1.4 to your hard disk. In addition
114     to containing a bootable Gentoo Linux environment, CD 1
115     contains everything you need to install Gentoo Linux quickly, even
116     without a connection to the Internet. In addition, several
117     pre-compiled packages are also included on CD 1, such as the
118     ever-important XFree86 X server. If you have an ISO CD-ROM image
119 swift 1.167 file for CD 1, its name will contain <path>-cd1</path>.
120 swift 1.149 </p>
121    
122     <p>
123     In contrast, the second CD ("CD 2") isn't bootable and contains
124     lots of pre-built packages for your system. Included on this CD are
125     optimized versions of packages such as KDE, GNOME, OpenOffice,
126     Mozilla, Evolution and others. CD 2 is <e>optional</e> and is
127     intended for those people who are interested in installing Gentoo
128     Linux very quickly. The packages included on CD 2 typically take
129     about 36 hours to compile from source on a typical modern
130     single-processor system. If you have an ISO CD-ROM image file for CD
131 swift 1.167 2, its name will contain <path>-cd2</path>.
132 swift 1.149 </p>
133    
134     <note>
135     A complete Gentoo Linux 2-CD set contains the Gentoo Reference
136     Platform, which is a complete pre-built Gentoo Linux system including GNOME,
137     KDE, Mozilla and OpenOffice. The Gentoo Reference Platform ("GRP")
138     was created to allow rapid Gentoo Linux package installations
139     for those who need this capability. The "compile from
140     source" functionality, which is the cornerstone of Gentoo Linux,
141     will always be a fully-supported installation option as well. The
142     purpose of the GRP is to make Gentoo Linux more convenient for some
143     users, without impacting Gentoo's powerful "compile from source"
144     installation process in any way.
145     </note>
146    
147     <p>
148     In addition to our 2-CD set, we also have a very small "basic"
149     Live CD that you can use to boot your system. Once your system has
150     booted, you can configure a connection to the Internet and then
151     install Gentoo over the network. The advantage of this "basic" CD is
152     that it is small and thus the ISO CD-ROM image file can be
153     downloaded quickly. If you're an advanced user who wants to install
154     the most up-to-date version of Gentoo Linux available and have a
155     fast network connection, then you may prefer this option. If you
156     have an ISO CD-ROM image file for our "basic" Live CD, its name will
157 swift 1.167 contain <path>-basic</path>.
158 swift 1.149 </p>
159 drobbins 1.70
160 swift 1.149 <p>
161     To use any Gentoo Linux CD-based installation method, you will
162     need to have a 486+ processor and ideally at least 64 Megabytes of
163     RAM. (Gentoo Linux has been successfully built with 64MB of RAM +
164     64MB of swap space, but the build process is awfully slow under
165     those conditions.)
166     </p>
167    
168     <p>
169     Once you boot one of our Live CDs, you have even more options.
170     Gentoo Linux can be installed using one of three &quot;stage&quot;
171     tarball files. The one you choose depends on how much of the system
172     you want to compile yourself. The stage1 tarball is used when you
173     want to bootstrap and build the entire system from scratch. The
174     stage2 tarball is used for building the entire system from a
175     bootstrapped "semi-compiled" state. The stage3 tarball already
176     contains a basic Gentoo Linux system that has been built for
177     you. If you are interested in doing a "GRP" install, then the
178     stage3 tarball should be used.
179     </p>
180    
181     <p>
182     <b>If you're not doing a GRP install, should you start from a stage1, stage2, or
183     stage3 tarball?</b> Here is some information that should help you
184     make this decision.
185     </p>
186    
187     <p>
188     Starting from a stage1 allows you to have total
189     control over the optimization settings and optional build-time
190     functionality that is initially enabled on your system. This makes
191     stage1 installs good for power users who know what they are doing.
192     It is also a great installation method for those who would like to
193     know more about the inner workings of Gentoo Linux.
194     </p>
195 swift 1.142
196 swift 1.149 <p>
197     Stage2 installs allow you to skip the bootstrap process and doing
198     this is fine if you are happy with the optimization settings that we
199     chose for your particular stage2 tarball.
200     </p>
201 swift 1.142
202 swift 1.149 <p>
203     And choosing to go with a stage3 allows for the fastest install of Gentoo
204     Linux, but also means that your base system will have the optimization
205     settings that we chose for you (which to be honest, are good settings and were
206     carefully chosen to enhance performance while maintaining
207     stability). Since major releases of Gentoo Linux have stage3's
208     specifically optimized for various popular processors, starting
209     from a stage3 can offer the best of all worlds -- a fast install
210     and a system that is well-optimized.
211     </p>
212 swift 1.142
213 swift 1.149 <p>
214     <b>If you're installing Gentoo Linux for the first time, consider using a
215     stage3 tarball for installation, or a stage3 with GRP.</b>
216     </p>
217 antifa 1.106
218 swift 1.149 <note>
219     <b>Advanced users:</b> If you use a stage3 install, you should not
220     change the default CHOST setting in <path>/etc/make.conf</path>. If you need
221     to make such a change, you should start with a stage1 tarball and build up
222     your system with the desired CHOST setting. The CHOST setting
223     typically looks something like this: <c>i686-pc-linux-gnu</c>.
224     </note>
225 antifa 1.106
226 swift 1.149 <impo>
227     If you encounter a problem with any part of the install and wish to
228     report it as a bug, report it to <uri>http://bugs.gentoo.org</uri>. If the bug
229     needs to be sent upstream to the original software developers (e.g. the KDE
230     team) the <e>Gentoo Linux developers</e> will take care of that for you.
231     </impo>
232 antifa 1.106
233 swift 1.149 <note>
234     The installation instructions in the LiveCD may not be as up-to-date as our
235     Web documentation at <uri>http://www.gentoo.org/doc/en/gentoo-x86-install.xml</uri>.
236     Refer to our Web documentation for the most up-to-date installation
237     instructions.
238     </note>
239 antifa 1.106
240 swift 1.149 <p>
241     Now, let us quickly review the install process. First, we will download, burn
242     CD(s) and boot a LiveCD. After getting a root prompt, we will create
243     partitions, create our filesystems and extract either a stage1, stage2 or
244     stage3 tarball. If we are using a stage1 or stage2 tarball, we will take
245     the appropriate steps to get our system to stage3. Once our system is at
246     stage3, we can configure it (customize configuration files, install a boot
247     loader, etc.), boot it and have a fully-functional Gentoo Linux system. After
248     your basic Gentoo Linux system is running, you can optionally use "CD 2" of
249     our 2-CD set and install any number of pre-built packages such as KDE, GNOME,
250     OpenOffice, Mozilla, or others that you'd like on your system.
251     </p>
252 antifa 1.105
253 swift 1.149 <p>
254     Depending on what stage of the build process you're starting from, here is
255     what is required for installation:
256     </p>
257 antifa 1.106
258 swift 1.149 <table>
259 swift 1.167 <tcolumn width="0.75in"/>
260     <tcolumn width="1in"/>
261     <tcolumn width="1.25in"/>
262     <tcolumn width="3.5in"/>
263 swift 1.149 <tr>
264     <th>Stage Tarball</th>
265     <th>Internet Access Required</th>
266     <th>Media Required</th>
267     <th>Steps</th>
268     </tr>
269     <tr>
270     <ti>1</ti>
271     <ti>Yes</ti>
272     <ti><e>basic</e> or <e>CD 1</e></ti>
273     <ti>partition/filesystem setup, emerge sync, bootstrap, emerge system, final config</ti>
274     </tr>
275     <tr>
276     <ti>2</ti>
277     <ti>Yes</ti>
278     <ti><e>basic</e> or <e>CD 1</e></ti>
279     <ti>partition/filesystem setup, emerge sync, emerge system, final config</ti>
280     </tr>
281     <tr>
282     <ti>3</ti>
283     <ti>No if using <e>CD 1</e>, Yes otherwise</ti>
284     <ti><e>basic</e> or <e>CD 1</e></ti>
285     <ti>partition/filesystem setup, emerge sync (not required if using <e>CD 1</e>), final config</ti>
286     </tr>
287     <tr>
288     <ti>3+GRP</ti>
289     <ti>No</ti>
290     <ti><e>CD 1</e>, <e>CD 2</e> optionally</ti>
291     <ti>partition/filesystem setup, final config, install CD 1 pre-built packages (optional), reboot, install extra pre-built packages like KDE and GNOME (if using "CD 2")</ti>
292     </tr>
293     </table>
294 antifa 1.105
295 swift 1.149 <note>
296     Hardware ATA RAID users should read the section about ATA RAID on the bottom
297     of this document before proceeding.
298     </note>
299 antifa 1.105
300 swift 1.149 </body>
301     </section>
302     </chapter>
303 antifa 1.105
304 swift 1.149 <chapter>
305     <title>Booting</title>
306     <section>
307     <body>
308 antifa 1.105
309 swift 1.149 <warn>
310     Read this whole section before proceeding, especially the available boot
311     options. Ignoring this could lead to wrong keyboard settings, unstarted
312     pcmcia services etc..
313     </warn>
314 antifa 1.105
315 swift 1.149 <p>
316     Start by booting your Live CD of choice. You should see a fancy
317     boot screen with the Gentoo Linux logo on it. At this screen, you
318     can hit Enter to begin the boot process, or boot the LiveCD with
319     custom boot options by specifying a kernel followed by boot options
320     and then hitting Enter. For example: <c>gentoo nousb nohotplug</c>.
321     If you are installing Gentoo Linux on a system with more than one
322     processor ("SMP"), then you should type <c>smp</c> instead of
323     <c>gentoo</c> at the prompt. This will allow the LiveCD to see all
324     the processors in your system, not just the first one.
325     </p>
326    
327     <p>
328     Consult the following table for a partial list of available kernels and
329     options or press F2 and F3 to view the help screens.
330     </p>
331 antifa 1.105
332 swift 1.149 <table>
333 swift 1.167 <tcolumn width="2in"/>
334     <tcolumn width="4in"/>
335 swift 1.149 <tr><th>Available kernels</th><th>Description</th></tr>
336     <tr><ti>gentoo</ti><ti>standard gentoo kernel (default)</ti></tr>
337     <tr><ti>nofb</ti><ti>framebuffer mode disabled</ti></tr>
338     <tr><ti>smp</ti><ti>loads a smp kernel in noframebuffer mode</ti></tr>
339     <tr><ti>acpi</ti><ti>enables acpi=on + loads acpi modules during init</ti></tr>
340     <tr><ti>memtest</ti><ti>boots the memory testing program</ti></tr>
341     </table>
342 antifa 1.105
343 swift 1.149 <table>
344 swift 1.167 <tcolumn width="2in"/>
345     <tcolumn width="4in"/>
346 swift 1.149 <tr><th>Available boot options</th><th>Description</th></tr>
347     <tr><ti>doataraid</ti><ti>loads ide raid modules from initrd</ti></tr>
348     <tr><ti>dofirewire</ti><ti>modprobes firewire modules in initrd (for firewire cdroms,etc.)</ti></tr>
349     <tr><ti>dokeymap</ti><ti>enable keymap selection for non-us keyboard layouts</ti></tr>
350     <tr><ti>dopcmcia</ti><ti>starts pcmcia service</ti></tr>
351     <tr><ti>doscsi</ti><ti>scan for scsi devices (breaks some ethernet cards)</ti></tr>
352     <tr><ti>noapm</ti><ti>disables apm module load</ti></tr>
353     <tr><ti>nodetect</ti><ti>causes hwsetup/kudzu and hotplug not to run</ti></tr>
354     <tr><ti>nodhcp</ti><ti>dhcp does not automatically start if nic detected</ti></tr>
355     <tr><ti>nohotplug</ti><ti>disables loading hotplug service</ti></tr>
356     <tr><ti>noraid</ti><ti>disables loading of evms modules</ti></tr>
357     <tr><ti>nousb</ti><ti>disables usb module load from initrd, disables hotplug</ti></tr>
358     <tr><ti>ide=nodma</ti><ti>force disabling of dma for malfunctioning ide devices</ti></tr>
359     <tr><ti>cdcache</ti><ti>cache the entire runtime portion of cd in ram. This uses 40mb of RAM, but allows you to umount <path>/mnt/cdrom</path> and mount another cdrom</ti></tr>
360     </table>
361 drobbins 1.70
362 swift 1.149 <p>
363     Once you hit Enter, you will be greeted with an even fancier boot
364     screen and progress bar.
365     </p>
366 swift 1.142
367 swift 1.149 <p>
368     Once the boot process completes, you will be automatically logged in
369     to the "Live" Gentoo Linux as "<e>root</e>", the "super user". You should
370     have a root ("#") prompt on the current console and can also switch
371     to other consoles by pressing Alt-F2, Alt-F3 and Alt-F4. Get back to the one
372     you started on by pressing Alt-F1.
373     </p>
374    
375     <note>
376     <b>Advanced users:</b> When the Live CD boots, the Live CD root password is
377 swift 1.142 set to a random string for security purposes. If you plan to start
378     <c>sshd</c> to allow remote logins to your Live CD, you should set the Live
379     CD root password now by typing <c>passwd</c> and following the prompts.
380     Otherwise, you will not know the proper password for logging into the Live
381 swift 1.149 CD over the network.
382     </note>
383    
384     <p>
385     You've probably also noticed that above your # prompt is a bunch of
386     help text that explains how to do things like configure your Linux networking
387     and telling you where you can find the Gentoo Linux stage tarballs and packages
388     on your CD.
389     </p>
390    
391     </body>
392     </section>
393     </chapter>
394    
395     <chapter>
396     <title>Optional hardware configuration</title>
397     <section>
398     <body>
399    
400     <p>
401     When the Live CD boots, it tries to detect all your hardware
402     devices and loads the appropiate kernel modules to support your
403     hardware. In the vast majority of cases, it does a very good job.
404     However, in some cases, it may not auto-load the kernel modules
405     you need. If the PCI auto-detection missed some of your system's hardware, you
406     will have to load the appropriate kernel modules manually.
407     To view a list of all available network card modules, type <c>ls
408     /lib/modules/`uname -r`/kernel/drivers/net/*</c>. To load a particular module,
409     type:
410     </p>
411 swift 1.142
412 jhhudso 1.81 <pre caption="PCI Modules Configuration">
413 swift 1.149 # <i>modprobe pcnet32</i>
414 zhen 1.6 <comment>(replace pcnet32 with your NIC module)</comment>
415 jhhudso 1.81 </pre>
416 swift 1.149
417     <p>
418     Likewise, if you want to be able to access any SCSI hardware that wasn't
419     detected during the initial boot autodetection process, you will need to
420     load the appropriate modules from <path>/lib/modules</path>, again using
421     <c>modprobe</c>:
422     </p>
423    
424 jhhudso 1.81 <pre caption="Loading SCSI Modules">
425 swift 1.149 # <i>modprobe aic7xxx</i>
426 jhhudso 1.73 <comment>(replace aic7xxx with your SCSI adapter module)</comment>
427 swift 1.149 # <i>modprobe sd_mod</i>
428 jhhudso 1.73 <comment>(sd_mod is the module for SCSI disk support)</comment>
429 jhhudso 1.81 </pre>
430 swift 1.149
431     <note>
432     Support for SCSI CD-ROMs and disks are built-in in the kernel.
433     </note>
434    
435     <note>
436     <b>Advanced users:</b> The Gentoo LiveCD should have enabled DMA
437     on your disks so that disk transfers are as fast as possible, but if it did not,
438     <c>hdparm</c> can be used to set DMA on your drives as follows:
439     <pre caption="Setting DMA">
440     <comment>(Replace hdX with your disk device)</comment>
441     # <i>hdparm -d 1 /dev/hdX</i>
442     <comment>(Enables DMA)</comment>
443     # <i>hdparm -d1 -A1 -m16 -u1 -a64 /dev/hdX</i>
444 jhhudso 1.75 <comment>(Enables DMA and other safe performance-enhancing options)</comment>
445 swift 1.149 # <i>hdparm -X66 /dev/hdX</i>
446 jhhudso 1.75 <comment>(Force-enables Ultra-DMA -- dangerous -- may cause some drives to mess up)</comment>
447     </pre>
448 swift 1.149 </note>
449 swift 1.142
450    
451 swift 1.149 </body>
452     </section>
453     </chapter>
454     <chapter>
455     <title>Optional Networking configuration</title>
456     <section>
457     <title>Maybe it just works?</title>
458     <body>
459    
460     <p>
461     If your system is plugged into an Ethernet network, it is very
462     likely that your networking configuration has already been
463     set up automatically for you. If so, you should be able to take advantage of
464     the many included network-aware commands on the LiveCD such as <c>ssh</c>,
465 swift 1.173 <c>scp</c>, <c>ping</c>, <c>irssi</c>, <c>wget</c> and <c>links</c>, among
466 swift 1.149 others.
467     </p>
468 drobbins 1.70
469 swift 1.149 <p>
470     If networking has been configured for you, the <c>/sbin/ifconfig</c> command
471     should list some internet interfaces besides lo, such as eth0:
472     </p>
473    
474 jhhudso 1.81 <pre caption="/sbin/ifconfig for a working network card">
475 drobbins 1.70 eth0 Link encap:Ethernet HWaddr 00:50:BA:8F:61:7A
476     inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
477     inet6 addr: fe80::50:ba8f:617a/10 Scope:Link
478     UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
479     RX packets:1498792 errors:0 dropped:0 overruns:0 frame:0
480     TX packets:1284980 errors:0 dropped:0 overruns:0 carrier:0
481     collisions:1984 txqueuelen:100
482     RX bytes:485691215 (463.1 Mb) TX bytes:123951388 (118.2 Mb)
483 swift 1.149 Interrupt:11 Base address:0xe800
484 jhhudso 1.81 </pre>
485 swift 1.149
486     <p>
487     You may want to also try pinging your ISP's DNS server (found in
488     <path>/etc/resolv.conf</path>) and a Web site of choice, just to make sure
489     that your packets are reaching the net, DNS name resolution is working
490     correctly, etc..
491     </p>
492    
493 jhhudso 1.81 <pre caption="Further Network Testing">
494 swift 1.149 # <i>ping -c 3 www.yahoo.com</i>
495 jhhudso 1.81 </pre>
496 swift 1.149
497     <p>
498     Are you able to use your network? If so, you can skip the rest of this
499     section.
500     </p>
501    
502     </body>
503     </section>
504     <section>
505     <title>PPPoE configuration</title>
506     <body>
507    
508     <p>
509     Assuming you need PPPoE to connect to the internet, the LiveCD (any version)
510     has made things easy for you by including <c>rp-pppoe</c>. Use the provided
511     <c>adsl-setup</c> script to configure your connection. You will be prompted
512     for the ethernet device that is connected to your adsl modem, your username
513     and password, the IPs of your DNS servers and if you need a basic firewall
514     or not.
515     </p>
516    
517 jhhudso 1.81 <pre caption="Configuring PPPoE">
518 swift 1.149 # <i> adsl-setup </i>
519     # <i> adsl-start </i>
520 jhhudso 1.81 </pre>
521 swift 1.149
522     <p>
523     If something goes wrong, double-check that you correctly typed your username
524     and password by looking at <path>/etc/ppp/pap-secrets</path> or
525     <path>/etc/ppp/chap-secrets</path> and make sure you are using the right
526     ethernet device.
527     </p>
528    
529     </body>
530     </section>
531    
532     <section>
533     <title>Automatic Network Configuration </title>
534     <body>
535    
536     <p>
537     The simplest way to set up networking if it didn't get configured
538     automatically is to run the <c>net-setup</c> script:
539     </p>
540    
541 jhhudso 1.81 <pre caption="Net-Setup Script">
542 swift 1.149 # <i>net-setup eth0</i>
543 jhhudso 1.81 </pre>
544 swift 1.149
545     <p>
546     Of course, if you prefer, you may still set up networking manually. This is
547     covered next.
548     </p>
549    
550     </body>
551     </section>
552     <section>
553     <title>Manual DHCP Configuration</title>
554     <body>
555    
556     <p>
557     Network configuration is simple with DHCP; If your ISP is not using
558     DHCP, skip down to the static configuration section below.
559     </p>
560    
561 jhhudso 1.81 <pre caption="Network configuration with DHCP">
562 swift 1.149 # <i>dhcpcd eth0</i>
563 jhhudso 1.81 </pre>
564 swift 1.149
565     <note>
566     Some ISPs require you to provide a hostname. To do that, add a
567     <c>-h myhostname</c> flag to the dhcpcd command line above.
568     </note>
569    
570     <p>
571     If you receive <e>dhcpConfig</e> warnings, don't panic; the errors are most
572     likely cosmetic. Skip down to Network testing below.
573     </p>
574    
575     </body>
576     </section>
577     <section>
578     <title>Manual Static Configuration</title>
579     <body>
580    
581     <p>
582     We need to setup just enough networking so that we can download sources for
583     the system build, as well as the required localhost interface. The needed
584     information is explained in the next table.
585     </p>
586 swift 1.117
587     <table>
588 swift 1.167 <tcolumn width="1.25in"/>
589     <tcolumn width="4in"/>
590     <tcolumn width="1.25in"/>
591 swift 1.117 <tr><th>Information</th><th>Description</th><th>Example value</th></tr>
592 swift 1.142 <tr><ti>IP address</ti><ti>The IP address you want to assign to your network card</ti><ti>192.168.1.2</ti></tr>
593 swift 1.149 <tr><ti>Broadcast address</ti><ti>The IP address which will broadcast the packets to all the hosts in the network</ti><ti>192.168.1.255</ti></tr>
594 swift 1.117 <tr><ti>Network mask</ti><ti>The mask which is used together with the IP address to see what part of the address is for network-identification and host-identification</ti><ti>255.255.255.0</ti></tr>
595 swift 1.142 <tr><ti>Gateway</ti><ti>The IP address of the computer which will forward the packets that are not meant for the local network (most of the time the computer which shares the internet connection)</ti><ti>192.168.1.1</ti></tr>
596 swift 1.117 </table>
597 swift 1.149
598     <p>
599     Type in the following commands, replacing <c>$IFACE</c> with your network
600     interface (typically <c>eth0</c>), <c>$IPNUM</c> with your IP address,
601     <c>$BCAST</c> with your broadcast address and <c>$NMASK</c> with your network
602     mask. For the <c>route</c> command, replace <c>$GTWAY</c> with your default
603     gateway.
604     </p>
605    
606 jhhudso 1.81 <pre caption="Static IP Network Configuration">
607 swift 1.149 # <i>ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK</i>
608     # <i>route add -net default gw $GTWAY netmask 0.0.0.0 metric 1 $IFACE</i>
609 jhhudso 1.81 </pre>
610 swift 1.149
611     <p>
612     Now it is time to create the <path>/etc/resolv.conf</path> file so that name
613     resolution (finding Web/FTP sites by name, rather than just by IP address)
614     will work. You can use <c>nano -w /etc/resolv.conf</c> to create
615     <path>/etc/resolv.conf</path>. <c>nano</c> is a small and easy-to-use
616     editor.
617     </p>
618    
619     <p>
620     Here is a template to follow for creating your <path>/etc/resolv.conf</path>
621     file:
622     </p>
623    
624 jhhudso 1.81 <pre caption="/etc/resolv.conf template">
625 drobbins 1.1 domain mydomain.com
626     nameserver 10.0.0.1
627     nameserver 10.0.0.2
628 jhhudso 1.81 </pre>
629 swift 1.149
630     <p>
631     Replace <c>10.0.0.1</c> and <c>10.0.0.2</c> with the IP addresses of your
632     primary and secondary DNS servers respectively.
633     </p>
634    
635     </body>
636     </section>
637    
638     <section>
639     <title>Proxy Configuration</title>
640     <body>
641    
642     <p>
643     If you are behind a proxy, it could be necessary to configure your proxy
644     before you continue. We will export some variables to set up the proxy
645     accordingly.
646     </p>
647    
648 jhhudso 1.81 <pre caption="Setting a Proxy">
649 swift 1.149 <comment>If the proxy restricts HTTP traffic:</comment>
650 swift 1.158 # <i>export http_proxy="http://machine.company.com:1234"</i>
651 swift 1.149 <comment>If the proxy restricts FTP traffic:</comment>
652 swift 1.158 # <i>export ftp_proxy="ftp://machine.company.com"</i>
653 swift 1.149 <comment>If the proxy restricts RSYNC traffic:</comment>
654 swift 1.158 # <i>export RSYNC_PROXY="rsync://machine.company.com"</i>
655 swift 1.149 </pre>
656    
657     </body>
658     </section>
659    
660     <section>
661     <title>Networking is go!</title>
662     <body>
663    
664     <p>
665     Networking should now be configured and usable. You should be able to use the
666 swift 1.173 included <c>ssh</c>, <c>scp</c>, <c>links</c>, <c>irssi</c> and <c>wget</c>
667 swift 1.149 commands to connect to other machines on your LAN or the Internet.
668     </p>
669    
670     </body>
671     </section>
672     </chapter>
673    
674     <chapter>
675     <title>Setting your system's date and time</title>
676     <section>
677     <body>
678    
679     <p>
680     Now you need to set your system's date and time. You can do this using the
681     <c>date</c> command.
682     </p>
683    
684 jhhudso 1.81 <pre caption="Setting your system's date">
685 swift 1.149 # <i>date</i>
686 jhhudso 1.81 Thu Feb 27 09:04:42 CST 2003
687     <comment>(If your date is wrong, set your date with this next command)</comment>
688 swift 1.149 # <i>date 022709042003</i>
689 jhhudso 1.81 <comment>(date MMDDhhmmCCYY)</comment>
690     </pre>
691 swift 1.149
692     </body>
693     </section>
694     </chapter>
695    
696     <chapter>
697     <title>Filesystems, partitions and block devices</title>
698     <section>
699     <title>Introduction to block devices</title>
700     <body>
701    
702     <p>
703     In this section, we'll take a good look at disk-oriented aspects of Gentoo
704     Linux and Linux in general, including Linux filesystems, partitions and block
705     devices. Then, once you're familiar with the ins and outs of disks and
706     filesystems, you'll be guided through the process of setting up partitions
707     and filesystems for your Gentoo Linux installation.
708 drobbins 1.86 </p>
709 swift 1.149
710 drobbins 1.86 <p>
711     To begin, I'll introduce "block devices". The most famous block device is
712     probably the one that represents the first IDE drive in a Linux system:
713     </p>
714 swift 1.149
715 drobbins 1.86 <pre caption="/dev/hda, the block device representing the primary master IDE drive in your system">
716     /dev/hda
717     </pre>
718    
719     <p>
720     If your system uses SCSI drives, then your first hard drive will be:
721     </p>
722    
723     <pre caption="/dev/sda, the block device representing the first logical SCSI drive in your system">
724     /dev/sda
725     </pre>
726    
727 swift 1.149 <p>
728     The block devices above represent an <e>abstract</e> interface to the disk.
729 drobbins 1.86 User programs can use these block devices to interact with your disk without
730 swift 1.149 worrying about whether your drives are IDE, SCSI or something else. The
731 drobbins 1.86 program can simply address the storage on the disk as a bunch of contiguous,
732 swift 1.149 randomly-accessible 512-byte blocks.
733     </p>
734    
735 drobbins 1.86 </body>
736     </section>
737     <section>
738     <title>Partitions and fdisk</title>
739     <body>
740    
741 swift 1.149 <p>
742     Under Linux, we create filesystems by using a special command called
743     <c>mkfs</c> (or <c>mke2fs</c>, <c>mkreiserfs</c>, etc.), specifying a particular
744     block device as a command-line argument.
745     </p>
746    
747     <p>
748     However, although it is theoretically possible to use a "whole disk" block
749     device (one that represents the <e>entire</e> disk) like <path>/dev/hda</path>
750     or <path>/dev/sda</path> to house a single filesystem, this is almost never
751     done in practice. Instead, full disk block devices are split up into smaller,
752     more manageable block devices called "partitions". Partitions are created
753     using a tool called <c>fdisk</c>, which is used to create and edit the
754     partition table that's stored on each disk. The partition table defines
755     exactly how to split up the full disk.
756     </p>
757    
758     <p>
759     We can take a look at a disk's partition table by running <c>fdisk</c>,
760     specifying a block device that represents a full disk as an argument:
761     </p>
762 drobbins 1.86
763 swift 1.149 <note>
764     Alternate interfaces to the disk's partition table include <c>cfdisk</c>,
765 swift 1.142 <c>parted</c> and <c>partimage</c>. We recommend <c>fdisk</c> because it's
766 swift 1.149 more powerful and well known in the Unix/Linux world.
767     </note>
768 drobbins 1.86
769     <pre caption="Starting up fdisk">
770 swift 1.149 # <i>fdisk /dev/hda</i>
771 drobbins 1.86 </pre>
772 swift 1.149
773 drobbins 1.86 <p>
774     or
775     </p>
776 swift 1.149
777 drobbins 1.86 <pre caption="Starting up fdisk to look at the partition table on /dev/sda">
778 swift 1.149 # <i>fdisk /dev/sda</i>
779 drobbins 1.86 </pre>
780    
781     <impo>
782 swift 1.149 Note that you should <e>not</e> save or make any changes to a disk's
783 drobbins 1.86 partition table if any of its partitions contain filesystems that are in use or
784     contain important data. Doing so will generally cause data on the disk to be
785 swift 1.149 lost.
786 drobbins 1.86 </impo>
787    
788     <p>
789 swift 1.149 Once in <c>fdisk</c>, you'll be greeted with a prompt that looks like this:
790 drobbins 1.86 </p>
791    
792     <pre caption="The fdisk prompt">
793     Command (m for help):
794     </pre>
795    
796     <p>
797     Type <c>p</c> to display your disk's current partition configuration:
798     </p>
799    
800     <pre caption="An example partition configuration">
801 swift 1.149 Command (m for help): <i>p</i>
802 drobbins 1.86
803     Disk /dev/hda: 240 heads, 63 sectors, 2184 cylinders
804     Units = cylinders of 15120 * 512 bytes
805    
806     Device Boot Start End Blocks Id System
807     /dev/hda1 1 14 105808+ 83 Linux
808     /dev/hda2 15 49 264600 82 Linux swap
809     /dev/hda3 50 70 158760 83 Linux
810     /dev/hda4 71 2184 15981840 5 Extended
811     /dev/hda5 71 209 1050808+ 83 Linux
812     /dev/hda6 210 348 1050808+ 83 Linux
813     /dev/hda7 349 626 2101648+ 83 Linux
814     /dev/hda8 627 904 2101648+ 83 Linux
815     /dev/hda9 905 2184 9676768+ 83 Linux
816    
817     Command (m for help):
818     </pre>
819    
820 swift 1.149 <p>
821     This particular disk is configured to house seven Linux filesystems (each
822 drobbins 1.86 with a corresponding partition listed as "Linux") as well as a swap partition
823 swift 1.149 (listed as "Linux swap").
824     </p>
825 drobbins 1.86
826     <p>
827     Notice the name of the corresponding partition block
828 swift 1.149 devices on the left hand side, starting with <path>/dev/hda1</path> and going
829     up to <path>/dev/hda9</path>. In the early days of the PC, partitioning
830     software only allowed a maximum of four partitions (called "primary"
831     partitions). This was too limiting, so a workaround called <e>extended
832     partitioning</e> was created. An extended partition is very similar to a
833     primary partition and counts towards the primary partition limit of four.
834     However, extended partitions can hold any number of so-called <e>logical</e>
835     partitions inside them, providing an effective means of working around the
836     four partition limit.
837     </p>
838    
839     <p>
840     All partitions <path>/dev/hda5</path> and higher are logical partitions.
841     The numbers 1 through 4 are reserved for primary or extended partitions.
842 drobbins 1.86 </p>
843    
844     <p>
845 swift 1.149 So, In our example, <path>/dev/hda1</path> through <path>/dev/hda3</path> are
846     primary partitions. <path>/dev/hda4</path> is an extended partition that
847     contains logical partitions <path>/dev/hda5</path> through
848     <path>/dev/hda9</path>. You would never actually <e>use</e>
849     <path>/dev/hda4</path> for storing any filesystems directly -- it simply
850     acts as a container for partitions <path>/dev/hda5</path> through
851     <path>/dev/hda9</path>.
852     </p>
853 drobbins 1.86
854 swift 1.149 <p>
855     Also, notice that each partition has an "Id", also called a "partition
856 drobbins 1.86 type". Whenever you create a new partition, you should ensure that the
857     partition type is set correctly. '83' is the correct partition type for
858 swift 1.115 partitions that will be housing Linux filesystems, '82' is the correct
859     partition type for Linux swap partitions and 'fd' is the recommended partition
860     type for Software RAID partitions. You set the partition type using the
861 drobbins 1.86 <c>t</c> option in <c>fdisk</c>. The Linux kernel uses the partition type
862 peesh 1.99 setting to auto-detect filesystems and swap devices on the disk at boot-time.
863 drobbins 1.86 </p>
864 swift 1.149
865 drobbins 1.86 </body>
866     </section>
867 swift 1.149
868 drobbins 1.86 <section>
869     <title>Using fdisk to set up partitions</title>
870     <body>
871    
872 swift 1.149 <p>
873     Now that you've had your introduction to the way disk partitioning is
874 drobbins 1.86 done under Linux, it's time to walk you through the process of setting up disk
875     partitions for your Gentoo Linux installation. After we walk you through the
876     process of creating partitions on your disk, your partition configuration will
877 swift 1.149 look like this:
878     </p>
879 drobbins 1.86
880     <pre caption="The partition configuration that you will have after following these steps">
881     Disk /dev/hda: 30.0 GB, 30005821440 bytes
882     240 heads, 63 sectors/track, 3876 cylinders
883     Units = cylinders of 15120 * 512 = 7741440 bytes
884    
885 swift 1.149 Device Boot Start End Blocks Id System
886 drobbins 1.86 /dev/hda1 * 1 14 105808+ 83 Linux
887     /dev/hda2 15 81 506520 82 Linux swap
888     /dev/hda3 82 3876 28690200 83 Linux
889    
890     Command (m for help):
891     </pre>
892    
893 swift 1.149 <p>
894     In our suggested "newbie" partition configuration, we have three partitions.
895     The first one (<path>/dev/hda1</path>) at the beginning of the disk is a small
896 drobbins 1.86 partition called a boot partition. The boot partition's purpose is to hold all
897     the critical data related to booting -- GRUB boot loader information (if you
898     will be using GRUB) as well as your Linux kernel(s). The boot partition gives
899     us a safe place to store everything related to booting Linux. During normal
900     day-to-day Gentoo Linux use, your boot partition should remain <e>unmounted</e>
901 drobbins 1.87 for safety. If you are setting up a SCSI system, your boot partition will
902 swift 1.149 likely end up being <path>/dev/sda1</path>.
903     </p>
904 drobbins 1.86
905 swift 1.149 <p>
906     It's recommended to have boot partitions (containing everything necessary for
907 drobbins 1.98 the boot loader to work) at the beginning of the disk. While not necessarily
908     required anymore, it is a useful tradition from the days when the lilo boot
909     loader wasn't able to load kernels from filesystems that extended beyond disk
910     cylinder 1024.
911     </p>
912    
913 swift 1.149 <p>
914     The second partition (<path>/dev/hda2</path>) is used to for swap space. The
915 drobbins 1.86 kernel uses swap space as virtual memory when RAM becomes low. This partition,
916     relatively speaking, isn't very big either, typically somewhere around 512MB.
917 drobbins 1.87 If you're setting up a SCSI system, this partition will likely end up
918 swift 1.149 being called <path>/dev/sda2</path>.
919     </p>
920 drobbins 1.86
921 swift 1.149 <p>
922     The third partition (<path>/dev/hda3</path>) is quite large and takes up the
923     rest of the disk. This partition is called our "root" partition and will be
924     used to store your main filesystem that houses Gentoo Linux itself. On a SCSI
925     system, this partition would likely end up being <path>/dev/sda3</path>.
926     </p>
927 drobbins 1.86
928 swift 1.149 <p>
929     Before we partition the disk, here's a quick technical overview of the
930 drobbins 1.86 suggested partition and filesystem configuration to use when installing Gentoo
931 swift 1.149 Linux:
932     </p>
933 drobbins 1.86
934     <table>
935 swift 1.167 <tcolumn width="1.5in"/>
936     <tcolumn width="2.5in"/>
937     <tcolumn width="2.5in"/>
938     <tcolumn width="1in"/>
939 swift 1.149 <tr>
940     <th>Partition</th>
941     <th>Size</th>
942     <th>Type</th>
943     <th>example device</th>
944     </tr>
945     <tr>
946     <ti>boot partition, containing kernel(s) and boot information</ti>
947     <ti>32 Megabytes</ti>
948     <ti>ext2/3 highly recommended (easiest); if ReiserFS then mount with <c>-o notail</c>. If you will be using ext3 or ReiserFS, you must add the size of the journal to the partitionsize; in these cases 64 Megabytes is recommended</ti>
949     <ti><path>/dev/hda1</path></ti>
950     </tr>
951     <tr>
952     <ti>swap partition (no longer a 128 Megabyte limit, now 2GB)</ti>
953     <ti>Generally, configure a swap area that is between one and two times the size of the physical RAM in your system</ti>
954     <ti>Linux swap</ti>
955     <ti><path>/dev/hda2</path></ti>
956     </tr>
957     <tr>
958     <ti>root partition, containing main filesystem (/usr, /home, etc.)</ti>
959     <ti>&gt;=1.5 Gigabytes</ti>
960     <ti>ReiserFS, ext3 recommended; ext2 ok</ti>
961     <ti><path>/dev/hda3</path></ti>
962     </tr>
963 drobbins 1.86 </table>
964    
965 swift 1.149 <p>
966     OK, now to create the partitions as in the example and table above. First,
967 swift 1.95 enter fdisk by typing <c>fdisk /dev/hda</c> or <c>fdisk /dev/sda</c>,
968 drobbins 1.86 depending on whether you're using IDE or SCSI. Then, type <c>p</c> to view your
969     current partition configuration. Is there anything on the disk that you need
970     to keep? If so, <b>stop now</b>. If you continue with these directions, <b>all
971 swift 1.149 existing data on your disk will be erased</b>.
972     </p>
973 drobbins 1.86
974 swift 1.149 <impo>
975     Following these instructions below will cause all prior data on your disk
976 drobbins 1.86 to <b>be erased</b>! If there is anything on your drive, please be sure that it
977     is non-critical information that you don't mind losing. Also make sure that you
978     <b>have selected the correct drive</b> so that you don't mistakenly wipe data
979 swift 1.149 from the wrong drive.
980     </impo>
981 drobbins 1.86
982 swift 1.149 <p>
983     Now, it's time to delete any existing partitions. To do this, type <c>d</c>
984 drobbins 1.86 and hit Enter. You will then be prompted for the partition number you would like
985 swift 1.149 to delete. To delete a pre-existing <path>/dev/hda1</path>, you would type:
986     </p>
987 drobbins 1.86
988     <pre caption="Deleting a partition">
989 swift 1.149 Command (m for help): <i>d</i>
990     Partition number (1-4): <i>1</i>
991 drobbins 1.86 </pre>
992 zhen 1.54
993 swift 1.149 <p>
994     The partition has been scheduled for deletion. It will no longer show up if
995 drobbins 1.86 you type <c>p</c>, but it will not be erased until your changes have been
996     saved. If you made a mistake and want to abort without saving your changes,
997     type <c>q</c> immediately and hit enter and your partition will not be
998 swift 1.149 deleted.
999     </p>
1000    
1001     <p>
1002     Now, assuming that you do indeed want to wipe out all the partitions on your
1003 drobbins 1.86 system, repeatedly type <c>p</c> to print out a partition listing and then type
1004     <c>d</c> and the number of the partition to delete it. Eventually, you'll end up
1005 swift 1.149 with a partition table with nothing in it:
1006     </p>
1007 drobbins 1.86
1008     <pre caption="An empty partition table">
1009     Disk /dev/hda: 30.0 GB, 30005821440 bytes
1010     240 heads, 63 sectors/track, 3876 cylinders
1011     Units = cylinders of 15120 * 512 = 7741440 bytes
1012    
1013 swift 1.149 Device Boot Start End Blocks Id System
1014 drobbins 1.86
1015     Command (m for help):
1016     </pre>
1017    
1018 swift 1.149 <p>
1019     Now that the in-memory partition table is empty, we're ready to create a
1020 drobbins 1.86 boot partition. To do this, type <c>n</c> to create a new partition, then
1021     <c>p</c> to tell fdisk you want a primary partition. Then type <c>1</c> to
1022     create the first primary partition. When prompted for the first cylinder, hit
1023 swift 1.115 enter. When prompted for the last cylinder, type <c>+32M</c> to create a
1024 swift 1.149 partition 32MB in size. You can see output from these steps below:
1025     </p>
1026 swift 1.115
1027     <note>
1028     Journaled filesystems require extra space for their journal. Default settings
1029 swift 1.142 require about 33 Megabytes of space. Therefore, if you are using a journaled
1030 swift 1.115 filesystem for <path>/boot</path>, you should type <c>+64M</c> when prompted
1031     for the last cylinder.
1032     </note>
1033 drobbins 1.86
1034     <pre caption="Steps to create our boot partition">
1035 swift 1.149 Command (m for help): <i>n</i>
1036 drobbins 1.86 Command action
1037 swift 1.149 e extended
1038     p primary partition (1-4)
1039     <i>p</i>
1040     Partition number (1-4): <i>1</i>
1041     First cylinder (1-3876, default 1): <comment>(Hit Enter)</comment>
1042 drobbins 1.86 Using default value 1
1043 swift 1.149 Last cylinder or +size or +sizeM or +sizeK (1-3876, default 3876): <i>+32M</i>
1044 drobbins 1.86 </pre>
1045    
1046 swift 1.149 <p>
1047     Now, when you type <c>p</c>, you should see the following partition
1048     printout:
1049     </p>
1050 drobbins 1.86
1051     <pre caption="Our first partition has been created">
1052 swift 1.149 Command (m for help): <i>p</i>
1053 drobbins 1.86
1054     Disk /dev/hda: 30.0 GB, 30005821440 bytes
1055     240 heads, 63 sectors/track, 3876 cylinders
1056     Units = cylinders of 15120 * 512 = 7741440 bytes
1057    
1058 swift 1.149 Device Boot Start End Blocks Id System
1059     /dev/hda1 1 14 105808+ 83 Linux
1060 drobbins 1.86 </pre>
1061    
1062 swift 1.149 <p>
1063     Next, let's create the swap partition. To do this, type <c>n</c> to create a
1064     new partition, then <c>p</c> to tell fdisk that you want a primary partition.
1065     Then type <c>2</c> to create the second primary partition,
1066     <path>/dev/hda2</path> in our case. When prompted for the first cylinder,
1067     hit enter. When prompted for the last cylinder, type <c>+512M</c> to create
1068     a partition 512MB in size. After you've done this, type <c>t</c> to set the
1069     partition type, <c>2</c> to select the partition you just created and then
1070     type in <c>82</c> to set the partition type to "Linux Swap". After completing
1071     these steps, typing <c>p</c> should display a partition table that looks
1072     similar to this:
1073     </p>
1074 drobbins 1.86
1075     <pre caption="Our swap partition has been created">
1076 swift 1.149 Command (m for help): <i>p</i>
1077 drobbins 1.86
1078     Disk /dev/hda: 30.0 GB, 30005821440 bytes
1079     240 heads, 63 sectors/track, 3876 cylinders
1080     Units = cylinders of 15120 * 512 = 7741440 bytes
1081    
1082 swift 1.149 Device Boot Start End Blocks Id System
1083     /dev/hda1 1 14 105808+ 83 Linux
1084     /dev/hda2 15 81 506520 82 Linux swap
1085 drobbins 1.86 </pre>
1086    
1087 swift 1.149 <p>
1088     Finally, let's create the root partition. To do this, type <c>n</c> to
1089 drobbins 1.86 create a new partition, then <c>p</c> to tell fdisk that you want a primary
1090 carl 1.101 partition. Then type <c>3</c> to create the third primary partition,
1091 swift 1.149 <path>/dev/hda3</path> in our case. When prompted for the first cylinder,
1092     hit enter. When prompted for the last cylinder, hit enter to create a
1093     partition that takes up the rest of the remaining space on your disk. After
1094     completing these steps, typing <c>p</c> should display a partition table that
1095     looks similar to this:
1096     </p>
1097 drobbins 1.86
1098     <pre caption="Our root partition has been created">
1099 swift 1.149 Command (m for help): <i>p</i>
1100 drobbins 1.86
1101     Disk /dev/hda: 30.0 GB, 30005821440 bytes
1102     240 heads, 63 sectors/track, 3876 cylinders
1103     Units = cylinders of 15120 * 512 = 7741440 bytes
1104    
1105 swift 1.149 Device Boot Start End Blocks Id System
1106     /dev/hda1 1 14 105808+ 83 Linux
1107     /dev/hda2 15 81 506520 82 Linux swap
1108     /dev/hda3 82 3876 28690200 83 Linux
1109 drobbins 1.86 </pre>
1110    
1111     <p>
1112     Finally, we need to set the "bootable" flag on our boot partition and then write
1113 swift 1.149 our changes to disk. To tag <path>/dev/hda1</path> as a "bootable" partition,
1114     type <c>a</c> at the menu and then type in <c>1</c> for the partition number.
1115     If you type <c>p</c> now, you'll now see that <path>/dev/hda1</path> has a
1116     <c>*</c> in the "Boot" column. Now, let's write our changes to disk. To do
1117     this, type <c>w</c> and hit enter. Your disk partitions are now properly
1118     configured for a Gentoo Linux install.
1119 drobbins 1.86 </p>
1120    
1121 swift 1.149 <note>
1122     If <c>fdisk</c> or <c>cfdisk</c> instruct you to do so, please reboot to
1123     allow your system to detect the new partition configuration.
1124     </note>
1125    
1126 drobbins 1.86 </body>
1127     </section>
1128 swift 1.149
1129 drobbins 1.86 <section>
1130     <title>Creating filesystems</title>
1131     <body>
1132 swift 1.149
1133     <p>
1134     Now that the partitions have been created, it's time to set up filesystems on
1135     the boot and root partitions so that they can be mounted and used to store
1136     data. We will also configure the swap partition to serve as swap storage.
1137 drobbins 1.86 </p>
1138    
1139 swift 1.149 <p>
1140     Gentoo Linux supports a variety of different types of filesystems; each type has
1141     its strengths and weaknesses and its own set of performance characteristics.
1142     Currently, we support the creation of ext2, ext3, XFS, JFS and ReiserFS
1143     filesystems.
1144     </p>
1145 drobbins 1.86
1146 swift 1.149 <p>
1147     ext2 is the tried and true Linux filesystem but doesn't have metadata
1148 drobbins 1.86 journaling, which means that routine ext2 filesystem checks at startup time can
1149     be quite time-consuming. There is now quite a selection of newer-generation
1150 swift 1.149 <e>journaled</e> filesystems that can be checked for consistency very quickly
1151 drobbins 1.86 and are thus generally preferred over their non-journaled counterparts.
1152     Journaled filesystems prevent long delays when you boot your system and your
1153 swift 1.149 filesystem happens to be in an <e>inconsistent</e> state.
1154     </p>
1155 drobbins 1.86
1156 swift 1.149 <p>
1157     ext3 is the journaled version of the ext2 filesystem, providing metadata
1158 drobbins 1.86 journaling for fast recovery in addition to other enhanced journaling modes
1159     like full data and ordered data journaling. ext3 is a very good and reliable
1160 drobbins 1.88 filesystem. It offers generally decent performance under most conditions.
1161     Because it does not extensively employ the use of "trees" in its internal
1162     design, it doesn't scale very well, meaning that it is not an ideal choice for
1163     very large filesystems, or situations where you will be handling very large
1164     files or large quantities of files in a single directory. But when used within
1165 swift 1.149 its design parameters, ext3 is an excellent filesystem.
1166     </p>
1167 drobbins 1.86
1168 swift 1.149 <p>
1169     ReiserFS is a B*-tree based filesystem that has very good overall
1170 drobbins 1.86 performance and greatly outperforms both ext2 and ext3 when dealing with small
1171     files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales
1172     extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is
1173     now rock-solid and highly recommended for use both as a general-purpose
1174     filesystem and for extreme cases such as the creation of large filesystems, the
1175 swift 1.149 use of many small files, very large files and directories containing tens of
1176 drobbins 1.86 thousands of files. ReiserFS is the filesystem we recommend by default for all
1177 swift 1.149 non-boot partitions.
1178     </p>
1179 drobbins 1.86
1180 swift 1.149 <p>
1181     XFS is a filesystem with metadata journaling that is fully supported under
1182     Gentoo Linux's <c>xfs-sources</c> kernel. It comes with a robust
1183 drobbins 1.86 feature-set and is optimized for scalability. We only recommend using this
1184     filesystem on Linux systems with high-end SCSI and/or fibre channel storage and
1185     a uninterruptible power supply. Because XFS aggressively caches in-transit data
1186     in RAM, improperly designed programs (those that don't take proper precautions
1187 swift 1.149 when writing files to disk and there are quite a few of them) can lose a good
1188     deal of data if the system goes down unexpectedly.
1189     </p>
1190 drobbins 1.86
1191 swift 1.149 <p>
1192     JFS is IBM's high-performance journaling filesystem. It has recently
1193     become production-ready and there hasn't been a sufficient track record to
1194 swift 1.142 comment positively nor negatively on its general stability at this
1195 swift 1.149 point.
1196     </p>
1197 drobbins 1.86
1198 swift 1.149 <p>
1199     If you're looking for the most rugged journaling filesystem, use ext3. If
1200 drobbins 1.86 you're looking for a good general-purpose high-performance filesystem with
1201     journaling support, use ReiserFS; both ext3 and ReiserFS are mature,
1202 swift 1.149 refined and recommended for general use.
1203     </p>
1204 drobbins 1.86
1205 swift 1.149 <p>
1206     Based on our example above, we will use the following commands to initialize
1207     all our partitions for use:
1208     </p>
1209 drobbins 1.86
1210     <pre caption="Initializing our partitions (example)">
1211 swift 1.149 # <i>mke2fs -j /dev/hda1</i>
1212     # <i>mkswap /dev/hda2</i>
1213     # <i>mkreiserfs /dev/hda3</i>
1214 drobbins 1.86 </pre>
1215    
1216 swift 1.149 <p>
1217     We choose ext3 for our <path>/dev/hda1</path> boot partition because it is a
1218 drobbins 1.98 robust journaling filesystem supported by all major boot loaders. We used
1219 swift 1.149 <c>mkswap</c> for our <path>/dev/hda2</path> swap partition -- the choice is
1220     obvious here. And for our main root filesystem on <path>/dev/hda3</path> we
1221     choose ReiserFS, since it is a solid journaling filesystem offering excellent
1222     performance. Now, go ahead and initialize your partitions.
1223     </p>
1224    
1225     <p>
1226     For your reference, here are the various <c>mkfs</c>-like commands available
1227     during the installation process:
1228     </p>
1229 drobbins 1.98
1230 swift 1.149 <p>
1231     <c>mkswap</c> is the command that is used to initialize swap partitions:
1232     </p>
1233 drobbins 1.86
1234 jhhudso 1.81 <pre caption="Initializing Swap">
1235 swift 1.149 # <i>mkswap /dev/hda2</i>
1236 jhhudso 1.81 </pre>
1237 swift 1.149
1238     <p>
1239     You can use the <c>mke2fs</c> command to create ext2 filesystems:
1240     </p>
1241    
1242 jhhudso 1.81 <pre caption="Creating an ext2 Filesystem">
1243 drobbins 1.1 # <i>mke2fs /dev/hda1</i>
1244 jhhudso 1.81 </pre>
1245 swift 1.149
1246     <p>
1247     If you would like to use ext3, you can create ext3 filesystems using
1248     <c>mke2fs -j</c>:
1249     </p>
1250    
1251 drobbins 1.86 <pre caption="Creating an ext3 Filesystem">
1252 swift 1.149 # <i>mke2fs -j /dev/hda3</i>
1253 drobbins 1.86 </pre>
1254 swift 1.149
1255     <note>
1256     You can find out more about using ext3 under Linux 2.4 at
1257     <uri>http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html</uri>.
1258     </note>
1259    
1260     <p>
1261     To create ReiserFS filesystems, use the <c>mkreiserfs</c> command:
1262     </p>
1263    
1264 drobbins 1.86 <pre caption="Creating a ReiserFS Filesystem">
1265 swift 1.149 # <i>mkreiserfs /dev/hda3</i>
1266 drobbins 1.86 </pre>
1267 swift 1.149
1268     <p>
1269     To create an XFS filesystem, use the <c>mkfs.xfs</c> command:
1270     </p>
1271    
1272 jhhudso 1.81 <pre caption="Creating a XFS Filesystem">
1273 swift 1.149 # <i>mkfs.xfs /dev/hda3</i>
1274 jhhudso 1.81 </pre>
1275 drobbins 1.86
1276 swift 1.149 <note>
1277     You may want to add a couple of additional flags to the <c>mkfs.xfs</c>
1278     command: <c>-d agcount=3 -l size=32m</c>. The <c>-d agcount=3</c> command
1279     will lower the number of allocation groups. XFS will insist on using at
1280     least 1 allocation group per 4 GB of your partition, so, for example, if
1281     you have a 20 GB partition you will need a minimum agcount of 5. The
1282     <c>-l size=32m</c> command increases the journal size to 32 Mb, increasing
1283     performance.
1284     </note>
1285    
1286     <p>
1287     To create JFS filesystems, use the <c>mkfs.jfs</c> command:
1288     </p>
1289    
1290 jhhudso 1.81 <pre caption="Creating a JFS Filesystem">
1291 swift 1.149 # <i>mkfs.jfs /dev/hda3</i>
1292 jhhudso 1.81 </pre>
1293 swift 1.149
1294     </body>
1295     </section>
1296     </chapter>
1297    
1298     <chapter>
1299     <title>Mount Partitions</title>
1300     <section>
1301     <body>
1302    
1303     <p>
1304     Now, we will activate our newly-initialized swap volume, since we may need
1305     the additional virtual memory that it provides later:
1306     </p>
1307    
1308 jhhudso 1.81 <pre caption="Activating Swap">
1309 swift 1.149 # <i>swapon /dev/hda2</i>
1310 jhhudso 1.81 </pre>
1311 drobbins 1.86
1312 swift 1.149 <p>
1313     Next, we will create the <path>/mnt/gentoo/boot</path> mount point,
1314     and we will mount our filesystems to the mount points. Once our boot and
1315     root filesystems are mounted, any files we copy or create inside
1316     <path>/mnt/gentoo</path> will be placed on our new filesystems.
1317     Note that if you are setting up Gentoo Linux with separate
1318     <path>/usr</path> or <path>/var</path> filesystems, these would get mounted to
1319     <path>/mnt/gentoo/usr</path> and <path>/mnt/gentoo/var</path> respectively.
1320     </p>
1321    
1322     <impo>
1323     If your <path>/boot</path> partition (the one holding the kernel) is ReiserFS,
1324     be sure to mount it with the <c>-o notail</c> option so GRUB gets properly
1325     installed. Make sure that <c>notail</c> ends up in your new
1326     <path>/etc/fstab</path> boot partition entry, too.
1327     We will get to that in a bit. If you are going to use LILO with ReiserFS,
1328     then the <c>-o notail</c> is not needed. It's always safe to specify the
1329     <c>-o notail</c> option with ReiserFS if you're not sure what to do.
1330     </impo>
1331 drobbins 1.86
1332 jhhudso 1.81 <pre caption="Creating Mount Points">
1333 swift 1.149 # <i>mount /dev/hda3 /mnt/gentoo</i>
1334     # <i>mkdir /mnt/gentoo/boot</i>
1335     # <i>mount /dev/hda1 /mnt/gentoo/boot</i>
1336 jhhudso 1.81 </pre>
1337 drobbins 1.86
1338 swift 1.149 <impo>
1339     If you are having problems mounting your boot partition with ext2, try using
1340     <c>mount /dev/hXX /mnt/gentoo/boot -t ext2</c>
1341     </impo>
1342    
1343     </body>
1344     </section>
1345     </chapter>
1346    
1347    
1348     <chapter>
1349     <title>Stage tarballs and chroot</title>
1350     <section>
1351     <title>Selecting the desired stage tarball</title>
1352     <body>
1353 zhen 1.55
1354 drobbins 1.86 <p>
1355     Now, you need to decide which one you would like to use as a
1356 swift 1.149 basis for the install if you haven't already. The stages on the Live CD are
1357     in <path>/mnt/cdrom/stages/</path> and you can type <c>ls
1358     /mnt/cdrom/stages/</c> to see what's available on your CD.
1359     </p>
1360 drobbins 1.86
1361 swift 1.149 <p>
1362     <b>GRP users</b> should use the <path>stage3-xx-yy.tar.bz2</path> tarball.
1363     </p>
1364 drobbins 1.86
1365 swift 1.149 <p>
1366     If you would like to perform an install using a stage tarball that is
1367     <e>not</e> on your CD (which will likely be the case if you're using our
1368 swift 1.142 "basic" Live CD), this is still possible, but you'll need to download the
1369 drobbins 1.86 stage you want using the following instructions. If you already have the stage
1370 swift 1.142 tarball you want to use (which most users will have), then proceed to the
1371 swift 1.149 "Extracting the stage tarball" section.
1372     </p>
1373 drobbins 1.86
1374 swift 1.163 <note>
1375 swift 1.173 If you want to use a proxy (say proxy.server.tld:8080), add
1376     <c>-http-proxy proxy.server.tld:8080</c> to the <c>links</c> command
1377     mentioned below.
1378 swift 1.163 </note>
1379    
1380 jhhudso 1.81 <pre caption="Downloading Required Stages">
1381 swift 1.149 # <i>cd /mnt/gentoo</i>
1382 swift 1.173 <comment>Use links to get the URL for your tarball:</comment>
1383     # <i>links http://gentoo.oregonstate.edu/releases/x86/1.4/</i>
1384 zhware 1.47 <comment>Use <c>Up</c> and <c>Down</c> arrows keys (or the <c>TAB</c> key) to go to the right directory
1385     Highlight the appropriate stage you want to download
1386     Press <c>d</c> which will initiate the download
1387     Save the file and quit the browser
1388    
1389     <b>OR</b> use wget from the command line:</comment>
1390 swift 1.149 # <i>wget </i><comment>(insert URL to the required stage tarball here)</comment>
1391 jhhudso 1.81 </pre>
1392 drobbins 1.86
1393 swift 1.149 </body>
1394     </section>
1395     <section>
1396     <title>Extracting the stage tarball</title>
1397     <body>
1398    
1399     <p>
1400     Now it is time to extract the compressed stage tarball of your choice to
1401 drobbins 1.86 <path>/mnt/gentoo/</path>. Remember, you only need to unpack <b>one</b> stage
1402     tarball, either a stage1, stage2 or stage3. So, if you wanted to perform a
1403     stage3 install of Gentoo, then you would just unpack the stage3 tarball.
1404 swift 1.149 Unpack the stage tarball as follows:
1405     </p>
1406 drobbins 1.86
1407 swift 1.149 <impo>
1408     Be sure to use the <c>p</c> option with <c>tar</c>. Forgetting to do this will
1409     cause certain files to have incorrect permissions.
1410     </impo>
1411 drobbins 1.86
1412 jhhudso 1.81 <pre caption="Unpacking the Stages">
1413 swift 1.149 # <i>cd /mnt/gentoo</i>
1414 drobbins 1.86 <comment>Change "stage3" to "stage2" or "stage1" if you want to start from these stages instead.</comment>
1415     <comment>If you downloaded your stage tarball, change the path below to begin with "/mnt/gentoo/"
1416 swift 1.142 instead of "/mnt/cdrom/stages/".</comment>
1417 swift 1.149 # <i>tar -xvjpf /mnt/cdrom/stages/stage3-*.tar.bz2</i>
1418 drobbins 1.86 </pre>
1419    
1420 swift 1.149 <p>
1421     If you downloaded your stage tarball to <path>/mnt/gentoo</path>, you can now
1422     delete it by typing <c>rm /mnt/gentoo/stage*.tar.bz2</c>.
1423     </p>
1424    
1425 drobbins 1.86 </body>
1426     </section>
1427 swift 1.149
1428 drobbins 1.86 <section>
1429 swift 1.142 <title>GRP package/snapshot steps</title>
1430     <body>
1431 swift 1.149
1432     <impo>
1433 swift 1.172 The following instructions are for GRP users only. If you are not using
1434     GRP, continue with "Selecting Mirrors (Optional)".
1435 swift 1.149 </impo>
1436    
1437     <p>
1438     <b>GRP Users</b>: There is a Portage snapshot on the Live CD. You will
1439 swift 1.142 need to use this snapshot so that you can skip the <c>emerge sync</c> step
1440     later in this document, since <c>emerge sync</c> requires a network
1441 swift 1.149 connection. Untar this snapshot as follows:
1442     </p>
1443    
1444 swift 1.142 <pre caption="Using Portage snapshot">
1445     <comment>Replace yyyymmdd with the datestamp in the filename.</comment>
1446 swift 1.149 # <i>tar -xvjf /mnt/cdrom/snapshots/portage-yyyymmdd.tar.bz2 -C /mnt/gentoo/usr</i>
1447 swift 1.142 </pre>
1448 swift 1.149
1449     <p>
1450     This will extract a snapshot of the Portage tree to your fresh Gentoo
1451 swift 1.142 install. Now you won't need to connect to the Internet and use <c>emerge
1452     sync</c> to download a Portage tree. Now, copy distfiles and packages
1453 swift 1.149 from the Live CD into place:
1454     </p>
1455 swift 1.142
1456     <pre caption="Copying GRP files">
1457 swift 1.159 # <i>cp -R /mnt/cdrom/distfiles /mnt/gentoo/usr/portage/distfiles</i>
1458     # <i>cp -a /mnt/cdrom/packages /mnt/gentoo/usr/portage/packages</i>
1459 swift 1.142 </pre>
1460    
1461 swift 1.149 <p>
1462     All relevant files are now in place for using GRP. You should now have
1463 swift 1.142 everything copied over and unpacked that you'll need to install Gentoo Linux
1464 swift 1.149 -- even without a network connection.
1465     </p>
1466 swift 1.142
1467     </body>
1468     </section>
1469 swift 1.149
1470 antifa 1.150 <section>
1471     <title>Selecting Mirrors (Optional)</title>
1472     <body>
1473    
1474     <p>
1475     <c>mirrorselect</c> is a tool designed to automatically pick the fastest
1476     mirrors based on your location, or manually pick a mirror from a list.
1477     Unfortunately, <c>mirrorselect</c> does not work well behind all routers.
1478     </p>
1479    
1480     <pre caption="Using mirrorselect">
1481     <comment>To select a mirror automatically:</comment>
1482 swift 1.151 # <i>mirrorselect -a -s4 -o &gt;&gt; /mnt/gentoo/etc/make.conf</i>
1483 antifa 1.150 <comment>To select a mirror interactively:</comment>
1484 swift 1.151 # <i>mirrorselect -i -o &gt;&gt; /mnt/gentoo/etc/make.conf</i>
1485 antifa 1.150 </pre>
1486    
1487     <p>
1488     If for some reason <c>mirrorselect</c> fails you should be able to
1489     continue with this guide since no changes are made.
1490     </p>
1491    
1492     </body>
1493     </section>
1494 swift 1.142 <section>
1495 drobbins 1.86 <title>Entering the chroot</title>
1496     <body>
1497 swift 1.149
1498 drobbins 1.86 <p>
1499 swift 1.149 Next, we will <c>chroot</c> over to the new Gentoo Linux build installation to
1500     "enter" the new Gentoo Linux system:
1501 drobbins 1.86 </p>
1502 swift 1.112
1503     <note>
1504     You may receive a notice during <c>env-update</c> telling you that
1505 swift 1.113 <path>/etc/make.profile/make.defaults</path> isn't available: ignore it. We are
1506 swift 1.142 going to issue <c>emerge sync</c> later on in this document, which will resolve
1507 swift 1.112 the problem.
1508     </note>
1509 drobbins 1.86
1510     <pre caption="Prepping and entering the chroot environment">
1511 swift 1.149 # <i>mount -t proc proc /mnt/gentoo/proc</i>
1512     # <i>cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</i>
1513     # <i>chroot /mnt/gentoo /bin/bash</i>
1514     # <i>env-update</i>
1515 drobbins 1.1 Regenerating /etc/ld.so.cache...
1516 swift 1.149 # <i>source /etc/profile</i>
1517     <comment>(The above points your shell to the new paths and updated binaries)</comment>
1518 swift 1.132 </pre>
1519 swift 1.133
1520 swift 1.149 <p>
1521     After you execute these commands, you will be "inside" your new Gentoo Linux
1522     environment in <path>/mnt/gentoo</path>. We can perform the rest of the
1523     installation process inside the chroot.
1524     </p>
1525 swift 1.132
1526 swift 1.149 </body>
1527     </section>
1528     </chapter>
1529 swift 1.142
1530 swift 1.149 <chapter>
1531     <title>Getting the Current Portage Tree using sync</title>
1532     <section>
1533     <body>
1534 swift 1.142
1535 swift 1.149 <impo>
1536     If you are doing a GRP install then you can ignore the following section on
1537     <c>emerge sync</c>.
1538     </impo>
1539 swift 1.142
1540 swift 1.149 <p>
1541     Now, you will need to run <c>emerge sync</c>. This command tells Portage
1542 swift 1.142 to download the most recent copy of the Gentoo Linux Portage tree from the
1543 swift 1.149 Internet. If you extracted a Portage tree snapshot from <e>CD 1</e> earlier,
1544     you can safely skip this step. The Portage tree contains all the scripts
1545 swift 1.142 (called ebuilds) used to build every package under Gentoo Linux. Currently,
1546     we have ebuild scripts for close to 4000 packages. Once <c>emerge sync</c>
1547     completes, you will have a complete Portage tree in
1548 swift 1.149 <path>/usr/portage</path>:
1549     </p>
1550 drobbins 1.86
1551 jhhudso 1.81 <pre caption="Updating Using sync">
1552 swift 1.149 # <i>emerge sync</i>
1553 drobbins 1.86 </pre>
1554    
1555 swift 1.149 </body>
1556     </section>
1557     </chapter>
1558    
1559     <chapter>
1560     <title>Setting Gentoo optimizations (make.conf)</title>
1561     <section>
1562     <body>
1563    
1564     <p>
1565     Now that you have a working copy of the Portage tree, it is time to
1566 drobbins 1.86 customize the optimization and optional build-time settings to use on your
1567     Gentoo Linux system. Portage will use these settings when compiling any
1568     programs for you. To do this, edit the file <path>/etc/make.conf</path>. In
1569 swift 1.149 this file, you should set your USE flags, which specify optional
1570 drobbins 1.86 functionality that you would like to be built into packages if available;
1571 swift 1.149 generally, the defaults (an <e>empty</e> or unset USE variable) are
1572     fine. More information on USE flags can be found <uri
1573 drobbins 1.86 link="http://www.gentoo.org/doc/en/use-howto.xml">here</uri>. A complete list
1574     of current USE flags can be found <uri
1575 swift 1.149 link="http://www.gentoo.org/dyn/use-index.xml">here</uri>.
1576     </p>
1577    
1578     <p>
1579     If you are starting from a stage1 tarball, You also should set appropriate
1580     CHOST, CFLAGS and CXXFLAGS settings for the kind of system that you are
1581     creating (commented examples can be found further down in the file). If you
1582     are using a stage2 or stage3 tarball, these settings will already be configured
1583     optimally and should not require any modification.
1584     </p>
1585 drobbins 1.86
1586 swift 1.163 <warn>
1587     <b>Advanced users:</b> If you are planning on installing an
1588     ACCEPT_KEYWORDS="~x86" Gentoo system, do not set ACCEPT_KEYWORDS until
1589     the bootstrap phase (stage1) is done.
1590     </warn>
1591    
1592 swift 1.149 <impo>
1593     <b>Advanced users:</b> The CFLAGS and CXXFLAGS settings are used to tell the
1594     C and C++ compiler how to optimize the code that is generated on your system.
1595     It is common for users with Athlon XP processors to specify a
1596     "-march=athlon-xp" setting in their CFLAGS and CXXFLAGS settings so that all
1597     packages built will be optimized for the instruction set and performance
1598     characteristics of their CPU, for example. The <path>/etc/make.conf</path>
1599 swift 1.142 file contains a general guide for the proper settings of CFLAGS and CXXFLAGS.
1600     </impo>
1601    
1602     <!-- needs qa
1603 swift 1.149 <note>
1604     <b>Advanced users:</b>If you are building from a stage1 and don't want
1605 swift 1.142 to manually configure CFLAGS and CXXFLAGS, you can use the <c>genflags</c>
1606     utility, which will try to guess accurate flags for your CPU architecture.
1607     Simply type <c>emerge -O genflags</c> and then execute
1608 swift 1.149 <c>info2flags</c>. <c>info2flags</c> will suggest CHOST, CFLAGS and
1609 swift 1.142 CXXFLAGS settings, which you can then add to
1610 swift 1.149 <path>/etc/make.conf</path>.
1611     </note>
1612 swift 1.142 -->
1613    
1614 swift 1.149 <p>
1615     If necessary, you can also set proxy information here if you are behind a
1616     firewall. Use the following command to edit <path>/etc/make.conf</path>
1617     using <c>nano</c>, a simple visual editor:
1618 drobbins 1.86 </p>
1619 swift 1.149
1620 jhhudso 1.81 <pre caption="Setting make.conf Options">
1621 swift 1.149 # <i>nano -w /etc/make.conf</i>
1622 jhhudso 1.81 </pre>
1623 drobbins 1.108
1624 swift 1.149 <note>
1625     <b>Advanced users:</b> People who need to substantially customize the build
1626     process should take a look at the <path>/etc/make.globals</path> file. This
1627     file comprises gentoo defaults and should never be touched. If the defaults
1628     do not suffice, then new values should be put in <path>/etc/make.conf</path>,
1629     as entries in <path>make.conf</path> <e>override</e> the entries
1630     in <path>make.globals</path>. If you're interested in customizing USE
1631     settings, look in <path>/etc/make.profile/make.defaults</path>.
1632     If you want to turn off any USE settings found here, add an appropriate
1633     <c>USE="-foo"</c> in <path>/etc/make.conf</path> to turn off any <c>foo</c>
1634     USE setting enabled by default in <path>/etc/make.globals</path> or
1635     <path>/etc/make.profile/make.defaults</path>.
1636     </note>
1637    
1638     <warn>
1639     Make sure not to add '<c>static</c>' to your USE variables until after
1640     stage1.
1641     </warn>
1642    
1643     </body>
1644     </section>
1645     </chapter>
1646    
1647     <chapter>
1648     <title>Starting from Stage1</title>
1649     <section>
1650     <body>
1651    
1652     <note>
1653     If you are not starting from a stage1 tarball, skip this section.
1654     </note>
1655 swift 1.140
1656 swift 1.149 <p>
1657     The stage1 tarball is for complete customization and optimization. If you
1658     have picked this tarball, you are most likely looking to have an
1659     uber-optimized and up-to-date system. Have fun! Installing from a stage1
1660     takes a lot of time, but the result is a system that has been optimized
1661     from the ground up for your specific machine and needs.
1662     </p>
1663 avenj 1.146
1664 swift 1.149 <p>
1665     Now, it is time to start the "bootstrap" process. This process takes
1666     about two hours on a 1200MHz AMD Athlon system. During this time, the GNU
1667     C library, compiler suite and other key system programs will be built. Start
1668     the bootstrap as follows:
1669     </p>
1670 avenj 1.146
1671 swift 1.149 <pre caption="Bootstrapping">
1672     # <i>cd /usr/portage</i>
1673     # <i>scripts/bootstrap.sh</i>
1674 avenj 1.146 </pre>
1675 swift 1.142
1676 swift 1.149 <p>
1677     The "bootstrap" process will now begin.
1678     </p>
1679 swift 1.142
1680 swift 1.149 <note>
1681     <c>bootstrap.sh</c> now supports the <c>--fetchonly</c> option. Dial-up
1682     users will find this especially handy. It will download all bootstrap related
1683     files in one go for later compilation. See <c>bootstrap.sh -h</c> for more
1684     information.
1685     </note>
1686 swift 1.142
1687 swift 1.149 <note>
1688     Portage by default uses <path>/var/tmp</path> during package building,
1689     often using several hundred megabytes of temporary storage. If you would
1690     like to change where Portage stores these temporary files, set a new
1691     PORTAGE_TMPDIR <e>before</e> starting the bootstrap process, as follows:
1692     <pre caption="Changing Portage's Storage Path">
1693     # <i>export PORTAGE_TMPDIR="/otherdir/tmp"</i>
1694 swift 1.142 </pre>
1695 swift 1.149 </note>
1696    
1697     <p>
1698     <c>bootstrap.sh</c> will build <c>binutils</c>, <c>gcc</c>, <c>gettext</c>,
1699     and <c>glibc</c>, rebuilding <c>gettext</c> after <c>glibc</c>. Needless to
1700     say, this process takes a while. Once this process completes, your system
1701     will be equivalent to a "stage2" system, which means you can now move on to
1702     the stage2 instructions.
1703     </p>
1704 swift 1.142
1705     </body>
1706     </section>
1707 swift 1.149 </chapter>
1708    
1709     <chapter>
1710     <title>Starting from Stage2 and continuing Stage1</title>
1711 swift 1.142 <section>
1712     <body>
1713    
1714 swift 1.149 <note>
1715     This section is for those continuing a stage1 install or starting at stage2. If
1716     this is not you (ie. you're using a stage3), then skip this section.
1717     </note>
1718 swift 1.142
1719 swift 1.149 <warn>
1720     If you start from stage2, don't change the CHOST variable in
1721     <path>/etc/make.conf</path>. Doing so results in strange and
1722     broad compilation failures.
1723     </warn>
1724 swift 1.142
1725 swift 1.149 <p>
1726     The stage2 tarball already has the bootstrapping done for you. All that you
1727     have to do is install the rest of the system:
1728     </p>
1729 swift 1.142
1730 swift 1.149 <note>
1731     If you are starting from a pre-built stage2 and want to ensure
1732     that your compiler toolchain is fully up-to-date, add the <c>-u</c>
1733     option to the commands below. If you don't know what this means, it's
1734     safe to skip this suggestion.
1735     </note>
1736 swift 1.142
1737 swift 1.149 <pre caption="Installing the rest of the system">
1738     # <i>emerge -p system</i>
1739     <comment>(lists the packages to be installed)</comment>
1740     # <i>emerge system</i>
1741     </pre>
1742 swift 1.142
1743 swift 1.149 <p>
1744     It is going to take a while to finish building the entire base system.
1745     Your reward is that it will be thoroughly optimized for your system.
1746     The drawback is that you have to find a way to keep yourself occupied for
1747     some time to come. The author suggests "Star Wars - Super Bombad Racing"
1748     for the PS2.
1749     </p>
1750 swift 1.142
1751 swift 1.149 <p>
1752     Building is now complete. Go ahead and skip down to the "Setting
1753     your time zone" section.
1754     </p>
1755 swift 1.142
1756 swift 1.149 </body>
1757     </section>
1758     </chapter>
1759    
1760    
1761     <chapter>
1762     <title>Starting from Stage3</title>
1763     <section>
1764     <body>
1765    
1766     <note>
1767     This section is for those <b>starting</b> with stage3 and not for those who
1768     have started with stage1 or stage2 who should skip this section. GRP users
1769     should skip ahead to the next section.
1770     </note>
1771    
1772     <warn>
1773     Remember, if you start from stage3, don't change the CHOST variable in
1774     <path>/etc/make.conf</path>. Doing so can result in compilation failures.
1775     </warn>
1776    
1777     <p>
1778     The stage3 tarball provides a fully-functional basic Gentoo system,
1779     so no building is required.
1780     </p>
1781    
1782     <note>
1783     <b>Advanced users:</b> However, since the stage3 tarball is pre-built, it
1784     may be slightly out-of-date. If this is a concern for you, you can
1785     automatically update your existing stage3 to contain the most up-to-date
1786 swift 1.161 versions of all system packages by making a backup of
1787     <path>/etc/make.conf</path>, then typing <c>export CONFIG_PROTECT="-*"
1788     emerge -u system</c> (this requires a network connection) and replacing
1789     the backup afterwards. Note that this could take a long time if your stage3 is
1790     very old; otherwise, this process will generally be quick and will allow you
1791     to benefit from the very latest Gentoo updates and fixes. In any case, feel
1792     free to skip these steps and proceed to the next section if you like.
1793 swift 1.149 </note>
1794    
1795     </body>
1796     </section>
1797     </chapter>
1798    
1799    
1800     <chapter>
1801     <title>Setting your time zone</title>
1802     <section>
1803     <body>
1804    
1805     <p>
1806     Now you need to set your time zone.
1807     </p>
1808    
1809     <p>
1810     Look for your time zone (or GMT if you are using Greenwich Mean Time)
1811     in <path>/usr/share/zoneinfo</path>. Then, make a symbolic link to
1812     <path>/etc/localtime</path> by typing:
1813     </p>
1814 swift 1.142
1815 swift 1.149 <pre caption="Creating a symbolic link for time zone">
1816     # <i>ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime</i>
1817     </pre>
1818    
1819     </body>
1820     </section>
1821     </chapter>
1822    
1823     <chapter>
1824     <title>Modifying /etc/fstab for your machine</title>
1825     <section>
1826     <body>
1827 swift 1.142
1828 swift 1.149 <impo>
1829     To edit files, remember to use <c>nano -w "filename"</c>.
1830     </impo>
1831    
1832     <p>
1833     Your Gentoo Linux system is almost ready for use. All we need to do now is
1834     configure a few important system files and install the boot loader.
1835     The first file we need to configure is <path>/etc/fstab</path>. Remember
1836     that you should use the <c>notail</c> option for your boot partition if
1837     you chose to create a ReiserFS filesystem on it. Remember to specify
1838     <c>ext2</c>, <c>ext3</c> or <c>reiserfs</c> filesystem types as appropriate.
1839     </p>
1840    
1841 bennyc 1.162 <warn>
1842 swift 1.149 Use something like the <path>/etc/fstab</path> listed below, but of course be
1843 swift 1.163 sure to replace "BOOT", "ROOT" and "SWAP" with the actual block devices (such
1844     as <c>hda1</c>, etc.) and "ext2" and "ext3" with the actual filesystems you
1845     are using:
1846 bennyc 1.162 </warn>
1847 swift 1.149
1848     <pre caption="Editing fstab">
1849     <comment># /etc/fstab: static file system information.
1850 swift 1.142 #
1851 swift 1.149 # noatime turns off atimes for increased performance (atimes normally aren't
1852     # needed; notail increases performance of ReiserFS (at the expense of storage
1853     # efficiency). It is safe to drop the noatime options if you want and to
1854     # switch between notail and tail freely.
1855    
1856     # &lt;fs&gt; &lt;mount point&gt; &lt;type&gt; &lt;opts&gt; &lt;dump/pass&gt;
1857    
1858     # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
1859     </comment>
1860     /dev/BOOT /boot ext2 noauto,noatime 1 2
1861     /dev/ROOT / ext3 noatime 0 1
1862     /dev/SWAP none swap sw 0 0
1863     /dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
1864     proc /proc proc defaults 0 0
1865     </pre>
1866    
1867     <warn>
1868     Please notice that <path>/boot</path> is <e>not</e> mounted at boot time. This
1869     is to protect the data in <path>/boot</path> from corruption. If you need to
1870     access <path>/boot</path>, please mount it!
1871     </warn>
1872    
1873     </body>
1874     </section>
1875     </chapter>
1876    
1877    
1878     <chapter>
1879     <title>Installing the kernel and system logger</title>
1880     <section>
1881     <title>Kernel selections</title>
1882     <body>
1883    
1884     <p>
1885     There are two options for installing a kernel. You can either configure your
1886     own kernel or use the <c>genkernel</c> utility to configure and compile your
1887     kernel automatically.
1888     </p>
1889    
1890     <p>
1891     Whether configuring a kernel by hand or using <c>genkernel</c>,
1892     you'll need to merge the Linux kernel sources you'd like to use.
1893     Gentoo provides several kernel ebuilds; a list can be found
1894     <uri link="/doc/en/gentoo-kernel.xml">here</uri>. If you are uncertain
1895     which kernel sources to choose, we advise using <c>gentoo-sources</c>.
1896     If you want XFS support, you should choose <c>xfs-sources</c> or
1897     <c>gs-sources</c>. Gentoo's LiveCD uses <c>gs-sources</c> and
1898     <c>xfs-sources</c>. There is also a <c>gaming-sources</c> kernel optimized
1899     for game-playing responsiveness that works wonderfully for this purpose when
1900     the "Preemptible kernel" option is enabled.
1901     </p>
1902    
1903     <p>
1904     Choose a kernel and then merge as follows:
1905     </p>
1906    
1907     <pre caption="Emerging Kernel Sources">
1908     # <i>emerge -k sys-kernel/gentoo-sources</i>
1909     </pre>
1910    
1911     <p>
1912     The <path>/usr/src/linux</path> symbolic link will point to your
1913     newly-installed kernel source tree. Portage uses the
1914     <path>/usr/src/linux</path> symbolic link for a special purpose. Any ebuilds
1915     you install that contain kernel modules will be configured to work with the
1916     kernel source tree pointed to by <path>/usr/src/linux</path>.
1917     <path>/usr/src/linux</path> is created when you emerge your first kernel
1918     source package, but after it exists, Portage does not modify this symbolic
1919     link.
1920     </p>
1921    
1922     </body>
1923     </section>
1924     <section>
1925     <title>Using genkernel to compile your kernel</title>
1926     <body>
1927    
1928     <p>
1929     Now that your kernel source tree is installed, it's now time to compile your
1930     kernel. There are two ways to do this. The first way is to use our new
1931     <c>genkernel</c> script to automatically build a kernel for you.
1932     <c>genkernel</c> works by configuring a kernel nearly identically to the way
1933     our LiveCD kernel is configured. This means that when you use <c>genkernel</c>
1934     to build your kernel, your system will generally detect all your hardware at
1935     boot-time, just like our Live CD does. Because genkernel doesn't require any
1936     manual kernel configuration, it is an ideal solution for those users who may
1937     not be comfortable compiling their own kernels.
1938     </p>
1939    
1940     <p>
1941     Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
1942     </p>
1943    
1944     <pre caption="Emerging genkernel">
1945     # <i>emerge -k genkernel</i>
1946 jhhudso 1.81 </pre>
1947 swift 1.149
1948     <p>
1949     Now, compile your kernel sources by running <c>genkernel</c>:
1950     </p>
1951    
1952     <note>
1953     <b>Advanced users:</b> you can type <c>genkernel --config</c> instead,
1954     which will cause genkernel to allow you to tweak the default kernel
1955     configuration before building begins.
1956     </note>
1957 swift 1.142
1958 swift 1.149 <pre caption="Running genkernel">
1959     <comment>If you're using genkernel 1.2 (included in the 1.4-20030803 x86/i686 GRP set), use the following:</comment>
1960     # <i>genkernel gentoo-sources</i>
1961     <comment>If you're using genkernel 1.4 or newer, there's no need to specify a kernel:</comment>
1962     # <i>genkernel</i>
1963     Gentoo Linux genkernel, version 1.4
1964     Copyright 2003 Gentoo Technologies, Inc., Bob Johnson, Daniel Robbins
1965     Distributed under the GNU General Public License version 2
1966    
1967     Settings:
1968     compile optimization: 1 processor(s)
1969     source tree: /usr/src/linux-2.4.20-gaming-r3
1970     config: gentoo (customized)
1971     config loc: /etc/kernels/config-2.4.20-gaming-r3
1972     initrd config: (default) /etc/kernels/settings
1973    
1974     * Running "make oldconfig"... [ ok ]
1975     * Logging to /var/log/genkernel.log... [ ok ]
1976     * Starting 2.4.20-gaming-r3 build... [ ok ]
1977     * Running "make dep"... [ ok ]
1978     * Running "make bzImage"... [ ok ]
1979     * Running "make modules"... [ ok ]
1980     * Running "make modules_install"... [ ok ]
1981     * Moving bzImage to /boot/kernel-2.4.20-gaming-r3... [ ok ]
1982     * Building busybox... [ ok ]
1983     * Creating initrd... [ ok ]
1984    
1985     * Build completed successfully!
1986    
1987     * Please specify /boot/kernel-2.4.20-gaming-r3 and /boot/initrd-2.4.20-gaming-r3
1988     * when customizing your boot loader configuration files.
1989     </pre>
1990    
1991     <p>
1992     Once <c>genkernel</c> completes, a kernel, full set of modules and
1993     <e>initial root disk</e> (initrd) will be created. We will use the kernel
1994 swift 1.161 and initrd when configuring a boot loader later in this document. Write
1995     down the names of the kernel and initrd as you will need it when writing
1996     the bootloader configuration file. The initrd will be started immediately after
1997     booting to perform hardware autodetection (just like on the Live CD) before
1998     your "real" system starts up.
1999 swift 1.149 </p>
2000    
2001     <p>
2002     Now, let's perform one more step to get our system to be more like the Live
2003     CD -- let's emerge <c>hotplug</c>. While the initrd autodetects hardware that
2004     is needed to boot your system, <c>hotplug</c> autodetects everything else.
2005     To emerge and enable <c>hotplug</c>, type the following:
2006     </p>
2007 swift 1.142
2008     <pre caption="Emerging and enabling hotplug">
2009 swift 1.149 # <i>emerge -k hotplug</i>
2010     # <i>rc-update add hotplug default</i>
2011 swift 1.142 </pre>
2012    
2013 swift 1.149 <p>
2014     Now that you've run and configured your system to use <c>genkernel</c>, you
2015     can skip the "manual kernel configuration" section below.
2016     </p>
2017    
2018 swift 1.142 </body>
2019     </section>
2020     <section>
2021     <title>Manual kernel configuration</title>
2022     <body>
2023    
2024 swift 1.149 <p>
2025     If you opted not to use genkernel to compile your kernel, this section
2026 swift 1.142 will guide you through the process of configuring and compiling a kernel by
2027     hand. Please note that <path>/usr/src/linux</path> is a symlink to your
2028 swift 1.149 current emerged kernel source package and is set automatically by Portage at
2029 swift 1.142 emerge time. If you have multiple kernel source packages, it is necessary to
2030     set the <path>/usr/src/linux</path> symlink to the correct one before
2031 swift 1.149 proceeding.
2032     </p>
2033 swift 1.142
2034     <warn>
2035 swift 1.149 If you are configuring your own kernel, be careful with the <i>grsecurity</i>
2036     option. Being too aggressive with your security settings can cause certain
2037     programs (such as X) to not run properly. If in doubt, leave it out.
2038 swift 1.142 </warn>
2039    
2040     <note>
2041 swift 1.149 If you want to use the same configuration as the LiveCD kernel or base
2042     your configuration on it, you should execute <c>cd /usr/src/linux &amp;&amp; cat /proc/config > .config &amp;&amp; make oldconfig</c>.
2043     If you aren't using <c>xfs-sources</c>, this will ask some questions
2044     about differences between your kernelchoice and <c>xfs-sources</c>.
2045     </note>
2046    
2047 swift 1.121 <pre caption="Configuring the Linux Kernel">
2048 swift 1.149 # <i>cd /usr/src/linux</i>
2049     # <i>make menuconfig</i>
2050 jhhudso 1.81 </pre>
2051 swift 1.149
2052     <warn>
2053     For your kernel to function properly, there are several options that you will
2054     need to ensure are in the kernel proper -- that is, they should <e>be enabled
2055     and not compiled as modules</e>. Be sure to enable &quot;ReiserFS&quot; if you
2056     have any ReiserFS partitions; the same goes for &quot;Ext3&quot;. If you're
2057     using XFS, enable the &quot;SGI XFS filesystem support&quot; option. It's
2058     always a good idea to leave ext2 enabled whether you are using it or not.
2059     </warn>
2060    
2061     <p>
2062     Below are some common options that you will need:
2063     </p>
2064    
2065 jhhudso 1.81 <pre caption="make menuconfig options">
2066     Code maturity level options ---&gt;
2067 swift 1.149 [*] Prompt for development and/or incomplete code/drivers&quot;
2068     <comment>(You need this to enable some of the options below)</comment>
2069     ...
2070 jhhudso 1.81
2071     File systems ---&gt;
2072 swift 1.149 &lt;*&gt; Reiserfs support
2073     <comment>(Only needed if you are using reiserfs)</comment>
2074     ...
2075     &lt;*&gt; Ext3 journalling file system support
2076     <comment>(Only needed if you are using ext3)</comment>
2077     ...
2078     [*] Virtual memory file system support (former shm fs)
2079     <comment>(Required for Gentoo Linux)</comment>
2080     ...
2081     &lt;*&gt; JFS filesystem support
2082     <comment>(Only needed if you are using JFS)</comment>
2083     ...
2084     [*] /proc file system support
2085     <comment>(Required for Gentoo Linux)</comment>
2086     [*] /dev file system support (EXPERIMENTAL)
2087     [*] Automatically mount at boot
2088     <comment>(Required for Gentoo Linux)</comment>
2089     [ ] /dev/pts file system for Unix98 PTYs
2090 swift 1.163 <comment>(Uncheck this, it is not needed unless you use a 2.6 kernel)</comment>
2091 swift 1.149 ...
2092     &lt;*&gt; Second extended fs support
2093     <comment>(Only needed if you are using ext2)</comment>
2094     ...
2095     &lt;*&gt; XFS filesystem support
2096     <comment>(Only needed if you are using XFS)</comment>
2097     </pre>
2098    
2099     <p>
2100     If you use PPPoE to connect to Internet, you will need the following
2101     options in the kernel (built-in or as preferably as modules) : &quot;PPP
2102     (point-to-point protocol) support&quot;, &quot;PPP support for async serial
2103     ports&quot;, &quot;PPP support for sync tty ports&quot;. The two compression
2104     options won't harm but are not definitely needed, neither does the &quot;PPP
2105     over Ethernet&quot; option, that might only be used by <c>rp-pppoe</c> when
2106     configured to do kernel mode PPPoE.
2107     </p>
2108    
2109     <p>
2110     If you have an IDE cd burner, then you need to enable SCSI emulation in the
2111     kernel. Turn on &quot;ATA/IDE/MFM/RLL support&quot; ---&gt; &quot;IDE, ATA
2112     and ATAPI Block devices&quot; ---&gt; &quot;SCSI emulation support&quot;
2113     (I usually make it a module), then under &quot;SCSI support&quot; enable
2114     &quot;SCSI support&quot;, &quot;SCSI CD-ROM support&quot; and &quot;SCSI
2115     generic support&quot; (again, I usually compile them as modules). If you
2116     also choose to use modules, then <c>echo -e &quot;ide-scsi\nsg\nsr_mod&quot;
2117 swift 1.157 &gt;&gt; /etc/modules.autoload.d/kernel-2.4</c> to have them automatically
2118     added at boot time.
2119 swift 1.149 </p>
2120    
2121     <p>
2122     If you require it, don't forget to include support in the kernel for your
2123     ethernet card.
2124     </p>
2125    
2126     <note>
2127     For those who prefer it, it is possible to install Gentoo Linux with a 2.2
2128     kernel. However, doing this comes at a price: you will lose many of the nifty
2129     features that are new to the 2.4 series kernels (such as XFS and tmpfs
2130     filesystems, iptables and more), although the 2.2 kernel sources can be
2131     patched with ReiserFS and devfs support.
2132     Gentoo linux boot scripts require either tmpfs or ramdisk support in the
2133     kernel, so 2.2 kernel users need to make sure that ramdisk support is compiled
2134     in (ie, not a module). It is <comment>vital</comment> that a
2135     <e>gentoo=notmpfs</e> flag be added to the kernel line in
2136     <path>/boot/grub/grub.conf</path> or to the append line in
2137     <path>/etc/lilo.conf</path> for the 2.2 kernel so that a ramdisk is mounted
2138     for the boot scripts instead of tmpfs. If you choose not to use devfs, then
2139     <e>gentoo=notmpfs,nodevfs</e> should be used instead.
2140     </note>
2141 swift 1.121
2142     <pre caption = "Compiling and Installing the kernel">
2143 swift 1.149 # <i>make dep &amp;&amp; make clean bzImage modules modules_install</i>
2144     # <i>cp /usr/src/linux/arch/i386/boot/bzImage /boot</i>
2145 swift 1.121 </pre>
2146 swift 1.158
2147     </body>
2148     </section>
2149     <section>
2150     <title>Installing additional hardware-specific ebuilds</title>
2151     <body>
2152    
2153     <p>
2154     Finally, you should emerge ebuilds for any additional hardware that is on
2155     your system. Here is a list of kernel-related ebuilds that you could emerge:
2156     </p>
2157    
2158     <table>
2159 swift 1.167 <tcolumn width="1in"/>
2160     <tcolumn width="4in"/>
2161     <tcolumn width="2in"/>
2162 swift 1.158 <tr>
2163     <th>Ebuild</th>
2164     <th>Purpose</th>
2165     <th>Command</th>
2166     </tr>
2167     <tr>
2168     <ti>nvidia-kernel</ti>
2169     <ti>Accelerated NVIDIA graphics for XFree86</ti>
2170     <ti><c>emerge -k nvidia-kernel</c></ti>
2171     </tr>
2172     <tr>
2173     <ti>nforce-net</ti>
2174     <ti>On-board ethernet controller on NVIDIA NForce(2) motherboards</ti>
2175     <ti><c>emerge nforce-net</c></ti>
2176     </tr>
2177     <tr>
2178     <ti>nforce-audio</ti>
2179     <ti>On-board audio on NVIDIA NForce(2) motherboards</ti>
2180     <ti><c>emerge nforce-audio</c></ti>
2181     </tr>
2182     <tr>
2183     <ti>e100</ti>
2184     <ti>Intel e100 Fast Ethernet Adapters</ti>
2185     <ti><c>emerge e100</c></ti>
2186     </tr>
2187     <tr>
2188     <ti>e1000</ti>
2189     <ti>Intel e1000 Gigabit Ethernet Adapters</ti>
2190     <ti><c>emerge e1000</c></ti>
2191     </tr>
2192     <tr>
2193     <ti>emu10k1</ti>
2194     <ti>Creative Sound Blaster Live!/Audigy support</ti>
2195     <ti><c>emerge emu10k1</c></ti>
2196     </tr>
2197     <tr>
2198     <ti>ati-drivers</ti>
2199     <ti>Accelerated ATI Radeon 8500+/FireGL graphics for XFree86</ti>
2200     <ti><c>emerge ati-drivers</c></ti>
2201     </tr>
2202     <tr>
2203     <ti>xfree-drm</ti>
2204     <ti>Accelerated graphics for ATI Radeon up to 9200, Rage128, Matrox, Voodoo and other cards for XFree86</ti>
2205     <ti><c>VIDEO_CARDS="yourcard" emerge xfree-drm</c></ti>
2206     </tr>
2207     </table>
2208    
2209     <p>
2210     The <c>nvidia-kernel</c>, <c>ati-drivers</c> and <c>xfree-drm</c> packages
2211     will require additional configuration to be enabled. All other ebuilds listed
2212     above should be auto-detected at boot-time by the <c>hotplug</c> package. If
2213     you are not using hotplug, be sure to add the appropriate modules to
2214     <path>/etc/modules.autoload.d/kernel-2.4</path>.
2215     </p>
2216    
2217     <p>
2218     More information on <c>xfree-drm</c> can be found in our <uri
2219     link="/doc/en/dri-howto.xml">Direct Rendering Guide</uri>.
2220     </p>
2221    
2222 swift 1.149
2223 swift 1.142 </body>
2224     </section>
2225     <section>
2226     <title>Installing a system logger</title>
2227     <body>
2228 swift 1.149
2229     <p>
2230     Your new custom kernel (and modules) are now installed. Now you need to choose
2231     a system logger that you would like to install. We offer sysklogd, which is
2232     the traditional set of system logging daemons. We also have msyslog and
2233 swift 1.173 syslog-ng as well as metalog. If in doubt, you may want to try
2234     syslog-ng, since it is very flexible and feature-rich. To merge your logger of
2235     choice, type <e>one</e> of the next four command sets:
2236 swift 1.149 </p>
2237    
2238 jhhudso 1.81 <pre caption="Emerging System Logger of Choice">
2239 swift 1.149 # <i>emerge -k app-admin/sysklogd</i>
2240     # <i>rc-update add sysklogd default</i>
2241 drobbins 1.1 <comment>or</comment>
2242 swift 1.149 # <i>emerge -k app-admin/syslog-ng</i>
2243     # <i>rc-update add syslog-ng default</i>
2244 drobbins 1.1 <comment>or</comment>
2245 swift 1.149 # <i>emerge -k app-admin/metalog</i>
2246     # <i>rc-update add metalog default</i>
2247 drobbins 1.1 <comment>or</comment>
2248 swift 1.149 # <i>emerge -k app-admin/msyslog</i>
2249     # <i>rc-update add msyslog default</i>
2250 jhhudso 1.81 </pre>
2251 swift 1.149
2252     <impo>
2253 swift 1.173 If you chose <c>metalogd</c>, please read <uri link="faq.xml#doc_chap6_sect3">this FAQ</uri> on metalogd's buffering.
2254 swift 1.149 </impo>
2255    
2256     <p>
2257     Now, you may optionally choose a cron package that you would like to use.
2258     Right now, we offer dcron, fcron and vcron. If you do not know which one to
2259     choose, you might as well grab vcron.
2260     </p>
2261    
2262 jhhudso 1.81 <pre caption="Choosing a CRON Daemon">
2263 swift 1.149 # <i>emerge -k sys-apps/dcron</i>
2264     # <i>rc-update add dcron default</i>
2265     # <i>crontab /etc/crontab</i>
2266 drobbins 1.1 <comment>or</comment>
2267 swift 1.149 # <i>emerge -k sys-apps/fcron</i>
2268     # <i>rc-update add fcron default</i>
2269     # <i>crontab /etc/crontab</i>
2270 drobbins 1.1 <comment>or</comment>
2271 swift 1.149 # <i>emerge -k sys-apps/vcron</i>
2272     # <i>rc-update add vcron default</i>
2273     <comment>You do not need to run <i>crontab /etc/crontab</i> if using vcron.</comment>
2274     </pre>
2275    
2276     <p>
2277     For more information on starting programs and daemons at startup, see the
2278     <uri link="/doc/en/rc-scripts.xml">rc-script guide</uri>.
2279     </p>
2280    
2281     </body>
2282     </section>
2283     </chapter>
2284    
2285     <chapter>
2286     <title>Installing miscellaneous necessary packages</title>
2287     <section>
2288     <body>
2289    
2290     <p>
2291     If you need rp-pppoe to connect to the net, be aware that at this point
2292     it has not been installed. It would be the good time to do it:
2293     </p>
2294    
2295 jhhudso 1.81 <pre caption="Installing rp-pppoe">
2296 swift 1.149 # <i>USE="-X" emerge rp-pppoe</i>
2297 swift 1.142 <comment>GRP users should type the following:</comment>
2298 swift 1.167 # <i>emerge -K rp-pppoe</i>
2299 jhhudso 1.81 </pre>
2300 zhen 1.40
2301 swift 1.149 <note>
2302     The <i>USE="-X"</i> prevents pppoe from installing its optional X interface,
2303     which is a good thing, because X and its dependencies would also be emerged.
2304 swift 1.167 You can always recompile <i>rp-pppoe</i> with X support later. The GRP version
2305     of rp-pppoe has the optional X interface enabled. If you're not using GRP, compile from
2306     source as in the first example.
2307 swift 1.149 </note>
2308 swift 1.167 <!-- this pkg is a candidate for moving from .tbz2 to distfiles/ (source) -->
2309    
2310 swift 1.149
2311     <note>
2312     Please note that the rp-pppoe is built but not configured. You will have to
2313     do it again using <c>adsl-setup</c> when you boot into your Gentoo system
2314     for the first time.
2315     </note>
2316    
2317     <p>
2318     You may need to install some additional packages in the Portage tree
2319     if you are using any optional features like XFS, ReiserFS or LVM. If you're
2320     using XFS, you should emerge the <c>xfsprogs</c> package:
2321     </p>
2322    
2323 jhhudso 1.81 <pre caption="Emerging Filesystem Tools">
2324 erwin 1.171 # <i>emerge -k xfsprogs</i>
2325 jhhudso 1.75 <comment>If you would like to use ReiserFS, you should emerge the ReiserFS tools: </comment>
2326 erwin 1.171 # <i>emerge -k reiserfsprogs</i>
2327 jhhudso 1.75 <comment>If you would like to use JFS, you should emerge the JFS tools: </comment>
2328 swift 1.149 # <i>emerge -k jfsutils</i>
2329 drobbins 1.1 <comment>If you're using LVM, you should emerge the <c>lvm-user</c> package: </comment>
2330 erwin 1.171 # <i>emerge -k lvm-user</i>
2331 jhhudso 1.81 </pre>
2332 swift 1.149
2333     <p>
2334     If you're a laptop user and wish to use your PCMCIA slots on your first
2335     real reboot, you will want to make sure you install the <i>pcmcia-cs</i>
2336     package.
2337     </p>
2338    
2339 jhhudso 1.81 <pre caption="Emerging PCMCIA-cs">
2340 swift 1.149 # <i>emerge -k sys-apps/pcmcia-cs</i>
2341 jhhudso 1.81 </pre>
2342 swift 1.149
2343     <!-- fix the bug or fix the docs, don't send the user in circles
2344 swift 1.142 (drobbins)
2345     <warn>You will have to re-emerge <i>pcmcia-cs</i> after installation to get PCMCIA
2346 zhen 1.10 to work.
2347     </warn>
2348 swift 1.149 -->
2349    
2350     </body>
2351     </section>
2352     </chapter>
2353    
2354     <chapter>
2355     <title>User Management</title>
2356     <section>
2357     <title>Setting a root password</title>
2358     <body>
2359    
2360     <p>
2361     Before you forget, set the root password by typing:
2362     </p>
2363    
2364 jhhudso 1.81 <pre caption="Setting the root Password">
2365 swift 1.149 # <i>passwd</i>
2366 jhhudso 1.81 </pre>
2367 swift 1.149
2368     </body>
2369     </section>
2370     <section>
2371     <title>Adding a user for day-to-day use</title>
2372     <body>
2373    
2374     <p>
2375     Working as root on a Unix/Linux system is <e>dangerous</e> and
2376     should be avoided as much as possible. Therefor it is <e>strongly</e>
2377     recommended to add a user for day-to-day use:
2378     </p>
2379    
2380     <pre caption = "Adding a user">
2381 swift 1.135 # <i>useradd your_user -m -G users,wheel,audio -s /bin/bash</i>
2382 swift 1.149 # <i>passwd your_user</i>
2383     </pre>
2384    
2385     <p>
2386     Substitute <c>your_user</c> with your username.
2387     </p>
2388    
2389     <p>
2390     Whenever you need to perform some task that only root can handle,
2391     use <c>su -</c> to change your privileges to root-privileges, or take
2392     a look at the <c>sudo</c> package.
2393     </p>
2394    
2395     </body>
2396     </section>
2397     </chapter>
2398    
2399     <chapter>
2400     <title>Setting your Hostname</title>
2401     <section>
2402     <body>
2403    
2404     <p>
2405     Edit <path>/etc/hostname</path> so that it contains your hostname
2406     on a single line, i.e. <c>mymachine</c>.
2407     </p>
2408    
2409 jhhudso 1.81 <pre caption="Configuring Hostname">
2410 swift 1.121 # <i>echo mymachine &gt; /etc/hostname</i>
2411     </pre>
2412 swift 1.149
2413     <p>
2414     Then edit <path>/etc/dnsdomainname</path> so that it contains your DNS
2415     domainname, i.e. <c>mydomain.com</c>.
2416     </p>
2417    
2418 swift 1.121 <pre caption="Configuring Domainname">
2419     # <i>echo mydomain.com &gt; /etc/dnsdomainname</i>
2420     </pre>
2421 swift 1.149
2422     <p>
2423     If you have a NIS domain, you should set it in
2424     <path>/etc/nisdomainname</path>.
2425     </p>
2426    
2427 swift 1.121 <pre caption="Configuring NIS Domainname">
2428     # <i>echo nis.mydomain.com &gt; /etc/nisdomainname</i>
2429 jhhudso 1.81 </pre>
2430 swift 1.149
2431     </body>
2432     </section>
2433     </chapter>
2434    
2435    
2436     <chapter>
2437     <title>Modifying /etc/hosts</title>
2438     <section>
2439     <body>
2440    
2441     <p>
2442     This file contains a list of IP addresses and their associated hostnames.
2443     It is used by the system to resolve the IP addresses of any hostnames that
2444     may not be in your nameservers. Here is a template for this file:
2445     </p>
2446    
2447 jhhudso 1.81 <pre caption="Hosts Template">
2448 drobbins 1.1 127.0.0.1 localhost
2449 swift 1.149 <comment># the next line contains your IP for your local LAN and your associated machine name</comment>
2450 drobbins 1.1 192.168.1.1 mymachine.mydomain.com mymachine
2451 jhhudso 1.81 </pre>
2452 swift 1.149
2453     <note>
2454     If you are on a DHCP network, it might be helpful to add your
2455     machine's actual hostname after <i>localhost</i>. This will help
2456     GNOME and many other programs in name resolution.
2457     </note>
2458    
2459     </body>
2460     </section>
2461     </chapter>
2462    
2463    
2464     <chapter>
2465     <title>Final Network Configuration</title>
2466     <section>
2467 swift 1.174 <title>Loading the Kernel Modules</title>
2468 swift 1.149 <body>
2469    
2470     <p>
2471     Add the names of any modules that are necessary for the proper functioning of
2472 swift 1.157 your system to <path>/etc/modules.autoload.d/kernel-2.4</path> file (you can
2473     also add any options you need to the same line). When Gentoo Linux boots, these
2474     modules will be automatically loaded. Of particular importance is your
2475     ethernet card module, if you happened to compile it as a module:
2476 swift 1.149 </p>
2477    
2478 swift 1.157 <pre caption="/etc/modules.autoload.d/kernel-2.4">
2479 swift 1.149 <comment>This is assuming that you are using a 3com card.
2480 swift 1.174 Check /lib/modules/&lt;kernel version&gt;/kernel/drivers/net for your card. </comment>
2481 drobbins 1.1 3c59x
2482 jhhudso 1.81 </pre>
2483 swift 1.149
2484 swift 1.174 </body>
2485     </section>
2486     <section>
2487     <title>Configuring the Network Interfaces</title>
2488     <body>
2489    
2490 swift 1.149 <p>
2491     Edit the <path>/etc/conf.d/net</path> script to get your network configured
2492 swift 1.174 for your first boot.
2493 swift 1.149 </p>
2494    
2495 jhhudso 1.81 <pre caption="Boot time Network Configuration">
2496 swift 1.149 # <i>nano -w /etc/conf.d/net</i>
2497 swift 1.174 </pre>
2498    
2499     <p>
2500     If you want eth0 to automatically receive its IP, set <c>iface_eth0</c>
2501     to <e>dhcp</e>. Otherwise fill in your IP, broadcast address and
2502     netmask. If you have several interfaces, do the same for <c>iface_eth1</c>,
2503     <c>iface_eth2</c> etc.
2504     </p>
2505    
2506     <p>
2507     Now add the <c>net.eth0</c> initscript to the default runlevel <e>if</e>
2508     it isn't a PCMCIA network card:
2509     </p>
2510    
2511     <pre caption="Automatically start the network interfaces during boot">
2512 swift 1.149 # <i>rc-update add net.eth0 default</i>
2513 jhhudso 1.81 </pre>
2514 swift 1.149
2515     <p>
2516     If you have multiple network cards or tokenring interfaces, you need to create
2517 swift 1.174 additional <path>net.eth</path><comment>x</comment> or
2518     <path>net.tr</path><comment>x</comment> scripts respectively for each one
2519 swift 1.149 (<comment>x</comment> = 1, 2, ...):
2520     </p>
2521    
2522 jhhudso 1.81 <pre caption="Multiple Network Interfaces">
2523 swift 1.149 # <i>cd /etc/init.d</i>
2524 swift 1.167 # <i>ln -s net.eth0 net.eth<comment>x</comment></i>
2525 swift 1.174 </pre>
2526    
2527     <p>
2528     Now for each created initscript, add it to the default runlevel (again
2529     only if it isn't a PCMCIA network card):
2530     </p>
2531    
2532     <pre caption = "Adding net.ethx to the default runlevel">
2533 swift 1.149 # <i>rc-update add net.eth<comment>x</comment> default</i>
2534     </pre>
2535    
2536 swift 1.174 </body>
2537     </section>
2538     <section>
2539     <title>Only for PCMCIA Users</title>
2540     <body>
2541    
2542 swift 1.149 <p>
2543     If you have a PCMCIA card installed, have a quick look into
2544 swift 1.174 <path>/etc/conf.d/pcmcia</path> to verify that things seem all right for
2545 swift 1.157 your setup, then run the following command:
2546 swift 1.149 </p>
2547    
2548 swift 1.157 <pre caption = "Have PCMCIA services start automatically">
2549     # <i>rc-update add pcmcia boot</i>
2550 jhhudso 1.81 </pre>
2551 swift 1.149
2552     <p>
2553     This makes sure that the PCMCIA drivers are autoloaded whenever your network
2554 swift 1.157 is loaded. The appropriate <path>/etc/init.d/net.eth*</path> services
2555     will be started by the pcmcia service automatically.
2556 swift 1.149 </p>
2557    
2558     </body>
2559     </section>
2560     </chapter>
2561    
2562     <chapter>
2563     <title>Final steps: Configure Basic Settings (including the international keymap setting)</title>
2564     <section>
2565     <body>
2566    
2567 jhhudso 1.81 <pre caption="Basic Configuration">
2568 swift 1.149 # <i>nano -w /etc/rc.conf</i>
2569 jhhudso 1.81 </pre>
2570 swift 1.149
2571     <p>
2572     Follow the directions in the file to configure the basic settings. All users
2573     will want to make sure that CLOCK is set to his/her liking. International
2574     keyboard users will want to set the KEYMAP variable (browse
2575     <path>/usr/share/keymaps</path> to see the various possibilities).
2576     </p>
2577    
2578     </body>
2579     </section>
2580     </chapter>
2581    
2582     <chapter>
2583     <title>Configure a Bootloader</title>
2584     <section>
2585     <title>Notes</title>
2586     <body>
2587    
2588     <p>
2589     In the spirit of Gentoo, users now have more than one bootloader to choose
2590     from. Using our virtual package system, users are now able to choose between
2591     both GRUB and LILO as their bootloaders.
2592     </p>
2593    
2594     <p>
2595     Please keep in mind that having both bootloaders installed is not necessary.
2596     In fact, it can be a hindrance, so please only choose one.
2597     </p>
2598    
2599     <p>
2600     In addition, you will need to configure our bootloader differently depending
2601     upon whether you are using <c>genkernel</c> (with kernel and initrd) or a
2602     kernel you compiled by hand. Be sure to take note of the important
2603     differences.
2604     </p>
2605    
2606     </body>
2607     </section>
2608     <section>
2609     <title>Configuring GRUB</title>
2610     <body>
2611    
2612     <p>
2613     The most critical part of understanding GRUB is getting comfortable with how
2614     GRUB refers to hard drives and partitions. Your Linux partition
2615     <path>/dev/hda1</path> is called <path>(hd0,0)</path> under GRUB. Notice the
2616     parenthesis around the hd0,0 - they are required. Hard drives count from zero
2617     rather than "a" and partitions start at zero rather than one. Be aware too
2618     that with the hd devices, only hard drives are counted, not atapi-ide devices
2619     such as cdrom players, burners and that the same construct can be used with
2620     scsi drives. (Normally they get higher numbers than ide drives except when the
2621     bios is configured to boot from scsi devices.) Assuming you have a hard drive
2622     on <path>/dev/hda</path>, a cdrom player on <path>/dev/hdb</path>, a burner on
2623     <path>/dev/hdc</path>, a second hard drive on <path>/dev/hdd</path> and no
2624     SCSI hard drive, <path>/dev/hdd7</path> gets translated to
2625     <path>(hd1,6)</path>. It might sound tricky and tricky it is indeed, but as
2626     we will see, GRUB offers a tab completion mechanism that comes handy for
2627     those of you having a lot of hard drives and partitions and who are a little
2628     lost in the GRUB numbering scheme. Having gotten the feel for that, it is
2629     time to install GRUB.
2630     </p>
2631    
2632     <p>
2633     The easiest way to install GRUB is to simply type <c>grub</c> at your chrooted
2634     shell prompt:
2635     </p>
2636    
2637 jhhudso 1.81 <pre caption="Installing GRUB">
2638 swift 1.149 # <i>emerge -k grub</i>
2639     # <i>grub</i>
2640 jhhudso 1.81 </pre>
2641 swift 1.149
2642     <p>
2643     You will be presented with the <e>grub&gt;</e> grub command-line prompt.
2644     Now, you need to type in the right commands to install the GRUB boot record
2645     onto your hard drive. In my example configuration, I want to install the GRUB
2646     boot record on my hard drive's MBR (master boot record), so that the first
2647     thing I see when I turn on the computer is the GRUB prompt. In my case, the
2648     commands I want to type are:
2649     </p>
2650 zhen 1.68
2651 jhhudso 1.81 <pre caption="GRUB on the MBR">
2652 swift 1.149 grub&gt; <i>root (hd0,0)</i> <comment>(Your boot partition)</comment>
2653     grub&gt; <i>setup (hd0)</i> <comment>(Where the boot record is installed; here, it is the MBR)</comment>
2654 jhhudso 1.81 </pre>
2655 zhen 1.68
2656 jhhudso 1.81 <pre caption="GRUB not on the MBR">
2657 swift 1.149 <comment>Alternatively, if you wanted to install the bootloader somewhere other than the MBR:</comment>
2658     grub&gt; <i>root (hd0,0)</i> <comment>(Your boot partition)</comment>
2659     grub&gt; <i>setup (hd0,4)</i> <comment>(Where the boot record is installed; here it is /dev/hda5)</comment>
2660     grub&gt; <i>quit</i>
2661     </pre>
2662    
2663     <p>
2664     Here is how the two commands work. The first <c>root ( )</c> command tells
2665     GRUB the location of your boot partition (in our example,
2666     <path>/dev/hda1</path> or <path>(hd0,0)</path> in GRUB terminology. Then, the
2667     second <c>setup ( )</c> command tells GRUB where to install the boot record -
2668     it will be configured to look for its special files at the <c>root ( )</c>
2669     location that you specified. In my case, I want the boot record on the MBR
2670     of the hard drive, so I simply specify <path>/dev/hda</path> (also known as
2671     <path>(hd0)</path>). If I were using another boot loader and wanted to set up
2672     GRUB as a secondary boot-loader, I could install GRUB to the boot record of
2673     a particular partition. In that case, I would specify a particular partition
2674     rather than the entire disk. Once the GRUB boot record has been successfully
2675     installed, you can type <c>quit</c> to quit GRUB.
2676     </p>
2677    
2678     <note>
2679     The tab completion mechanism of GRUB can be used from within GRUB,
2680     assuming you wrote <c> root (</c> and that you hit the TAB key, you would
2681     be prompted with a list of the available devices (not only hard drives),
2682     hitting the TAB key having written <c> root (hd</c>, GRUB would print the
2683     available hard drives and hitting the TAB key after writing <c> root (hd0,</c>
2684     would make GRUB print the list of partitions on the first hard drive.
2685     Checking the syntax of the GRUB location with completion should really help
2686     to make the right choice.
2687     </note>
2688 zhen 1.6
2689 swift 1.149 <p>
2690     Gentoo Linux is now installed, but we need to create the
2691     <path>/boot/grub/grub.conf</path> file so that we get a nice GRUB boot menu
2692     when the system reboots. Here is how to do it.
2693     </p>
2694    
2695     <impo>
2696     To ensure backwards compatibility with GRUB, make sure to make a link from
2697     <path>grub.conf</path> to <path>menu.lst</path>. You can do this by typing
2698     <c>ln -s /boot/grub/grub.conf /boot/grub/menu.lst</c>.
2699     </impo>
2700    
2701     <p>
2702     Now, create the <path>grub.conf</path> file (<c>nano -w
2703     /boot/grub/grub.conf</c>) and add the following to it:
2704     </p>
2705    
2706 swift 1.142 <pre caption="grub.conf for GRUB">
2707 drobbins 1.1 default 0
2708     timeout 30
2709     splashimage=(hd0,0)/boot/grub/splash.xpm.gz
2710    
2711 swift 1.149 <comment># If you compiled your own kernel, use something like this:</comment>
2712 drobbins 1.1 title=My example Gentoo Linux
2713     root (hd0,0)
2714 zhen 1.51 kernel (hd0,0)/boot/bzImage root=/dev/hda3
2715 drobbins 1.1
2716 swift 1.149 <comment># If you're using genkernel, use something like this instead:</comment>
2717 swift 1.142 title=My example Gentoo Linux (genkernel)
2718     root (hd0,0)
2719     kernel (hd0,0)/boot/kernel-KV root=/dev/hda3
2720     initrd (hd0,0)/boot/initrd-KV
2721    
2722 drobbins 1.1 <comment># Below needed only for people who dual-boot</comment>
2723 jhhudso 1.81 title=Windows XP
2724 drobbins 1.1 root (hd0,5)
2725 zhen 1.67 chainloader (hd0,5)+1
2726 jhhudso 1.81 </pre>
2727 swift 1.149
2728 bennyc 1.162 <warn>
2729 swift 1.152 Substitute <c>KV</c> with the kernel version you have installed.
2730 bennyc 1.162 </warn>
2731 swift 1.152
2732 swift 1.149 <note>
2733     (hd0,0) should be written without any spaces inside the parentheses.
2734     </note>
2735    
2736     <impo>
2737     If you set up SCSI emulation for an IDE cd burner earlier, then to get it to
2738     actually work you need to add an <c>hdx=ide-scsi</c> fragment to the kernel
2739     line in <path>grub.conf</path> (where "hdx" should be the device for your cd
2740     burner).
2741     </impo>
2742    
2743     <p>
2744     After saving this file, Gentoo Linux installation is complete. Selecting the
2745     first option will tell GRUB to boot Gentoo Linux without a fuss. The second
2746     part of the <path>grub.conf</path> file is optional and shows you how to use
2747     GRUB to boot a bootable Windows partition.
2748     </p>
2749    
2750     <note>
2751     Above, <path>(hd0,0)</path> should point to your "boot" partition
2752     (<path>/dev/hda1</path> in our example config) and <path>/dev/hda3</path>
2753     should point to your root filesystem. <path>(hd0,5)</path> contains the NT
2754     boot loader.
2755     </note>
2756    
2757     <note>
2758     The path to the kernel image is relative to the boot partition. If for
2759     example you have separated boot partition <path>(hd0,0)</path> and root
2760     partition <path>(hd0,1)</path>, all paths in the <path>grub.conf</path> file
2761     above will become <path>/bzImage</path>.
2762     </note>
2763    
2764     <p>
2765     If you need to pass any additional options to the kernel, simply add them to
2766     the end of the <c>kernel</c> command. We're already passing one option
2767     (<c>root=/dev/hda3</c>), but you can pass others as well. In particular, you
2768     can turn off devfs by default (not recommended unless you know what you're
2769     doing) by adding the <c>gentoo=nodevfs</c> option to the <c>kernel</c>
2770     command.
2771     </p>
2772    
2773     <note>
2774     Unlike in earlier versions of Gentoo Linux, you no longer have to add
2775     <c>devfs=mount</c> to the end of the <c>kernel</c> line to enable devfs.
2776     Now devfs is enabled by default.
2777     </note>
2778    
2779     </body>
2780     </section>
2781     <section>
2782     <title>Configuring LILO</title>
2783     <body>
2784    
2785     <p>
2786     While GRUB may be the new alternative for most people, it is not always the
2787     best choice. LILO, the LInuxLOader, is the tried and true workhorse of Linux
2788     bootloaders. Here is how to install LILO if you would like to use it instead
2789     of GRUB.
2790     </p>
2791    
2792     <p>
2793     The first step is to emerge LILO:
2794     </p>
2795    
2796 jhhudso 1.81 <pre caption="Emerging LILO">
2797 swift 1.149 # <i>emerge -k lilo</i>
2798 jhhudso 1.81 </pre>
2799 swift 1.149
2800     <p>
2801     Now it is time to configure LILO. Here is a sample configuration file
2802     <path>/etc/lilo.conf</path>:
2803     </p>
2804    
2805 jhhudso 1.81 <pre caption="Example lilo.conf">
2806 zhen 1.16 boot=/dev/hda
2807     map=/boot/map
2808     install=/boot/boot.b
2809     prompt
2810     timeout=50
2811     lba32
2812     default=linux
2813    
2814 swift 1.149 <comment># Use something like the following 4 lines if you compiled your kernel yourself</comment>
2815 swift 1.111 image=/boot/bzImage
2816 zhen 1.16 label=linux
2817     read-only
2818 zhen 1.82 root=/dev/hda3
2819 swift 1.142
2820 swift 1.149 <comment># If you used genkernel, use something like this:</comment>
2821 swift 1.142 image=/boot/kernel-KV
2822     label=gk_linux
2823     root=/dev/hda3
2824     initrd=/boot/initrd-KV
2825 swift 1.166 append="root=/dev/hda3 init=/linuxrc"
2826 swift 1.142
2827 zhen 1.16
2828 swift 1.149 <comment># For dual booting windows/other OS</comment>
2829 zhen 1.16 other=/dev/hda1
2830     label=dos
2831 jhhudso 1.81 </pre>
2832 swift 1.149
2833 bennyc 1.162 <warn>
2834 swift 1.155 Substitute <c>KV</c> with the kernel version you have installed, and
2835     make sure that <c>default=</c> points to your label (<c>gk_linux</c> if
2836     you used genkernel).
2837 bennyc 1.162 </warn>
2838 swift 1.152
2839 swift 1.149 <ul>
2840     <li><c>boot=/dev/hda</c> tells LILO to install itself on the first hard disk on the first IDE controller.</li>
2841     <li><c>map=/boot/map</c> states the map file. In normal use, this should not be modified. </li>
2842     <li><c>install=/boot/boot.b</c> tells LILO to install the specified file as the new boot sector. In normal use, this should not be altered. If the install line is missing, LILO will assume a default of <path>/boot/boot.b</path> as the file to be used. </li>
2843     <li>The existence of <c>prompt</c> tells LILO to display the classic <e>lilo:</e> prompt at bootup. While it is not recommended that you remove the prompt line, if you do remove it, you can still get a prompt by holding down the [Shift] key while your machine starts to boot. </li>
2844     <li><c>timeout=50</c> sets the amount of time that LILO will wait for user input before proceeding with booting the default line entry. This is measured in tenths of a second, with 50 as the default. </li>
2845     <li><c>lba32</c> describes the hard disk geometry to LILO. Another common entry here is linear. You should not change this line unless you are very aware of what you are doing. Otherwise, you could put your system in an unbootable state. </li>
2846     <li><c>default=linux</c> refers to the default operating system for LILO to boot from the options listed below this line. The name linux refers to the label line below in each of the boot options. </li>
2847     <li><c>image=/boot/bzImage</c> specifies the linux kernel to boot with this particular boot option. </li>
2848     <li><c>label=linux</c> names the operating system option in the LILO screen. In this case, it is also the name referred to by the default line. </li>
2849     <li><c>read-only</c> specifies that the root partition (see the root line below) is read-only and cannot be altered during the boot process. </li>
2850     <li><c>root=/dev/hda3</c> tells LILO what disk partition to use as the root partition. </li>
2851     </ul>
2852    
2853     <p>
2854     After you have edited your <path>lilo.conf</path> file, it is time to run LILO
2855     to load the information into the MBR:
2856     </p>
2857    
2858 jhhudso 1.81 <pre caption="Running LILO">
2859 swift 1.149 # <i>/sbin/lilo</i>
2860 jhhudso 1.81 </pre>
2861 swift 1.149
2862     <p>
2863     LILO is configured and now your machine is ready to boot into Gentoo Linux!
2864     </p>
2865    
2866     </body>
2867     </section>
2868    
2869     <section>
2870     <title>Using framebuffer</title>
2871     <body>
2872    
2873     <p>
2874     People who have selected framebuffer in their kernel should add <c>vga=xxx</c>
2875     to their bootloader configuration file. <c>xxx</c> is one of the values in the
2876     following table:
2877     </p>
2878    
2879 swift 1.142 <table>
2880 swift 1.167 <tcolumn width="1in"/>
2881     <tcolumn width="1in"/>
2882     <tcolumn width="1in"/>
2883     <tcolumn width="1in"/>
2884 swift 1.142 <tr><ti></ti><th>640x480</th><th>800x600</th><th>1024x768</th><th>1280x1024</th></tr>
2885     <tr><th>8 bpp</th><ti>769</ti><ti>771</ti><ti>773</ti><ti>775</ti></tr>
2886     <tr><th>16 bpp</th><ti>785</ti><ti>788</ti><ti>791</ti><ti>794</ti></tr>
2887     <tr><th>32 bpp</th><ti>786</ti><ti>789</ti><ti>792</ti><ti>795</ti></tr>
2888     </table>
2889 swift 1.149
2890 swift 1.142 <p>
2891     LILO-users will have to add <c>vga=xxx</c> on top of their configuration
2892     file.
2893     </p>
2894 swift 1.149
2895 swift 1.142 <p>
2896     GRUB-users will have to append <c>vga=xxx</c> to the <c>kernel
2897     (hd0,0)...</c> line.
2898     </p>
2899 swift 1.149
2900 swift 1.142 </body>
2901     </section>
2902 swift 1.149 </chapter>
2903    
2904     <chapter>
2905     <title>Creating Bootdisks</title>
2906     <section>
2907     <title>GRUB Bootdisks</title>
2908     <body>
2909    
2910     <impo>
2911     Don't forget to insert a floppy in your floppydrive before proceeding.
2912     </impo>
2913    
2914     <p>
2915     It is always a good idea to make a boot disk the first
2916     time you install any Linux distribution. This is a security
2917     blanket and generally not a bad thing to do. If your hardware doesn't
2918     let you install a working bootloader from the chrooted environment,
2919     you may <e>need</e> to make a GRUB boot disk.
2920     If you are in this camp, make a GRUB boot disk and when you reboot
2921     the first time you can install GRUB to the MBR. Make your bootdisks
2922     like this:
2923     </p>
2924    
2925 jhhudso 1.81 <pre caption="Creating a GRUB Bootdisk">
2926 swift 1.149 # <i>cd /usr/share/grub/i386-pc/</i>
2927     # <i>cat stage1 stage2 > /dev/fd0</i>
2928 jhhudso 1.81 </pre>
2929 swift 1.142
2930 swift 1.149 <p>
2931     Now reboot and load the floppy. At the floppy's <c>grub&gt;</c> prompt, you
2932     can now execute the necessary <c>root</c> and <c>setup</c> commands.
2933     </p>
2934    
2935     </body>
2936     </section>
2937     <section>
2938     <title>LILO Bootdisks</title>
2939     <body>
2940    
2941     <impo>
2942     Don't forget to insert a floppy in your floppydrive before proceeding.
2943     </impo>
2944    
2945     <p>
2946     If you are using LILO, it is also a good idea to make a bootdisk:
2947     </p>
2948    
2949 peesh 1.126 <pre caption="Making a Bootdisk">
2950 swift 1.149 # <i>dd if=/boot/your_kernel of=/dev/fd0 </i>
2951     <comment>(This will only work if your kernel is smaller than 1.4MB)</comment>
2952 jhhudso 1.81 </pre>
2953 swift 1.142
2954 swift 1.149 </body>
2955     </section>
2956     </chapter>
2957    
2958     <chapter>
2959     <title>Using GRP</title>
2960     <section>
2961     <body>
2962    
2963     <p>
2964     GRP users can, at this point, install binary packages:
2965     </p>
2966 swift 1.142
2967     <pre caption="Installing from GRP">
2968 swift 1.167 # <i>emerge -k xfree</i>
2969 swift 1.142 </pre>
2970    
2971 swift 1.149 <p>
2972     CD 1 contains enough applications to install a working system with XFree86.
2973     Additionally, CD2 of the 2-CD GRP set contains other applications including
2974     KDE, GNOME, Mozilla and others. To install these packages, you will need to
2975     reboot into your new Gentoo system first (covered in the "Installation
2976     complete!" section near the end of this document). After you are running your
2977     basic Gentoo system from the hard drive, you can mount the second CD and copy
2978     files:
2979     </p>
2980 swift 1.142
2981 swift 1.149 <pre caption="Loading binary packages from CD2">
2982     # <i>mount /dev/cdrom /mnt/cdrom</i>
2983 swift 1.156 # <i>cp -a /mnt/cdrom/packages/* /usr/portage/packages/</i>
2984 swift 1.142 </pre>
2985    
2986 swift 1.149 <p>
2987     Now various other applications can be installed the same way. For example:
2988     </p>
2989 swift 1.142
2990 swift 1.149 <pre caption="Installing KDE from GRP">
2991 swift 1.167 # <i>emerge -k kde</i>
2992 swift 1.142 </pre>
2993    
2994 swift 1.149 </body>
2995     </section>
2996     </chapter>
2997    
2998     <chapter>
2999     <title>Installation Complete!</title>
3000     <section>
3001     <body>
3002    
3003     <p>
3004     Now, Gentoo Linux is installed. The only remaining step is to update necessary
3005     configuration files, exit the chrooted shell, safely unmount your partitions
3006     and reboot the system:
3007     </p>
3008 jhhudso 1.75
3009 swift 1.142 <warn>
3010     <c>etc-update</c> can provide you with a list of configuration files
3011     that have newer versions at your disposal. Verify that none of the
3012     configuration files have a big impact (such as <path>/etc/fstab</path>,
3013     <path>/etc/make.conf</path>, <path>/etc/rc.conf</path>, ...). Merge the
3014     files that don't have such a big impact, remove the updates of the
3015     others or view the diff and manually update the configuration file.
3016     </warn>
3017 swift 1.149
3018 jhhudso 1.81 <pre caption="Rebooting the System">
3019 swift 1.149 # <i>etc-update</i>
3020     # <i>exit</i>
3021     <comment>(This exits the chrooted shell; you can also type <i>^D</i>)</comment>
3022     # <i>cd / </i>
3023     # <i>umount /mnt/gentoo/boot</i>
3024     # <i>umount /mnt/gentoo/proc</i>
3025     # <i>umount /mnt/gentoo</i>
3026     # <i>reboot</i>
3027 swift 1.142 <comment>(Don't forget to remove the bootable CD)</comment>
3028 jhhudso 1.81 </pre>
3029 swift 1.149
3030     <note>
3031 swift 1.164 After rebooting, it is a good idea to run the <c>modules-update</c> command to
3032 swift 1.149 create the <path>/etc/modules.conf</path> file. Instead of modifying this
3033     file directly, you should generally make changes to the files in
3034     <path>/etc/modules.d</path>.
3035     </note>
3036    
3037     <p>
3038     If you have any questions or would like to get involved with Gentoo Linux
3039     evelopment, consider joining our gentoo-user and gentoo-dev mailing lists
3040     (more information on our <uri
3041     link="http://www.gentoo.org/main/en/lists.xml">mailing lists</uri> page).
3042     We also have a handy <uri
3043     link="http://www.gentoo.org/doc/en/desktop.xml">Desktop configuration
3044     guide</uri> that will help you to continue configuring your new Gentoo Linux
3045     system and a useful <uri
3046     link="http://www.gentoo.org/doc/en/portage-user.xml">Portage user guide</uri>
3047     to help familiarize you with Portage basics. You can find the rest of the
3048     Gentoo Documentation <uri
3049     link="http://www.gentoo.org/main/en/docs.xml">here</uri>. If you have any
3050     other questions involving installation or anything for that matter, please
3051     check the Gentoo Linux <uri
3052     link="http://www.gentoo.org/doc/en/faq.xml">FAQ</uri>. Enjoy and welcome to
3053     Gentoo Linux!
3054     </p>
3055    
3056     </body>
3057     </section>
3058     </chapter>
3059    
3060 swift 1.169 <!--
3061     Gentoo Stats is down currently. Commenting out for the
3062     time being. I've also changed double-dash to dash-space-dash
3063     because otherwise commenting fails.
3064 swift 1.149 <chapter>
3065     <title>Gentoo-Stats</title>
3066     <section>
3067     <body>
3068    
3069     <p>
3070     The Gentoo Linux usage statistics program was started as an attempt to give
3071     the developers a way to find out about their user base. It collects information
3072     about Gentoo Linux usage to help us in set priorities our development.
3073     Installing it is completely optional and it would be greatly appreciated if
3074     you decide to use it. Compiled statistics can be viewed at
3075     <uri>http://stats.gentoo.org/</uri>.
3076     </p>
3077    
3078     <p>
3079     The gentoo-stats server will assign a unique ID to your system.
3080     This ID is used to make sure that each system is counted only once. The ID
3081     will not be used to individually identify your system, nor will it be matched
3082     against an IP address or other personal information. Every precaution has been
3083     taken to assure your privacy in the development of this system. The following
3084     are the things that we are monitoring right now through our "gentoo-stats"
3085     program:
3086     </p>
3087    
3088     <ul>
3089     <li>installed packages and their version numbers</li>
3090     <li>CPU information: speed (MHz), vendor name, model name, CPU flags (like "mmx" or "3dnow")</li>
3091     <li>memory information (total available physical RAM, total available swap space)</li>
3092     <li>PCI cards and network controller chips</li>
3093     <li>the Gentoo Linux profile your machine is using (that is, where the <path>/etc/make.profile</path> link is pointing to).</li>
3094     </ul>
3095    
3096     <p>
3097     We are aware that disclosure of sensitive information is a threat to most
3098     Gentoo Linux users (just as it is to the developers).
3099     </p>
3100    
3101     <ul>
3102     <li>Unless you modify the gentoo-stats program, it will never transmit sensitive information such as your passwords, configuration data, shoe size...</li>
3103     <li>Transmission of your e-mail addresses is optional and turned off by default.</li>
3104     <li>The IP address your data transmission originates from will never be logged in such a way that we can identify you. There are no "IP address/system ID" pairs.</li>
3105     </ul>
3106    
3107     <p>
3108     The installation is easy - just run the following commands:
3109     </p>
3110    
3111 jhhudso 1.81 <pre caption="Installing gentoo-stats">
3112 swift 1.149 # <i>emerge gentoo-stats</i> <comment>(Installs gentoo-stats)</comment>
3113 swift 1.169 # <i>gentoo-stats - -new</i> <comment>(Obtains a new system ID)</comment>
3114 jhhudso 1.81 </pre>
3115 swift 1.149
3116     <p>
3117     The second command above will request a new system ID and enter it into
3118     <path>/etc/gentoo-stats/gentoo-stats.conf</path> automatically. You can view
3119     this file to see additional configuration options.
3120     </p>
3121    
3122     <p>
3123     After that, the program should be run on a regular schedule (gentoo-stats does
3124     not have to be run as root). Add this line to your <path>crontab</path>:
3125     </p>
3126    
3127 jhhudso 1.81 <pre caption="Updating gentoo-stats with cron">
3128 swift 1.169 0 0 * * 0,4 /usr/sbin/gentoo-stats - -update &gt; /dev/null
3129 jhhudso 1.81 </pre>
3130 swift 1.149
3131     <p>
3132     The <c>gentoo-stats</c> program is a simple perl script which can be
3133     viewed with your favorite pager or editor: <path>/usr/sbin/gentoo-stats</path>.
3134     </p>
3135    
3136     </body>
3137     </section>
3138     </chapter>
3139 swift 1.169
3140     -->
3141 swift 1.149
3142     <chapter>
3143     <title>Gentoo On Less-Common Hardware</title>
3144     <section>
3145     <title>Hardware ATA RAID</title>
3146     <body>
3147    
3148     <p>
3149     Users who want to install Gentoo on Hardware ATA RAID must pay
3150     attention to the next steps in order for them to succesfully
3151     install Gentoo Linux:
3152     </p>
3153    
3154     <ul>
3155     <li>Be sure to start the LiveCD with the <c>doataraid</c> kerneloption.</li>
3156     <li>If you've forgotten to select <c>doataraid</c> during bootup, or the modules mysteriously didn't load, load them as needed:
3157     <pre caption = "Loading RAID modules">
3158 swift 1.137 # <i>modprobe ataraid</i>
3159     <comment>For Promise Raid Controllers:</comment>
3160     # <i>modprobe pdcraid</i>
3161     <comment>For Highpoint Raid Controllers:</comment>
3162 swift 1.138 # <i>modprobe hptraid</i>
3163 swift 1.149 </pre></li>
3164     <li>Some ATA RAID Controllers require you to reboot after partitioning; formatting will otherwise fail.</li>
3165     <li>Before chrooting, mount the devicetree into the new environment:
3166     <pre caption = "Mounting /dev into /mnt/gentoo/dev">
3167 swift 1.137 # <i>mount -o bind /dev /mnt/gentoo/dev</i>
3168 swift 1.149 </pre></li>
3169     <li>During kernel configuration, select the required RAID options:
3170     <pre caption = "RAID in the Linux Kernel Configuration">
3171 swift 1.137 <comment>For Highpoint RAID controllers:</comment>
3172     ATA/IDE/MFM/RLL support ---&gt;
3173 swift 1.149 [*] HPT36X/37X chipset support
3174     [*] Support for IDE Raid controllers
3175     [*] Highpoint 370 software RAID
3176 swift 1.137 <comment>For Promise RAID controllers:</comment>
3177     ATA/IDE/MFM/RLL support ---&gt;
3178 swift 1.149 [*] PROMISE PDC202{46|62|65|67} support
3179     <comment>and/or</comment>
3180     [*] PROMISE PDC202{68|69|70|71|75|76|77} support
3181     [*] Support for IDE Raid controllers
3182     [*] Support Promise software RAID (Fasttrak(tm))
3183     </pre></li>
3184     <li>When using GRUB add <c>--stage2=/boot/grub/stage2</c> when running <c>grub</c> to the <c>setup</c> command:
3185     <pre caption = "Installing GRUB for Hardware RAID systems">
3186 swift 1.137 grub&gt; <i>root (hd0,0)</i>
3187     grub&gt; <i>setup --stage2=/boot/grub/stage2 (hd0)</i>
3188     grub&gt; <i>quit</i>
3189 swift 1.149 </pre>
3190     Also, in the GRUB configuration be sure to point the <c>root</c>
3191     to the appropriate RAID device:
3192     <pre caption = "grub.conf for RAID">
3193 swift 1.137 title=My Gentoo Linux on RAID
3194     root (hd0,0)
3195     kernel (hd0,0)/boot/bzImage root=/dev/ataraid/dXpY
3196 swift 1.149 </pre></li>
3197     <li>LILO users should set the <c>root</c> option to the appropriate RAID device:
3198     <pre caption = "lilo.conf for RAID">
3199 swift 1.137 image=/boot/bzImage
3200 swift 1.149 label=linux
3201     read-only
3202     root=/dev/ataraid/dXpY
3203     </pre></li>
3204     </ul>
3205    
3206 swift 1.153 <p>
3207     If you still have problems installing Gentoo Linux on your Hardware
3208     RAID, be sure to report them on <uri>http://bugs.gentoo.org</uri>.
3209     </p>
3210    
3211     <p>
3212     Thanks for using Gentoo Linux, and have fun with your new installation!
3213     </p>
3214    
3215    
3216 swift 1.149 </body>
3217     </section>
3218 swift 1.137 </chapter>
3219 drobbins 1.1 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20