/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml
Gentoo

Diff of /xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml

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

Revision 1.1 Revision 1.25
2<!DOCTYPE sections SYSTEM "/dtd/book.dtd"> 2<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3 3
4<!-- The content of this document is licensed under the CC-BY-SA license --> 4<!-- The content of this document is licensed under the CC-BY-SA license -->
5<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 5<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml,v 1.1 2006/08/02 21:15:02 neysx Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml,v 1.25 2008/05/19 09:10:06 nightmorph Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<abstract>
12The Linux kernel is the core of every distribution. This chapter
13explains how to configure your kernel.
14</abstract>
15
11<version>3.13</version> 16<version>6.3</version>
12<date>2006-07-20</date> 17<date>2008-05-19</date>
13 18
14<section> 19<section>
15<title>Timezone</title> 20<title>Timezone</title>
16<body> 21<body>
17 22
18<p> 23<p>
19You first need to select your timezone so that your system knows where it is 24You first need to select your timezone so that your system knows where it is
20located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then copy 25located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then copy
21it to <path>/etc/localtime</path>. Please avoid the 26it to <path>/etc/localtime</path>. Please avoid the
22<path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not 27<path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not
23indicate the expected zones. For instance, <path>GMT-8</path> is in fact GMT+8. 28indicate the expected zones. For instance, <path>GMT-8</path> is in fact
29GMT+8.
24</p> 30</p>
25 31
26<pre caption="Setting the timezone information"> 32<pre caption="Setting the timezone information">
27# <i>ls /usr/share/zoneinfo</i> 33# <i>ls /usr/share/zoneinfo</i>
28<comment>(Suppose you want to use GMT)</comment> 34<comment>(Suppose you want to use GMT)</comment>
44available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel 50available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
45Guide</uri>. 51Guide</uri>.
46</p> 52</p>
47 53
48<p> 54<p>
49For x86-based systems we have, amongst other kernels, <c>vanilla-sources</c> 55For <keyval id="arch"/>-based systems we have <c>gentoo-sources</c>
50(the default kernel source as developed by the linux-kernel developers), 56(kernel source patched for extra features).
51<c>gentoo-sources</c> (kernel source patched with performance-enhancing
52features), ...
53</p>
54
55<p> 57</p>
58
59<p>
56Choose your kernel source and install it using <c>emerge</c>. The 60Choose your kernel source and install it using <c>emerge</c>.
57<c>USE="-doc"</c> is necessary to avoid installing xorg-x11 or other
58dependencies at this point. <c>USE="symlink"</c> is not necessary for a new
59install, but ensures proper creation of the <path>/usr/src/linux</path>
60symlink.
61</p> 61</p>
62 62
63<pre caption="Installing a kernel source"> 63<pre caption="Installing a kernel source">
64# <i>USE="-doc symlink" emerge gentoo-sources</i> 64# <i>emerge gentoo-sources</i>
65</pre> 65</pre>
66 66
67<p> 67<p>
68When you take a look in <path>/usr/src</path> you should see a symlink called 68When you take a look in <path>/usr/src</path> you should see a symlink called
69<path>linux</path> pointing to your kernel source. In this case, the installed 69<path>linux</path> pointing to your kernel source. In this case, the installed
70kernel source points to <c>gentoo-sources-2.6.12-r10</c>. Your version may be 70kernel source points to <c>gentoo-sources-<keyval id="kernel-version"/></c>.
71different, so keep this in mind. 71Your version may be different, so keep this in mind.
72</p> 72</p>
73 73
74<pre caption="Viewing the kernel source symlink"> 74<pre caption="Viewing the kernel source symlink">
75# <i>ls -l /usr/src/linux</i> 75# <i>ls -l /usr/src/linux</i>
76lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-2.6.12-gentoo-r10 76lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-<keyval id="kernel-version"/>
77</pre> 77</pre>
78 78
79<p> 79<p>
80Now it is time to configure and compile your kernel source. You 80Now it is time to configure and compile your kernel source. You can use
81can use <c>genkernel</c> for this, which will build a generic kernel as used 81<c>genkernel</c> for this, which will build a generic kernel as used by the
82by the Installation CD. We explain the "manual" configuration first though, as 82Installation CD. We explain the "manual" configuration first though, as it is
83it is the best way to optimize your environment. 83the best way to optimize your environment.
84</p> 84</p>
85 85
86<p> 86<p>
87If you want to manually configure your kernel, continue now with <uri 87If you want to manually configure your kernel, continue now with <uri
88link="#manual">Default: Manual Configuration</uri>. If you want to use 88link="#manual">Default: Manual Configuration</uri>. If you want to use
138<subsection> 138<subsection>
139<title>Activating Required Options</title> 139<title>Activating Required Options</title>
140<body> 140<body>
141 141
142<p> 142<p>
143First of all, activate the use of development and experimental code/drivers.
144You need this, otherwise some very important code/drivers won't show up:
145</p>
146
147<pre caption="Selecting experimental code/drivers, General setup">
148Code maturity level options ---&gt;
149 [*] Prompt for development and/or incomplete code/drivers
150</pre>
151
152<p>
153Make sure that every driver that is vital to the booting of your system (such as 143Make sure that every driver that is vital to the booting of your system (such as
154SCSI controller, ...) is compiled <e>in</e> the kernel and not as a module, 144SCSI controller, ...) is compiled <e>in</e> the kernel and not as a module,
155otherwise your system will not be able to boot completely. 145otherwise your system will not be able to boot completely.
156</p> 146</p>
147
148</body>
149<body test="func:keyval('arch')='AMD64'">
150
151<p>
152We shall then select the exact processor type. The x86_64 kernel maintainer
153strongly recommends users enable MCE features so that they are able to be
154notified of any hardware problems. On x86_64, these errors are not printed to
155<c>dmesg</c> like on other architectures, but to <path>/dev/mcelog</path>. This
156requires the <c>app-admin/mcelog</c> package. Make sure you select IA32
157Emulation if you want to be able to run 32-bit programs. Gentoo will install a
158multilib system (mixed 32-bit/64-bit computing) by default, so you probably
159want this option.
160</p>
161
162<pre caption="Selecting processor type and features">
163Processor type and features --->
164 [ ] Intel MCE Features
165 [ ] AMD MCE Features
166 Processor family (AMD-Opteron/Athlon64) --->
167 ( ) AMD-Opteron/Athlon64
168 ( ) Intel EM64T
169 ( ) Generic-x86-64
170Executable file formats / Emulations --->
171 [*] IA32 Emulation
172</pre>
173
174</body>
175<body test="func:keyval('arch')='x86'">
157 176
158<p> 177<p>
159Now select the correct processor family: 178Now select the correct processor family:
160</p> 179</p>
161 180
163Processor type and features ---&gt; 182Processor type and features ---&gt;
164 <comment>(Change according to your system)</comment> 183 <comment>(Change according to your system)</comment>
165 (<i>Athlon/Duron/K7</i>) Processor family 184 (<i>Athlon/Duron/K7</i>) Processor family
166</pre> 185</pre>
167 186
187</body>
188<body>
189
168<p> 190<p>
169Now go to <c>File Systems</c> and select support for the filesystems you use. 191Now go to <c>File Systems</c> and select support for the filesystems you use.
170<e>Don't</e> compile them as modules, otherwise your Gentoo system will not be 192<e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
171able to mount your partitions. Also select <c>Virtual memory</c> and <c>/proc 193able to mount your partitions. Also select <c>Virtual memory</c> and <c>/proc
172file system</c>. If you are using a 2.4 kernel, you need to select <c>/dev file 194file system</c>.
173system</c> as 2.4 kernels do not support <c>udev</c>.
174</p> 195</p>
175 196
176<pre caption="Selecting necessary file systems"> 197<pre caption="Selecting necessary file systems">
177<comment>(With a 2.4.x kernel)</comment>
178File systems ---&gt;
179 [*] Virtual memory file system support (former shm fs)
180 [*] /proc file system support
181 [*] /dev file system support (EXPERIMENTAL)
182 [*] automatically mount /dev at boot
183 [ ] /dev/pts file system for Unix98 PTYs
184
185<comment>(With a 2.6.x kernel)</comment>
186File systems ---&gt; 198File systems ---&gt;
187 Pseudo Filesystems ---&gt; 199 Pseudo Filesystems ---&gt;
188 [*] /proc file system support 200 [*] /proc file system support
189 [*] Virtual memory file system support (former shm fs) 201 [*] Virtual memory file system support (former shm fs)
190 202
195 &lt;*&gt; Second extended fs support 207 &lt;*&gt; Second extended fs support
196 &lt;*&gt; XFS filesystem support 208 &lt;*&gt; XFS filesystem support
197</pre> 209</pre>
198 210
199<p> 211<p>
200If your BIOS can't handle large harddrives and you jumpered the harddrive to
201report a limited size you have to enable the following option to gain access
202to your whole harddrive:
203</p>
204
205<pre caption="Selecting autogeometry resizing support">
206<comment>(2.4.x kernel only)</comment>
207ATA/IDE/MFM/RLL support ---&gt;
208 IDE, ATA and ATAPI Block devices ---&gt;
209 &lt;*&gt; Include IDE/ATA-2 DISK support
210 [ ] Use multi-mode by default
211 [*] Auto-Geometry Resizing support
212</pre>
213
214<p>
215Do not forget to enable DMA for your drives:
216</p>
217
218<pre caption="Activating DMA">
219Device Drivers ---&gt;
220 ATA/ATAPI/MFM/RLL support ---&gt;
221 [*] Generic PCI bus-master DMA support
222 [*] Use PCI DMA by default when available
223</pre>
224
225<p>
226If you are using PPPoE to connect to the Internet or you are using a dial-up 212If you are using PPPoE to connect to the Internet or you are using a dial-up
227modem, you will need the following options in the kernel: 213modem, you will need the following options in the kernel:
228</p> 214</p>
229 215
230<pre caption="Selecting PPPoE necessary drivers"> 216<pre caption="Selecting PPPoE necessary drivers">
231<comment>(With a 2.4.x kernel)</comment>
232Network device support ---&gt;
233 &lt;*&gt; PPP (point-to-point protocol) support
234 &lt;*&gt; PPP support for async serial ports
235 &lt;*&gt; PPP support for sync tty ports
236
237<comment>(With a 2.6.x kernel)</comment>
238Device Drivers ---&gt; 217Device Drivers ---&gt;
239 Networking support ---&gt; 218 Networking Support ---&gt;
240 &lt;*&gt; PPP (point-to-point protocol) support 219 &lt;*&gt; PPP (point-to-point protocol) support
241 &lt;*&gt; PPP support for async serial ports 220 &lt;*&gt; PPP support for async serial ports
242 &lt;*&gt; PPP support for sync tty ports 221 &lt;*&gt; PPP support for sync tty ports
243</pre> 222</pre>
244 223
245<p> 224<p>
246The two compression options won't harm but are not definitely needed, neither 225The two compression options won't harm but are not definitely needed, neither
247does the <c>PPP over Ethernet</c> option, that might only be used by 226does the <c>PPP over Ethernet</c> option, that might only be used by <c>ppp</c>
248<c>rp-pppoe</c> when configured to do kernel mode PPPoE. 227when configured to do kernel mode PPPoE.
249</p> 228</p>
250 229
251<p> 230<p>
252If you require it, don't forget to include support in the kernel for your 231If you require it, don't forget to include support in the kernel for your
253ethernet card. 232ethernet card.
254</p> 233</p>
255 234
256<p> 235<p test="func:keyval('arch')='x86'">
257If you have an Intel CPU that supports HyperThreading (tm), or you have a 236If you have an Intel CPU that supports HyperThreading (tm), or you have a
258multi-CPU system, you should activate "Symmetric multi-processing support": 237multi-CPU system, you should activate "Symmetric multi-processing support":
238</p>
239
240<p test="func:keyval('arch')='AMD64'">
241If you have a multi-CPU Opteron or a multi-core (e.g. AMD64 X2) system, you
242should activate "Symmetric multi-processing support":
259</p> 243</p>
260 244
261<pre caption="Activating SMP support"> 245<pre caption="Activating SMP support">
262Processor type and features ---&gt; 246Processor type and features ---&gt;
263 [*] Symmetric multi-processing support 247 [*] Symmetric multi-processing support
265 249
266<note> 250<note>
267In multi-core systems, each core counts as one processor. 251In multi-core systems, each core counts as one processor.
268</note> 252</note>
269 253
254<p test="func:keyval('arch')='x86'">
255If you have more than 4GB of RAM, you need to enable "High Memory Support
256(64G)".
257</p>
258
270<p> 259<p>
271If you use USB Input Devices (like Keyboard or Mouse) don't forget to enable 260If you use USB Input Devices (like Keyboard or Mouse) don't forget to enable
272those as well: 261those as well:
273</p> 262</p>
274 263
275<pre caption="Activating USB Support for Input Devices"> 264<pre caption="Activating USB Support for Input Devices">
265Device Drivers ---&gt;
276USB Support ---&gt; 266 USB Support ---&gt;
277 &lt;*&gt; USB Human Interface Device (full HID) support 267 &lt;*&gt; USB Human Interface Device (full HID) support
278</pre> 268</pre>
279 269
280<p> 270</body>
281Laptop-users who want PCMCIA support should <e>not</e> use the PCMCIA drivers if 271<body test="func:keyval('arch')='x86'">
282they choose to use a 2.4 kernel. More recent drivers are available through the 272
283<c>pcmcia-cs</c> package which will be installed later on. 2.6-kernel users
284however should use the PCMCIA drivers from the kernel.
285</p> 273<p>
286 274If you want PCMCIA support for your laptop, don't forget to enable
287<p>
288Besides compiling in PCMCIA support in the 2.6 kernel, don't forget to enable
289support for the PCMCIA card bridge present in your system: 275support for the PCMCIA card bridge present in your system:
290</p> 276</p>
291 277
292<pre caption="Enabling PCMCIA support for 2.6 kernels"> 278<pre caption="Enabling PCMCIA support">
293Bus options (PCI, PCMCIA, EISA, MCA, ISA) ---&gt; 279Bus options (PCI, PCMCIA, EISA, MCA, ISA) ---&gt;
294 PCCARD (PCMCIA/CardBus) support ---&gt; 280 PCCARD (PCMCIA/CardBus) support ---&gt;
295 &lt;*&gt; PCCard (PCMCIA/CardBus) support 281 &lt;*&gt; PCCard (PCMCIA/CardBus) support
296<comment>(select 16 bit if you need support for older PCMCIA cards. Most people want this.)</comment> 282<comment>(select 16 bit if you need support for older PCMCIA cards. Most people want this.)</comment>
297 &lt;*&gt; 16-bit PCMCIA support 283 &lt;*&gt; 16-bit PCMCIA support
320Now that your kernel is configured, it is time to compile and install it. Exit 306Now that your kernel is configured, it is time to compile and install it. Exit
321the configuration and start the compilation process: 307the configuration and start the compilation process:
322</p> 308</p>
323 309
324<pre caption="Compiling the kernel"> 310<pre caption="Compiling the kernel">
325<comment>(For 2.4 kernel)</comment>
326# <i>make dep &amp;&amp; make bzImage modules modules_install</i>
327
328<comment>(For 2.6 kernel)</comment>
329# <i>make &amp;&amp; make modules_install</i> 311# <i>make &amp;&amp; make modules_install</i>
330</pre> 312</pre>
331 313
332<p> 314<p>
333When the kernel has finished compiling, copy the kernel image to 315When the kernel has finished compiling, copy the kernel image to
334<path>/boot</path>. Use whatever name you feel is appropriate for your kernel 316<path>/boot</path>. Use whatever name you feel is appropriate for your kernel
335choice and remember it as you will need it later on when you configure your 317choice and remember it as you will need it later on when you configure your
336bootloader. Remember to replace <path>&lt;kernel-version&gt;</path> with the name and 318bootloader. Remember to replace <c><keyval id="kernel-name"/></c> with the
337version of your kernel. 319name and version of your kernel.
338</p> 320</p>
339 321
340<pre caption="Installing the kernel"> 322<pre caption="Installing the kernel">
341# <i>cp arch/i386/boot/bzImage /boot/&lt;kernel-version&gt;</i> 323# <i>cp arch/<keyval id="arch-sub"/>/boot/bzImage /boot/<keyval id="kernel-name"/></i>
342</pre> 324</pre>
343 325
344<p> 326<p>
345Now continue with <uri link="#kernel_modules">Kernel Modules</uri>. 327Now continue with <uri link="#kernel_modules">Kernel Modules</uri>.
346</p> 328</p>
374 356
375<pre caption="Emerging genkernel"> 357<pre caption="Emerging genkernel">
376# <i>emerge genkernel</i> 358# <i>emerge genkernel</i>
377</pre> 359</pre>
378 360
361</body>
362<body test="func:keyval('arch')='x86'">
363
379<p> 364<p>
380Next, if you are going to configure a 2.6 kernel, copy over the kernel 365Next, copy over the kernel configuration used by the Installation CD to the
381configuration used by the Installation CD to the location where genkernel
382looks for the default kernel configuration: 366location where genkernel looks for the default kernel configuration:
383</p> 367</p>
384 368
385<pre caption="Copying over the Installation CD kernel config"> 369<pre caption="Copying over the Installation CD kernel config">
386<comment>(Only do this if you are going to configure a 2.6 kernel)</comment>
387# <i>zcat /proc/config.gz &gt; /usr/share/genkernel/x86/kernel-config-2.6</i> 370# <i>zcat /proc/config.gz &gt; /usr/share/genkernel/x86/kernel-config-2.6</i>
388</pre> 371</pre>
372
373</body>
374<body>
389 375
390<p> 376<p>
391Now, compile your kernel sources by running <c>genkernel all</c>. Be aware 377Now, compile your kernel sources by running <c>genkernel all</c>. Be aware
392though, as <c>genkernel</c> compiles a kernel that supports almost all 378though, as <c>genkernel</c> compiles a kernel that supports almost all
393hardware, this compilation will take quite a while to finish! 379hardware, this compilation will take quite a while to finish!
417 403
418<pre caption="Checking the created kernel image name and initrd"> 404<pre caption="Checking the created kernel image name and initrd">
419# <i>ls /boot/kernel* /boot/initramfs*</i> 405# <i>ls /boot/kernel* /boot/initramfs*</i>
420</pre> 406</pre>
421 407
422<p>
423Now, let's perform one more step to get our system to be more like the
424Installation CD -- let's emerge <c>coldplug</c>. While the initrd autodetects
425hardware that is needed to boot your system, <c>coldplug</c> autodetects
426everything else. To emerge and enable <c>coldplug</c>, type the following:
427</p>
428
429<pre caption="Emerging and enabling coldplug">
430# <i>emerge coldplug</i>
431# <i>rc-update add coldplug boot</i>
432</pre>
433
434</body> 408</body>
435</section> 409</section>
436<section id="kernel_modules"> 410<section id="kernel_modules">
437<title>Kernel Modules</title> 411<title>Kernel Modules</title>
412
438<subsection> 413<subsection>
439<title>Configuring the Modules</title> 414<include href="hb-install-kernelmodules.xml"/>
440<body>
441
442<p>
443You should list the modules you want automatically loaded in
444<path>/etc/modules.autoload.d/kernel-2.4</path> (or <path>kernel-2.6</path>).
445You can add extra options to the modules too if you want.
446</p>
447
448<p>
449To view all available modules, run the following <c>find</c> command. Don't
450forget to substitute "&lt;kernel version&gt;" with the version of the kernel you
451just compiled:
452</p>
453
454<pre caption="Viewing all available modules">
455# <i>find /lib/modules/&lt;kernel version&gt;/ -type f -iname '*.o' -or -iname '*.ko'</i>
456</pre>
457
458<p>
459For instance, to automatically load the <c>3c59x.o</c> module, edit the
460<path>kernel-2.4</path> or <path>kernel-2.6</path> file and enter the module
461name in it.
462</p>
463
464<pre caption="Editing /etc/modules.autoload.d/kernel-2.4">
465<comment>(Example for 2.4 kernels)</comment>
466# <i>nano -w /etc/modules.autoload.d/kernel-2.4</i>
467</pre>
468
469<pre caption="/etc/modules.autoload.d/kernel-2.4 or kernel-2.6">
4703c59x
471</pre>
472
473<p>
474Continue the installation with <uri link="?part=1&amp;chap=8">Configuring
475your System</uri>.
476</p>
477
478</body>
479</subsection> 415</subsection>
416
480</section> 417</section>
481</sections> 418</sections>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.25

  ViewVC Help
Powered by ViewVC 1.1.20