/[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.155 - (hide annotations) (download) (as text)
Mon Aug 11 12:42:02 2003 UTC (14 years, 3 months ago) by swift
Branch: MAIN
Changes since 1.154: +3 -1 lines
File MIME type: application/xml
Notice about default=gk_kernel for LILO users

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

  ViewVC Help
Powered by ViewVC 1.1.20