/[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.150 - (hide annotations) (download) (as text)
Fri Aug 8 16:13:51 2003 UTC (14 years, 4 months ago) by antifa
Branch: MAIN
Changes since 1.149: +27 -0 lines
File MIME type: application/xml
Added mirrorselect options - bug 26112

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

  ViewVC Help
Powered by ViewVC 1.1.20