/[gentoo]/xml/htdocs/doc/en/gentoo-x86-quickinstall.xml
Gentoo

Diff of /xml/htdocs/doc/en/gentoo-x86-quickinstall.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.31 Revision 1.64
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version='1.0' encoding="UTF-8"?>
2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoo-x86-quickinstall.xml,v 1.31 2005/03/27 18:51:19 neysx Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoo-x86-quickinstall.xml,v 1.64 2006/10/08 19:38:11 nightmorph Exp $ -->
3 3
4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
5 5
6<guide link="/doc/en/gentoo-x86-quickinstall.xml"> 6<guide link="/doc/en/gentoo-x86-quickinstall.xml" lang="en">
7<title>Gentoo Linux x86 Quick Install Guide</title> 7<title>Gentoo Linux x86 Quick Install Guide</title>
8<author title="Author">Steven Wagner</author> 8
9<author title="Editor"> 9<author title="Author">
10 <mail link="neysx@gentoo.org">Xavier Neys</mail>
11</author>
12<author title="Author">
10 <mail link="swift@gentoo.org">Sven Vermeulen</mail> 13 <mail link="swift@gentoo.org">Sven Vermeulen</mail>
11</author> 14</author>
15<author title="Author">Steven Wagner</author>
12 16
13<abstract> 17<abstract>
14The Quick install guide covers all details of the install process in a 18The Quick install guide covers the Gentoo install process in a non-verbose
15non-verbose manner. Users should already have prior experience with 19manner. Its purpose is to allow users to perform a stage3 install in no time.
16installing Gentoo Linux if they want to follow this guide. 20Users should already have prior experience with installing Gentoo Linux if they
21want to follow this guide.
17</abstract> 22</abstract>
18 23
24<!-- The content of this document is licensed under the CC-BY-SA license -->
25<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
19<license/> 26<license/>
20 27
21<version>1.25</version> 28<version>9</version>
22<date>2005-03-12</date> 29<date>2006-10-08</date>
30
31<chapter>
32<title>Introduction</title>
33<section>
34<body>
35
36<p>
37This guide contains all commands you should use to complete a stage3
38installation of Gentoo. You need a connection to the Internet to download the
39stage3 and Portage snapshots.
40</p>
41
42<p>
43Timing output follows all commands that take more than a couple of seconds to
44finish. Commands were timed on an AMD 2000 1.66 Ghz PC with 512 MB of RAM and
45two SATA disks connected to a hardware controller.
46</p>
47
48<pre caption="Test box specs">
49<comment>(The following specs and the timing information should help you determine
50a rough estimate of the time you need to complete your install)</comment>
51
52# <i>grep bogo /proc/cpuinfo</i>
53bogomips : 3337.81
54
55# <i>hdparm -tT /dev/sda</i>
56/dev/sda:
57 Timing cached reads: 1100 MB in 2.00 seconds = 549.97 MB/sec
58 Timing buffered disk reads: 224 MB in 3.01 seconds = 74.36 MB/sec
59
60# <i>grep MemTotal /proc/meminfo</i>
61MemTotal: 509248 kB
62</pre>
63
64</body>
65</section>
66</chapter>
23 67
24<chapter> 68<chapter>
25<title>Quick Install Guide</title> 69<title>Quick Install Guide</title>
26<section> 70<section>
71<title>Installation Media</title>
72<body>
73
74<p>
75Download a CD from one of our <uri link="/main/en/mirrors.xml">mirrors</uri>.
76You can find the minimal CD ISO in
77<path>releases/x86/&lt;release&gt;/installcd</path> or the LiveCD ISO in
78<path>releases/x86/&lt;release&gt;/livecd</path>. The <e>minimal</e>
79installation CD is only useful for Internet-based installations. You can use
80the <e>LiveCD</e> to perform a networkless installation as documented in the
81<uri link="/doc/en/handbook/2006.1/handbook-x86.xml">2006.1 x86 installation
82handbook</uri>. The minimal CD is recommended.
83</p>
84
85<p>
86<uri link="/doc/en/faq.xml#isoburning">Burn</uri> the CD and boot it.
87</p>
88
27<body> 89</body>
90</section>
91<section>
92<title>Booting the CD</title>
93<body>
28 94
29<p>
30The installation ISOs are on the <uri link="/main/en/mirrors.xml">Gentoo
31Mirrors</uri>. Detailed descriptions of the different CDs are
32available in the <uri link="http://store.gentoo.org">Gentoo
33Store</uri>. A universal CD contains everything you need to install Gentoo Linux
34quickly and without a connection to the Internet. A Package CD is optional and
35contains pre-compiled packages such as KDE, GNOME, OpenOffice,
36Mozilla, Evolution and more.
37</p> 95<p>
38 96Press
97<c>F2</c> at the boot screen to find out what boot options exist. You can
98either start <c>gentoo</c> or <c>gentoo-nofb</c>, the latter disables the
99framebuffer. If you booted the LiveCD, don't forget to add the <c>nox</c>
100option to prevent the X graphical environment from starting. Several options
101allow to enable or disable some features. If all goes well, your hardware will
102be detected and all modules will be loaded. If the kernel fails to boot
103properly or if your computer hangs during the boot procedure, you may have to
104experiment with different configurations. The safest way is probably to use the
105<c>nodetect</c> option and then load required modules explicitly.
39<p> 106</p>
40Boot from the Universal CD. Press &lt;F1&gt; and/or &lt;F2&gt; to 107
41see what boot options are available. Press &lt;ENTER&gt; at the bootscreen to 108<pre caption="Boot the minimal CD">
42continue with the default kernel. You'll eventually receive a prompt. 109Gentoo Linux Installation LiveCD http://www.gentoo.org
110Enter to Boot; F1 for kernels F2 for options.
111boot: <i>gentoo-nofb</i>
112 <comment>(or in case of problems)</comment>
113boot: <i>gentoo-nofb nodetect</i>
114</pre>
115
116</body>
117</section>
118<section>
119<title>Optional: loading modules</title>
120<body>
121
43</p> 122<p>
44 123If you used the <c>nodetect</c> option, once booted, load the required modules.
45<pre caption="Beginning settings"> 124You need to enable networking and have access to your disks. The <c>lspci</c>
46# <i>date</i> (Make sure your time and date is correct. If wrong, set it with <i>date MMDDhhmmCCYY</i> ) 125command can help you identify your hardware.
47# <i>modprobe module_name</i> (Optional - Load any necessary modules)
48# <i>net-setup eth0</i> (Configure the network)
49# <i>fdisk /dev/hda</i> (Partition your drive)
50</pre>
51
52<p> 126</p>
53The recommended setup is a 64 meg boot volume with ext2, a swap partition 127
54twice the size of your available RAM, and the rest for your root partition 128<pre caption="Load required modules">
55using ReiserFS. 129livecd root # <i>lspci</i>
130<comment>(Use lspci's output to identify required modules)</comment>
131
132<comment>(The following is an example, adapt it to your hardware)</comment>
133livecd root # <i>modprobe 3w-9xxx</i>
134livecd root # <i>modprobe r8169</i>
135</pre>
136
137</body>
138</section>
139<section>
140<title>Network Configuration</title>
141<body>
142
56</p> 143<p>
57 144If your network does not work already, you can use <c>net-setup</c> to configure
145your network. You might need to load support for your network card using
146<c>modprobe</c> prior to the configuration. If you have ADSL, use
147<c>pppoe-setup</c> and <c>pppoe-start</c>. For PPTP support, first edit
148<path>/etc/ppp/chap-secrets</path> and <path>/etc/ppp/options.pptp</path> and
149then use <c>pptp &lt;server&nbsp;ip&gt;</c>.
58<p> 150</p>
59Initialise your partitions using <c>mke2fs</c> (Ext2), <c>mke2fs 151
60-j</c> (Ext3), <c>mkreiserfs</c> (ReiserFS), <c>mkfs.xfs</c> (XFS),
61<c>mkfs.jfs</c> (JFS) and <c>mkswap</c> (swap partition). For instance:
62<c>mke2fs -j /dev/hda3</c>.
63</p> 152<p>
64 153For wireless access, use <c>iwconfig</c> to set the wireless parameters and then
154use either <c>net-setup</c> again or run <c>ifconfig</c>, <c>dhcpcd</c> and/or
155<c>route</c> manually.
65<p> 156</p>
66Continue by mounting the partitions and extracting the appropriate stage 157
67file.
68</p> 158<p>
69 159If you are behind a proxy, do not forget to initialize your system using
70<pre caption="Preparing the Installation"> 160<c>export http_proxy</c>, <c>ftp_proxy</c> and <c>RSYNC_PROXY</c>.
71(Activate the swap partition) # <i>swapon /dev/hdax</i>
72(Mount the root partition) # <i>mount /dev/hdax /mnt/gentoo</i>
73(Create the boot mountpoint) # <i>mkdir /mnt/gentoo/boot</i>
74(Mount the boot partition) # <i>mount /dev/hdax /mnt/gentoo/boot</i>
75(Go to the mountpoint) # <i>cd /mnt/gentoo</i>
76(Extract a stage tarball...) # <i>tar -xvjpf /mnt/cdrom/stages/stage&lt;your stage&gt;.tar.bz2</i>
77(<comment>or</comment> download the latest tarball...)
78 # <i>links http://www.gentoo.org/main/en/mirrors.xml</i>
79( ... and extract) # <i>tar -xvjpf stage&lt;your stage&gt;.tar.bz2</i>
80(Optional: unpack a portage tree)# <i>tar -xvjf /mnt/cdrom/snapshots/portage-*.tar.bz2 \
81 -C /mnt/gentoo/usr</i>
82(Optional: copy over distfiles) # <i>cd /mnt/gentoo/usr/portage; mkdir distfiles;</i>
83 # <i>cp /mnt/cdrom/distfiles/* distfiles/</i>
84(Select a mirror) # <i>mirrorselect -a -s4 -o | grep 'GENTOO_MIRRORS=' \
85 &gt;&gt; /mnt/gentoo/etc/make.conf</i>
86(Copy over nameserver information)
87 # <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf</i>
88(Mount the proc filesystem) # <i>mount -t proc none /mnt/gentoo/proc</i>
89(Chroot into the new environment)# <i>chroot /mnt/gentoo /bin/bash</i>
90(Load the necessary variables) # <i>env-update; source /etc/profile</i>
91(Network-only, non-GRP: update Portage)
92 # <i>emerge --sync</i>
93</pre>
94
95<p> 161</p>
96Now we install Gentoo: 162
163<pre caption="Configure networking the guided way">
164livecd root # <i>net-setup eth0</i>
165</pre>
166
97</p> 167<p>
98 168Alternatively, you can start networking manually. The following example assigns
99<pre caption = "Installing Gentoo"> 169the IP address 192.168.1.10 to your PC and defines 192.168.1.1 as your router
100(Change USE, CFLAGS and CXXFLAGS. Stage1 can also change CHOST) 170and name server.
101 # <i>nano -w /etc/make.conf</i>
102(Stage1 only: bootstrap system) # <i>cd /usr/portage; scripts/bootstrap.sh</i>
103(Stage1, Stage2 only: install base system)
104 # <i>emerge system</i>
105</pre>
106
107<p> 171</p>
108Next we set up the necessary information: 172
173<pre caption="Configure networking the manual way">
174livecd root # <i>ifconfig eth0 192.168.1.10/24</i>
175livecd root # <i>route add default gw 192.168.1.1</i>
176livecd root # <i>echo nameserver 192.168.1.1 &gt; /etc/resolv.conf</i>
177</pre>
178
109</p> 179<p>
110 180The installation CD allows you to start an <c>sshd</c> server, add additional
111<pre caption = "Setting up Configuration Files"> 181users, run <c>irssi</c> (a command-line chat client) and surf the web using
112(Set timezone information) # <i>ln -sf /usr/share/zoneinfo/<comment>&lt;path to time zone file&gt;</comment> /etc/localtime</i> 182<c>lynx</c> or <c>links</c>.
113(Edit fstab file) # <i>nano -w /etc/fstab</i>
114</pre>
115
116<p> 183</p>
117Use the following as a <e>template</e> (don't copy verbatim) for 184
118<path>/etc/fstab</path>: 185</body>
186</section>
187<section>
188<title>Optional: connect to your new box over ssh</title>
189<body>
190
119</p> 191<p>
120 192The most interesting feature is of course <c>sshd</c>. You can start it and
121<pre caption="/etc/fstab"> 193then connect from another machine and cut and paste commands from this guide.
122# &lt;fs&gt; &lt;mountpoint&gt; &lt;type&gt; &lt;opts&gt; &lt;dump/pass&gt;
123/dev/hdax /boot ext2 defaults,noatime 1 2
124/dev/hdax none swap sw 0 0
125/dev/hdax / reiserfs noatime 0 1
126/dev/cdroms/cdrom0 /mnt/cdrom auto noauto,user 0 0
127none /proc proc defaults 0 0
128none /dev/shm tmpfs nodev,nosuid,noexec 0 0
129</pre>
130
131<p> 194</p>
132Continue by installing the Linux kernel: 195
196<pre caption="Start sshd">
197livecd root # <i>time /etc/init.d/sshd start</i>
198 * Generating hostkey ...
199<comment>(sshd generates the key and displays more output)</comment>
200 * starting sshd ... [ok]
201
202real 0m13.688s
203user 0m9.420s
204sys 0m0.090s
205</pre>
206
133</p> 207<p>
134 208Now, set the root password on the liveCD so that you can connect to it from
135<pre caption="Installing the Kernel"> 209another PC. Please note that allowing root to connect over ssh is not
136(Install the kernel sources) # <i>emerge <comment>&lt;kernel-package-here&gt;</comment></i> 210recommended under normal circumstances. If you can't trust your local network,
137(Configure your kernel using genkernel...) 211use a long and complex password, you should use it only once as it will
138 # <i>emerge genkernel; genkernel --menuconfig all</i> 212disappear after your first reboot.
139(<comment>or</comment> (1) manually build your kernel)
140 # <i>cd /usr/src/linux; make menuconfig;</i>
141( (2) Include VM fs, /proc fs, /dev fs, /dev fs auto mount at boot)
142( (3) Compile your kernel)
143 (for a 2.4 kernel) # <i>make dep &amp;&amp; make clean bzImage modules modules_install</i>
144 (for a 2.6 kernel) # <i>make &amp;&amp; make modules_install</i>
145( (4) Copy over the kernel) # <i>cp arch/i386/boot/bzImage /boot; cp System.map /boot</i>
146</pre>
147
148<p> 213</p>
149Now install other tools you might want: 214
215<pre caption="Set the root password">
216livecd root # <i>passwd</i>
217New UNIX password: <comment>type_a_password</comment>
218Retype new UNIX password: <comment>type_a_password</comment>
219passwd: password updated successfully
220</pre>
221
150</p> 222<p>
151 223Now, you can start a terminal on another PC and connect to your new box, follow
152<pre caption = "Install important system tools"> 224the rest of this guide in another window, and cut and paste commands.
153(Install system logger; choice: sysklogd, metalog, msyslog, syslog-ng)
154 # <i>emerge syslog-ng </i>
155(Have the systemlogger automatically started at boot)
156 # <i>rc-update add syslog-ng default</i>
157(Install cron daemon; choice: vixie-cron, dcron, fcron)
158 # <i>emerge vixie-cron</i>
159(Have the cron daemon automatically started at boot)
160 # <i>rc-update add vixie-cron default</i>
161(genkernel users only: install hotplug) # <i>emerge hotplug</i>
162(genkernel users only: have hotplug automatically started at boot)
163 # <i>rc-update add hotplug default</i>
164(Non-ext2,ext3 users only; choice: reiserfsprogs, xfsprogs, jfsutils)
165 # <i>emerge reiserfsprogs</i>
166(Optional: install DHCP client) # <i>emerge dhcpcd</i>
167(Domain name init script) # <i>rc-update add domainname default</i>
168</pre>
169
170<p> 225</p>
171If you need specialised kernel ebuilds, now is a good time to install them: 226
227<pre caption="Connect to your new box from another PC">
228<comment>(Use the IP address of your new box)</comment>
229$ <i>ssh root@192.168.1.10</i>
230The authenticity of host '192.168.1.10 (192.168.1.10)' can't be established.
231RSA key fingerprint is 96:e7:2d:12:ac:9c:b0:94:90:9f:40:89:b0:45:26:8f.
232Are you sure you want to continue connecting (yes/no)? <i>yes</i>
233Warning: Permanently added '192.168.1.10' (RSA) to the list of known hosts.
234Password: <comment>type_the_password</comment>
235</pre>
236
237</body>
238</section>
239<section>
240<title>Preparing the Disks</title>
241<body>
242
172</p> 243<p>
173 244Use <c>fdisk</c> or <c>cfdisk</c> to create your partition layout. You need at
174<pre caption = "Install Specialised Kernel Ebuilds"> 245least a swap partition (type 82) and one Linux partition (type 83). The
175# <i>emerge pcmcia-cs</i> (or <i>nforce-net</i>, <i>nforce-audio</i>, <i>e100</i>, <i>e1000</i>, <i>ati-drivers</i>, <i>rp-pppoe</i>) 246following scenario creates a <path>/boot</path>, a swap and a main partition
176# <i>VIDEO_CARDS="yourcard" emerge x11-drm</i> (for ATI Radeon up to 9200, Rage128, 247as used in our handbook. The device name is likely to be either
177 Matrox, Voodoo and other cards) 248<path>/dev/sda</path> for a SATA or SCSI disk, or <path>/dev/hda</path> for an
178</pre> 249IDE disk.
179
180<p> 250</p>
181Finalise the settings for your Gentoo system: 251
252<pre caption="Create the partitions">
253livecd ~ # <i>fdisk /dev/sda</i>
254
255<comment>(The rest of this guide uses the following partitioning scheme)</comment>
256livecd ~ # <i>fdisk -l /dev/sda</i>
257
258Disk /dev/sda: 599.9 GB, 599978409984 bytes
259255 heads, 63 sectors/track, 72943 cylinders
260Units = cylinders of 16065 * 512 = 8225280 bytes
261
262 Device Boot Start End Blocks Id System
263/dev/sda1 1 12 96358+ 83 Linux
264/dev/sda2 13 110 787185 82 Linux swap / Solaris
265/dev/sda3 111 72943 585031072+ 83 Linux
266</pre>
267
182</p> 268<p>
183 269Use <c>mke2fs</c>, <c>mke2fs -j</c>, <c>mkreiserfs</c>, <c>mkfs.xfs</c> and
184<pre caption = "Finalise the Configuration Settings"> 270<c>mkfs.jfs</c> to create file systems on your Linux partitions. Initialize your
185(Set root password) # <i>passwd</i> 271swap partition using <c>mkswap</c> and <c>swapon</c>.
186(Create a user) # <i>useradd your_user -m -G users,wheel,audio -s /bin/bash</i>
187(Set password for that user) # <i>passwd your_user</i>
188(Set the system hostname) # <i>echo mymachine &gt; /etc/hostname</i>
189(Set the system domainname) # <i>echo mydomain.com &gt; /etc/dnsdomainname</i>
190(Set the hostsfile, ex:"127.0.0.1 localhost mymachine")
191 # <i>nano -w /etc/hosts</i>
192(Configure basic system settings; follow comments)
193 # <i>nano -w /etc/rc.conf</i>
194</pre>
195
196<pre caption = "Set up Networking">
197(Setup networking; dhcp-users should set iface_eth0="dhcp")
198 # <i>nano -w /etc/conf.d/net</i>
199(List modules to be loaded at startup)
200 # <i>nano -w /etc/modules.autoload.d/kernel-<comment>&lt;version&gt;</comment></i>
201(Non-PCMCIA only: start networking automatically at boot)
202 # <i>rc-update add net.eth0 default</i>
203(Only if you have multiple network interfaces:)
204 (1) Create initscripts for each interface)
205 # <i>ln -s /etc/init.d/net.eth0 /etc/init.d/net.ethx</i>
206 (2) Automatically start at boot if no PCMCIA)
207 # <i>rc-update add net.ethx default</i>
208(PCMCIA only: verify /etc/conf.d/pcmcia and load PCMCIA at boot)
209 # <i>rc-update add pcmcia default</i>
210</pre>
211
212<p> 272</p>
213Now install a bootloader. 273
274<pre caption="Create the file systems and activate swap">
275<comment>(ext2 is all you need on the /boot partition)</comment>
276livecd ~ # <i>mke2fs /dev/sda1</i>
277
278<comment>(Let's use ext3 on the main partition)</comment>
279livecd ~ # <i>mke2fs -j /dev/sda3</i>
280
281<comment>(Create and activate swap)</comment>
282livecd ~ # <i>mkswap /dev/sda2 &amp;&amp; swapon /dev/sda2</i>
283</pre>
284
214</p> 285<p>
286Mount the freshly created file systems on <path>/mnt/gentoo</path>. Create
287directories for the other mount points (like <path>/mnt/gentoo/boot</path>) if
288you need them and mount them too.
289</p>
215 290
216<pre caption="Install and configure GRUB"> 291<pre caption="Mount the file systems">
217# <i>emerge grub</i> 292livecd ~ # <i>mount /dev/sda3 /mnt/gentoo</i>
218# <i>grub</i> 293livecd ~ # <i>mkdir /mnt/gentoo/boot</i>
219grub&gt; <i>root (hd0,0)</i> 294livecd ~ # <i>mount /dev/sda1 /mnt/gentoo/boot</i>
220grub&gt; <i>setup (hd0)</i> 295</pre>
221grub&gt; <i>quit</i> 296
297</body>
298</section>
299<section>
300<title>Setting Up The Stage</title>
301<body>
302
303<p>
304First make sure your date and time is set correctly using <c>date
305MMDDhhmmYYYY</c>. Use UTC time.
306</p>
307
308<pre caption="Set the date and UTC time">
309<comment>(Check the clock)</comment>
310livecd ~ # <i>date</i>
311Mon Mar 6 00:14:13 UTC 2006
312
313<comment>(Set the current date and time if required)</comment>
314livecd ~ # <i>date 030600162006</i> <comment>(Format is MMDDhhmmYYYY)</comment>
315Mon Mar 6 00:16:00 UTC 2006
316</pre>
317
318<p>
319Next, download a stage from one of our <uri
320link="/main/en/mirrors.xml">mirrors</uri>. Go to <path>/mnt/gentoo</path> and
321unpack the stage using <c>tar xjpf &lt;stage3 tarball&gt;</c>.
322</p>
323
324<pre caption="Download a stage3 archive">
325livecd ~ # <i>cd /mnt/gentoo</i>
326livecd gentoo # <i>links http://www.gentoo.org/main/en/mirrors.xml</i>
327<comment>(Pick a mirror, move to the releases/x86/current/stages directory
328highlight the stage3 of your choice, probably stage3-i686-2006.1.tar.bz2
329and press D to download it)</comment>
330
331<comment>(<b>Or</b> download it directly with wget without choosing a nearby mirror)</comment>
332livecd ~ # <i>cd /mnt/gentoo</i>
333livecd gentoo # <i>wget http://gentoo.osuosl.org/releases/x86/current/stages/stage3-i686-2006.1.tar.bz2</i>
334</pre>
335
336<pre caption="Unpack the stage3 archive">
337livecd gentoo # <i>time tar xjpf stage3*</i>
338
339real 1m13.157s
340user 1m2.920s
341sys 0m7.230s
342</pre>
343
344<p>
345Install the latest Portage snapshot. Proceed as for the stage3 archive: choose
346a nearby mirror from our <uri link="/main/en/mirrors.xml">list</uri>, download
347the latest snapshot and unpack it.
348</p>
349
350<pre caption="Download the latest Portage snapshot">
351livecd gentoo # <i>cd /mnt/gentoo/usr</i>
352livecd usr # <i>links http://www.gentoo.org/main/en/mirrors.xml</i>
353<comment>(Pick a mirror, move to the snapshots/ directory,
354highlight <b>portage-latest.tar.bz2</b> and press D to download it)</comment>
355
356<comment>(<b>Or</b> download it directly with wget without choosing a nearby mirror)</comment>
357livecd gentoo # <i>cd /mnt/gentoo/usr</i>
358livecd usr # <i>wget http://gentoo.osuosl.org/snapshots/portage-latest.tar.bz2</i>
359</pre>
360
361<pre caption="Unpack the Portage snapshot">
362livecd usr # <i>time tar xjf portage*</i>
363
364real 0m51.523s
365user 0m28.680s
366sys 0m12.840s
367</pre>
368
369</body>
370</section>
371<section>
372<title>Chrooting</title>
373<body>
374
375<p>
376Mount the <path>/proc</path> file system, copy over the
377<path>/etc/resolv.conf</path> file, then chroot into your Gentoo environment.
378</p>
379
380<pre caption="Chroot">
381livecd usr # <i>cd /</i>
382livecd / # <i>mount -t proc proc /mnt/gentoo/proc</i>
383livecd / # <i>cp -L /etc/resolv.conf /mnt/gentoo/etc/</i>
384livecd / # <i>chroot /mnt/gentoo /bin/bash</i>
385livecd / # <i>env-update &amp;&amp; source /etc/profile</i>
386>>> Regenerating /etc/ld.so.cache...
387</pre>
388
389</body>
390</section>
391<section>
392<title>Set your timezone</title>
393<body>
394
395<p>
396Set your time zone information by copying the correct file from
397<path>/usr/share/zoneinfo</path> over the <path>/etc/localtime</path> file.
398</p>
399
400<pre caption="Copy your timezone file">
401<comment>(Using Brussels as an example)</comment>
402livecd / # <i>cp /usr/share/zoneinfo/Europe/Brussels /etc/localtime</i>
403livecd / # <i>date</i>
404Wed Mar 8 00:46:05 CET 2006
405</pre>
406
407</body>
408</section>
409<section>
410<title>Set your host and domain name</title>
411<body>
412
413<p>
414Set your host name in <path>/etc/conf.d/hostname</path> and
415<path>/etc/hosts</path>. In the following example, we use <c>mybox</c> as host
416name and <c>at.myplace</c> as domain name. You can either edit the config
417files with <c>nano</c> or use the following commands:
418</p>
419
420<pre caption="Set host and domain name">
421livecd / # <i>cd /etc</i>
422livecd etc # <i>echo "127.0.0.1 mybox.at.myplace mybox localhost" > hosts</i>
423livecd etc # <i>sed -i -e 's/HOSTNAME.*/HOSTNAME="mybox"/' conf.d/hostname</i>
424<comment>(Use defined host name and check)</comment>
425livecd etc # <i>hostname mybox</i>
426livecd etc # <i>hostname -f</i>
427mybox.at.myplace
428</pre>
429
430</body>
431</section>
432<section>
433<title>Kernel Configuration</title>
434<body>
435
436<p>
437Install a kernel source (usually <c>gentoo-sources</c> or
438<c>vanilla-sources</c>), configure it, compile it and copy the
439<path>arch/i386/boot/bzImage</path> file to <path>/boot</path>.
440</p>
441
442<pre caption="Install a kernel source, compile it and install the kernel">
443livecd etc # <i>time emerge gentoo-sources</i>
444
445real 2m51.435s
446user 0m58.220s
447sys 0m29.890s
448livecd etc # <i>cd /usr/src/linux</i>
449livecd linux # <i>make menuconfig</i>
450<comment>(Configure your kernel)</comment>
451livecd linux # <i>time make -j2</i>
452
453<comment>(Elapsed time depends highly on the options you selected)</comment>
454real 3m51.962s
455user 3m27.060s
456sys 0m24.310s
457
458livecd linux # <i>make modules_install</i>
459livecd linux # <i>cp arch/i386/boot/bzImage /boot/kernel</i>
460</pre>
461
462</body>
463</section>
464<section>
465<title>Configure the system</title>
466<body>
467
468<p>
469Edit your <path>/etc/fstab</path> and replace <c>BOOT</c>, <c>ROOT</c> and
470<c>SWAP</c> with the actual partition names. Don't forget to check that the
471file systems match your installation.
472</p>
473
474<pre caption="Example fstab">
475livecd linux # <i>cd /etc</i>
476livecd etc # <i>nano -w fstab</i>
477/dev/<i>sda1</i> /boot ext2 noauto,noatime 1 2
478/dev/<i>sda3</i> / ext3 noatime 0 1
479/dev/<i>sda2</i> none swap sw 0 0
480</pre>
481
482<p>
483Configure your network in <path>/etc/conf.d/net</path>. Add the <c>net.eth0</c>
484init script to the default run level. If you have multiple NICs, symlink them
485to the <c>net.eth0</c> init script and add them to the default run level as
486well. Either edit <path>/etc/conf.d/net</path> with <c>nano</c> or use the
487following commands:
488</p>
489
490<pre caption="Configure networking">
491livecd etc # <i>cd conf.d</i>
492livecd conf.d # <i>echo 'config_eth0=( "192.168.1.10/24" )' >> net</i>
493livecd conf.d # <i>echo 'routes_eth0=( "default via 192.168.1.1" )' >> net</i>
494livecd conf.d # <i>rc-update add net.eth0 default</i>
495<comment>(If you compiled your network card driver as a module,
496add it to /etc/modules.autoload.d/kernel-2.6)</comment>
497livecd conf.d # <i>echo r8169 >> /etc/modules.autoload.d/kernel-2.6</i>
498<comment>(If you want to reconnect via ssh after you have rebooted your new box:)</comment>
499livecd conf.d # <i>rc-update add sshd default</i>
500</pre>
501
502<note>
503Emerge <c>pcmcia-cs</c> and add it to the default run level if you need it.
504</note>
505
506<p>
507Set the root password using <c>passwd</c>.
508</p>
509
510<pre caption="Set the root password">
511livecd conf.d # <i>passwd</i>
512New UNIX password: <comment>type_the_password</comment>
513Retype new UNIX password: <comment>type_the_password_again</comment>
514passwd: password updated successfully
515</pre>
516
517<p>
518Check the system configuration in <path>/etc/rc.conf</path>,
519<path>/etc/conf.d/rc</path>, <path>/etc/conf.d/keymaps</path>,
520<path>/etc/conf.d/clock</path> and edit any of those files if required.
521</p>
522
523<pre caption="Optional: edit some config files">
524livecd conf.d # <i>nano -w /etc/rc.conf</i>
525livecd conf.d # <i>nano -w /etc/conf.d/rc</i>
526livecd conf.d # <i>nano -w /etc/conf.d/keymaps</i>
527livecd conf.d # <i>nano -w /etc/conf.d/clock</i>
528</pre>
529
530</body>
531</section>
532<section>
533<title>Installing System Tools</title>
534<body>
535
536<p>
537Install a system logger like <c>syslog-ng</c> and a cron daemon like
538<c>vixie-cron</c>, and add them to the default run level.
539</p>
540
541<note>
542Cron daemons depend on an MTA. <c>mail-mta/ssmtp</c> will be pulled in as a
543dependency. If you want to use a more advanced MTA, you might want to install
544it now. If you are in a hurry, let ssmtp be installed and remove it later when
545you install the MTA of your choice.
546</note>
547
548<pre caption="Install a syslogger and a cron daemon">
549livecd conf.d # <i>time emerge syslog-ng vixie-cron</i>
550
551real 1m52.699s
552user 1m1.630s
553sys 0m35.220s
554livecd conf.d # <i>rc-update add syslog-ng default</i>
555livecd conf.d # <i>rc-update add vixie-cron default</i>
556</pre>
557
558<p>
559Install the necessary file system tools (<c>xfsprogs</c>, <c>reiserfsprogs</c>
560or <c>jfsutils</c>) and networking tools (<c>dhcpcd</c> or <c>rp-pppoe</c>) if
561you need any.
562</p>
563
564<pre caption="Install extra tools if required">
565livecd conf.d # <i>emerge xfsprogs</i> <comment>(If you use the XFS file system)</comment>
566livecd conf.d # <i>emerge jfsutils</i> <comment>(If you use the JFS file system)</comment>
567livecd conf.d # <i>emerge reiserfsprogs</i> <comment>(If you use the Reiser file system)</comment>
568livecd conf.d # <i>emerge dhcpcd</i> <comment>(If you need a DHCP client)</comment>
569livecd conf.d # <i>USE="-X" emerge rp-pppoe</i> <comment>(If you need PPPoE ADSL connectivity)</comment>
570</pre>
571
572</body>
573</section>
574<section>
575<title>Configuring the Bootloader</title>
576<body>
577
578<p>
579Emerge <c>grub</c> or <c>lilo</c>. Configure either
580<path>/boot/grub/grub.conf</path> or <path>/etc/lilo.conf</path> and install
581the bootloader you have emerged.
582</p>
583
584<p>
585<b>1. Using grub</b>
586</p>
587
588<pre caption="Emerge grub and edit its configuration file">
589livecd conf.d # <i>time emerge grub</i>
590
591real 1m8.634s
592user 0m39.460s
593sys 0m15.280s
222# <i>nano -w /boot/grub/grub.conf</i> 594livecd conf.d # <i>nano -w /boot/grub/grub.conf</i>
595</pre>
596
597<pre caption="Example grub.conf">
223default 0 598default 0
224timeout 15 599timeout 10
225splashimage=(hd0,0)/grub/splash.xpm.gz
226 600
227title=Gentoo Linux 601title=Gentoo
228 root (hd0,0) 602root (hd0,0)
229 <comment># genkernel users:</comment> 603kernel /boot/kernel root=/dev/sda3
230 kernel /kernel-<comment>&lt;kernel version&gt;</comment> root=/dev/ram0 init=/linuxrc real_root=/dev/hda3 ramdisk=8192 604</pre>
231 initrd /initrd-<comment>&lt;kernel version&gt;</comment> 605
232 <comment># non-genkernel users:</comment> 606<pre caption="Install grub">
233 kernel /kernel-<comment>&lt;kernel version&gt;</comment> root=/dev/hda3 607livecd conf.d # <i>grub</i>
608Probing devices to guess BIOS drives. This may take a long time.
609
610grub> <i>root (hd0,0)</i>
611 Filesystem type is ext2fs, partition type 0x83
612
613grub> <i>setup (hd0)</i>
614 Checking if "/boot/grub/stage1" exists... yes
615 Checking if "/boot/grub/stage2" exists... yes
616 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
617 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
618succeeded
619 Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 /boot/
620grub/menu.lst"... succeeded
621Done.
622
623grub> <i>quit</i>
624</pre>
625
626<p>
627Now, proceed with the <uri link="#reboot">rebooting section</uri>.
234</pre> 628</p>
235 629
236<pre caption="Install and configure LILO"> 630<p>
237# <i>emerge lilo</i> 631<b>2. Using lilo</b>
632</p>
633
634<pre caption="Emerge lilo and edit its configuration file">
635livecd conf.d # <i>time emerge lilo</i>
636
637real 0m47.016s
638user 0m22.770s
639sys 0m5.980s
238# <i>nano -w /etc/lilo.conf</i> 640livecd conf.d # <i>nano -w /etc/lilo.conf</i>
641</pre>
642
643<pre caption="Example lilo.conf">
239boot=/dev/hda 644boot=/dev/sda
240prompt 645prompt
241timeout=50 646timeout=50
242default=gentoo 647default=gentoo
243 648
244image=/boot/kernel-<comment>&lt;kernel version&gt;</comment> 649image=/boot/kernel
245 label=gentoo 650 label=Gentoo
246 read-only 651 read-only
247 <comment># genkernel users:</comment>
248 append="init=/linuxrc real_root=/dev/hda3 ramdisk=8192"
249 root=/dev/ram0
250 initrd=/boot/initrd-<comment>&lt;kernel version&gt;</comment>
251 <comment># non-genkernel users:</comment>
252 root=/dev/hda3 652 root=/dev/sda3
253
254# <i>/sbin/lilo</i>
255</pre>
256
257<p>
258Now unmount all partitions and reboot into your new system:
259</p> 653</pre>
260 654
261<pre caption="Finishing off and installing GUI"> 655<pre caption="Install lilo">
262(Exiting the chroot) # <i>exit; cd /</i> 656livecd conf.d # <i>lilo</i>
263(Unmounting partitions) # <i>umount /mnt/gentoo/boot /mnt/gentoo/proc /mnt/gentoo</i> 657Added Gentoo *
264(Reboot; Remove the universal CD from the tray)
265 # <i>reboot</i>
266(After booting:)
267(ADSL-users only) # <i>adsl-setup</i>
268(GRP-users only)
269 (1) Mount Package CD # <i>mount /dev/cdrom /mnt/cdrom</i>
270 (2) Copy over packages # <i>mkdir /usr/portage/packages</i>
271 # <i>cp -a /mnt/cdrom/* /usr/portage/packages/</i>
272 (3) Install extra software # <i>USE="bindist" emerge -k xorg-x11 gnome kde mozilla openoffice-bin</i>
273 (4) Configure your Xserver # <i>/usr/X11R6/bin/xorgconfig</i>
274</pre>
275
276<p>
277You can get more information from the <uri link="/doc/en/index.xml">Gentoo
278Documentation</uri>.
279</p> 658</pre>
280 659
660</body>
661</section>
662<section id="reboot">
663<title>Reboot</title>
281</body> 664<body>
665
666<p>
667Exit the chrooted environment, unmount all file systems and reboot:
668</p>
669
670<pre caption="Reboot">
671livecd conf.d # <i>exit</i>
672livecd / # <i>umount /mnt/gentoo/proc /mnt/gentoo/boot /mnt/gentoo</i>
673livecd / # <i>reboot</i>
674<comment>(Don't forget to remove the CD)</comment>
675</pre>
676
677</body>
678</section>
679<section id="after-reboot">
680<title>Finalizing the Installation</title>
681<body>
682
683<note>
684The <b>total</b> elapsed time between the display of the boot prompt on the
685minimal CD and the display of the login prompt after the reboot was
686<b>00:42:31</b> on our test box. Yes, less than one hour! Note that this time
687also includes the stage3, Portage snapshot and several packages download time
688and the time spent configuring the kernel.
689</note>
690
691<p>
692Log in as <c>root</c>, then add one or more users for daily use with
693<c>useradd</c>.
694</p>
695
696<pre caption="Connect to your new box from another PC">
697<comment>(Clean up your known_hosts file because your new box
698has generated a new definitive hostkey)</comment>
699$ <i>nano -w ~/.ssh/known_hosts</i>
700<comment>(Look for the IP of your new PC and delete the line,
701then save the file and exit nano)</comment>
702
703<comment>(Use the IP address of your new box)</comment>
704$ <i>ssh root@192.168.1.10</i>
705The authenticity of host '192.168.1.10 (192.168.1.10)' can't be established.
706RSA key fingerprint is 96:e7:2d:12:ac:9c:b0:94:90:9f:40:89:b0:45:26:8f.
707Are you sure you want to continue connecting (yes/no)? <i>yes</i>
708Warning: Permanently added '192.168.1.10' (RSA) to the list of known hosts.
709Password: <comment>type_the_password</comment>
710</pre>
711
712<pre caption="Add a new user">
713mybox ~ # <i>adduser -g users -G lp,wheel,audio,cdrom,portage,cron -m john</i>
714mybox ~ # <i>passwd john</i>
715New UNIX password: <comment>Set John's password</comment>
716Retype new UNIX password: <comment>Type John's password again</comment>
717passwd: password updated successfully
718</pre>
719
720</body>
721</section>
282</section> 722<section>
723<title>Last configuration touches</title>
724<body>
725
726<p>
727Start by selecting nearby mirrors either by defining the <c>RSYNC</c> and
728<c>GENTOO_MIRRORS</c> variables in <path>/etc/make.conf</path> or by using
729<c>mirrorselect</c>. You can also define the number of concurrent compilation
730processes at this point.
731</p>
732
733<pre caption="Use mirrorselect and set MAKEOPTS">
734mybox ~ # <i>emerge mirrorselect</i>
735mybox ~ # <i>mirrorselect -i -o >> /etc/make.conf</i>
736mybox ~ # <i>mirrorselect -i -r -o >> /etc/make.conf</i>
737<comment>(Usually, (the number of processors + 1) is a good value)</comment>
738mybox ~ # <i>echo 'MAKEOPTS="-j2"' >> /etc/make.conf</i>
739</pre>
740
741<p>
742Now is a good time to enable or disable some USE flags. Run <c>emerge -vpe
743world</c> to list all currently installed packages and their enabled and
744disabled USE flags. Either edit <path>/etc/make.conf</path> or use the
745following command to define the USE variable:
746</p>
747
748<pre caption="View USE flags in use and enable or disable some">
749mybox ~ # <i>emerge -vpe world</i>
750<comment>(Portage displays the packages and their USE flags, as an example, let's
751disable ipv6 and fortran, and enable userlocales and unicode)</comment>
752mybox ~ # <i>echo 'USE="nptl nptlonly -ipv6 -fortran userlocales unicode"' >> /etc/make.conf</i>
753</pre>
754
755<p>
756If you enabled the <c>userlocales</c> USE flag for versions of glibc that still
757support it, you should edit <path>/etc/locales.build</path> and define the
758locales you want to build.
759</p>
760
761<p>
762Later versions of glibc ignore the userlocales USE flag and use
763<path>/etc/locale.gen</path> instead. If you are upgrading glibc to such a
764version, you should create <path>/etc/locale.gen</path> <e>and remove</e>
765<path>/etc/locales.build</path>. Check the output of <c>emerge -vpe world</c>
766to know whether glibc supports the userlocales USE flag.
767</p>
768
769<pre caption="Define locales">
770mybox ~ # <i>cd /etc</i>
771<comment>(For versions of glibc with the userlocales USE flag)</comment>
772mybox etc # <i>nano -w locales.build</i>
773
774<comment>(For recent versions of glibc, convert locales.build)</comment>
775mybox etc # <i>grep '^[^#].*' locales.build | sed 's:/: :' >locale.gen</i>
776mybox etc # <i>rm locales.build</i>
777mybox etc # <i>nano -w locale.gen</i>
778</pre>
779
780<p>
781Last but not least, you may want to alter the <c>CFLAGS</c> variable in your
782<path>/etc/make.conf</path> to optimise the code to your specific needs. Please
783note that using a long list of flags is rarely needed and can even lead to a
784broken system. It is recommended to specify the processor type in the
785<c>march</c> option and stick to <c>-O2 -pipe</c>.
786</p>
787
788<p>
789You may also want to switch to <b>~x86</b>. You should only do this if you can
790deal with the odd broken ebuild or package. If you'd rather keep your system
791stable, don't add the <c>ACCEPT_KEYWORDS</c> variable. Adding
792<c>FEATURES="parallel-fetch ccache"</c> is also a good idea.
793</p>
794
795<pre caption="Last edit of make.conf">
796mybox etc # <i>nano -w make.conf</i>
797<comment>(Set -march to your CPU type in CFLAGS)</comment>
798CFLAGS="-O2 -march=<i>athlon-xp</i> -pipe"
799<comment>(Add the following line)</comment>
800FEATURES="parallel-fetch ccache"
801<comment>(Only add the following if you know what you're doing)</comment>
802ACCEPT_KEYWORDS="~x86"
803</pre>
804
805<p>
806You might want to recompile your whole system twice to make full use of your
807latest configuration changes. It would take quite a long time to complete and
808yield minimal speed benefits. You can let your system optimise itself gradually
809over time when new versions of packages are released. However, recompiling is
810a still good idea from the standpoint of maintaining system consistency. Please
811see the <uri link="/doc/en/gcc-upgrading.xml">Gentoo GCC Upgrading Guide</uri>
812for a discussion on the benefits of ensuring a consistently built system and
813world.
814</p>
815
816<p>
817Recompiling only the packages that have already been updated since the release
818or that are affected by your new USE flags will take enough time. You might
819also have to remove packages that block your upgrade. Look for "[blocks
820<brite>B</brite> ]" in the output of <c>emerge -vpuD --newuse world</c> and
821use <c>emerge -C</c> to remove them.
822</p>
823
824<pre caption="Update your packages">
825<comment>(Install ccache)</comment>
826mybox etc # <i>emerge ccache</i>
827
828<comment>(Please note that the switch to ~x86 causes many packages to be upgraded)</comment>
829mybox etc # <i>emerge -vpuD --newuse world</i>
830<comment>(Take a good look at the package list and their USE flags,
831remove blocking packages if any, and start the lengthy process)</comment>
832mybox etc # <i>time emerge -vuD --newuse world</i>
833<comment>(79 packages have been (re)compiled)</comment>
834
835real 180m13.276s
836user 121m22.905s
837sys 36m31.472s
838
839<comment>(Remerge libtool to avoid further potential problems)</comment>
840mybox etc # <i>emerge libtool</i>
841
842<comment>(Update config files, make sure you <b>do not</b> let etc-update
843update config files you have edited)</comment>
844mybox etc # <i>etc-update</i>
845
846<comment>(If perl has been updated, you should run the perl-cleaner script)</comment>
847mybox etc # <i>time perl-cleaner all</i>
848real 1m6.495s
849user 0m42.699s
850sys 0m10.641s
851
852<comment>(In case of a major upgrade of python, you should run the python-updater script)</comment>
853mybox etc # <i>python-updater</i>
854</pre>
855
856</body>
857</section>
858<section>
859<title>What to do next</title>
860<body>
861
862<p>
863Depending on what your new Gentoo machine is supposed to do, you will probably
864want to install server applications or a desktop system. Just as an example,
865<c>emerge gnome</c> and <c>emerge kde</c> have been timed on the ~x86 system
866installed as describe above. Both have been installed from the same starting
867point.
868</p>
869
870<p>
871You should check our <uri link="/doc/en/">documentation index</uri> to find out
872how to install and configure the applications of your choice.
873</p>
874
875<impo>
876The following is only an example. It is in no way meant as a recommended setup.
877</impo>
878
879<pre caption="Emerge GNOME">
880mybox etc # <i>emerge -vp gnome</i>
881<comment>(Look at the list of packages and their USE flags,
882then edit make.conf if required.</comment>
883mybox etc # <i>nano -w /etc/make.conf</i>
884<comment>(The following USE flags have been defined)</comment>
885USE="nptl nptlonly -ipv6 -fortran unicode svg hal dbus \
886 -kde -qt3 -qt4 -arts -eds -esd gnome gstreamer gtk -xmms firefox"
887
888mybox etc # <i>time emerge gnome</i>
889<comment>(326 packages have been emerged)</comment>
890
891real 520m44.532s
892user 339m21.144s
893sys 146m22.337s
894</pre>
895
896<pre caption="Emerge KDE">
897mybox etc # <i>emerge -vp kde-meta</i>
898<comment>(Look at the list of packages and their USE flags,
899then edit make.conf if required.</comment>
900mybox etc # <i>nano -w /etc/make.conf</i>
901<comment>The following USE flags have been defined)</comment>
902USE="nptl nptlonly -ipv6 -fortran unicode svg hal dbus \
903 kde qt3 qt4 -arts -eds -esd -gnome -gstreamer -gtk -xmms -firefox"
904
905mybox etc # <i>time emerge kde-meta</i>
906<comment>(391 packages have been emerged)</comment>
907
908real 1171m25.318s
909user 851m26.393s
910sys 281m45.629s
911</pre>
912
913</body>
914</section>
283</chapter> 915</chapter>
284</guide> 916</guide>

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.64

  ViewVC Help
Powered by ViewVC 1.1.20