/[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.25 Revision 1.49
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.25 2008/05/19 09:10:06 nightmorph Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml,v 1.49 2012/11/13 06:06:43 nightmorph Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<abstract> 11<abstract>
12The Linux kernel is the core of every distribution. This chapter 12The Linux kernel is the core of every distribution. This chapter
13explains how to configure your kernel. 13explains how to configure your kernel.
14</abstract> 14</abstract>
15 15
16<version>6.3</version> 16<version>19</version>
17<date>2008-05-19</date> 17<date>2012-11-12</date>
18 18
19<section> 19<section>
20<title>Timezone</title> 20<title>Timezone</title>
21<body> 21<body>
22 22
29GMT+8. 29GMT+8.
30</p> 30</p>
31 31
32<pre caption="Setting the timezone information"> 32<pre caption="Setting the timezone information">
33# <i>ls /usr/share/zoneinfo</i> 33# <i>ls /usr/share/zoneinfo</i>
34<comment>(Suppose you want to use GMT)</comment> 34<comment>(Suppose you want to use Europe/Brussels)</comment>
35# <i>cp /usr/share/zoneinfo/GMT /etc/localtime</i> 35# <i>cp /usr/share/zoneinfo/Europe/Brussels /etc/localtime</i>
36<comment>(Next set the timezone)</comment>
37# <i>echo "Europe/Brussels" &gt; /etc/timezone</i>
36</pre> 38</pre>
37 39
38</body> 40</body>
39</section> 41</section>
40<section> 42<section>
46<p> 48<p>
47The core around which all distributions are built is the Linux kernel. It is the 49The core around which all distributions are built is the Linux kernel. It is the
48layer between the user programs and your system hardware. Gentoo provides its 50layer between the user programs and your system hardware. Gentoo provides its
49users several possible kernel sources. A full listing with description is 51users several possible kernel sources. A full listing with description is
50available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel 52available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
51Guide</uri>. 53Guide</uri>.
52</p> 54</p>
53 55
54<p> 56<p>
55For <keyval id="arch"/>-based systems we have <c>gentoo-sources</c> 57For <keyval id="arch"/>-based systems we have <c>gentoo-sources</c>
56(kernel source patched for extra features). 58(kernel source patched for extra features).
83the best way to optimize your environment. 85the best way to optimize your environment.
84</p> 86</p>
85 87
86<p> 88<p>
87If you want to manually configure your kernel, continue now with <uri 89If you want to manually configure your kernel, continue now with <uri
88link="#manual">Default: Manual Configuration</uri>. If you want to use 90link="#manual">Default: Manual Configuration</uri>. If you want to use
89<c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using 91<c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
90genkernel</uri> instead. 92genkernel</uri> instead.
91</p> 93</p>
92 94
93</body> 95</body>
94</subsection> 96</subsection>
105couple of kernels you don't even remember that it was difficult ;) 107couple of kernels you don't even remember that it was difficult ;)
106</p> 108</p>
107 109
108<p> 110<p>
109However, one thing <e>is</e> true: you must know your system when you start 111However, one thing <e>is</e> true: you must know your system when you start
110configuring a kernel manually. Most information can be gathered by emerging 112configuring a kernel manually. Most information can be gathered by emerging
111pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now 113pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now
112be able to use <c>lspci</c> within the chrooted environment. You may safely 114be able to use <c>lspci</c> within the chrooted environment. You may safely
113ignore any <e>pcilib</e> warnings (like pcilib: cannot open 115ignore any <e>pcilib</e> warnings (like pcilib: cannot open
114/sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run 116/sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run
115<c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same. 117<c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
116You can also run <c>lsmod</c> to see what kernel modules the Installation CD 118You can also run <c>lsmod</c> to see what kernel modules the Installation CD
117uses (it might provide you with a nice hint on what to enable). 119uses (it might provide you with a nice hint on what to enable).
118</p> 120</p>
119 121
120<p> 122<p>
121Now go to your kernel source directory and execute <c>make menuconfig</c>. This 123Now go to your kernel source directory and execute <c>make menuconfig</c>. This
153strongly recommends users enable MCE features so that they are able to be 155strongly 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 156notified 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 157<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 158requires 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 159Emulation 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 160multilib system (mixed 32-bit/64-bit computing) by default, so this option is
159want this option. 161required.
160</p> 162</p>
163
164<note>
165If you plan to use a non-multilib profile (for a pure 64-bit system), then you
166don't have to select IA32 Emulation support. However, you'll also need to follow
167the <uri link="?part=1&amp;chap=6#doc_chap2_sect2">instructions</uri> for
168switching to a <uri link="/doc/en/gentoo-amd64-faq.xml">non-multilib
169profile</uri>, as well as choosing the correct <uri
170link="?part=1&amp;chap=10#doc_chap2_sect2">bootloader</uri>.
171</note>
161 172
162<pre caption="Selecting processor type and features"> 173<pre caption="Selecting processor type and features">
163Processor type and features ---> 174Processor type and features --->
175 [ ] Machine Check / overheating reporting
164 [ ] Intel MCE Features 176 [ ] Intel MCE Features
165 [ ] AMD MCE Features 177 [ ] AMD MCE Features
166 Processor family (AMD-Opteron/Athlon64) ---> 178 Processor family (AMD-Opteron/Athlon64) --->
167 ( ) AMD-Opteron/Athlon64 179 ( ) Opteron/Athlon64/Hammer/K8
180 ( ) Intel P4 / older Netburst based Xeon
181 ( ) Core 2/newer Xeon
168 ( ) Intel EM64T 182 ( ) Intel Atom
169 ( ) Generic-x86-64 183 ( ) Generic-x86-64
170Executable file formats / Emulations ---> 184Executable file formats / Emulations --->
171 [*] IA32 Emulation 185 [*] IA32 Emulation
172</pre> 186</pre>
173 187
186 200
187</body> 201</body>
188<body> 202<body>
189 203
190<p> 204<p>
205Next select <e>Maintain a devtmpfs file system to mount at /dev</e> so that
206critical device files are already available early in the boot process.
207</p>
208
209<pre caption="Enabling devtmpfs support">
210Device Drivers ---&gt;
211 Generic Driver Options ---&gt;
212 [*] Maintain a devtmpfs filesystem to mount at /dev
213 [ ] Automount devtmpfs at /dev, after the kernel mounted the rootfs
214</pre>
215
216<p>
191Now go to <c>File Systems</c> and select support for the filesystems you use. 217Now go to <c>File Systems</c> and select support for the filesystems you use.
192<e>Don't</e> compile them as modules, otherwise your Gentoo system will not be 218<e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
193able to mount your partitions. Also select <c>Virtual memory</c> and <c>/proc 219able to mount your partitions. Also select <c>Virtual memory</c> and <c>/proc
194file system</c>. 220file system</c>.
195</p> 221</p>
196 222
197<pre caption="Selecting necessary file systems"> 223<pre caption="Selecting necessary file systems">
198File systems ---&gt; 224File systems ---&gt;
225<comment>(Select one or more of the following options as needed by your system)</comment>
226 &lt;*&gt; Second extended fs support
227 &lt;*&gt; Ext3 journalling file system support
228 &lt;*&gt; The Extended 4 (ext4) filesystem
229 &lt;*&gt; Reiserfs support
230 &lt;*&gt; JFS filesystem support
231 &lt;*&gt; XFS filesystem support
232 ...
199 Pseudo Filesystems ---&gt; 233 Pseudo Filesystems ---&gt;
200 [*] /proc file system support 234 [*] /proc file system support
201 [*] Virtual memory file system support (former shm fs) 235 [*] Virtual memory file system support (former shm fs)
202 236
203<comment>(Select one or more of the following options as needed by your system)</comment> 237<comment>(Enable GPT partition label support if you used that previously)</comment>
204 &lt;*&gt; Reiserfs support 238-*- Enable the block layer --->
205 &lt;*&gt; Ext3 journalling file system support 239 ...
206 &lt;*&gt; JFS filesystem support 240 Partition Types --->
207 &lt;*&gt; Second extended fs support 241 [*] Advanced partition selection
208 &lt;*&gt; XFS filesystem support 242 ...
243 [*] EFI GUID Partition support
209</pre> 244</pre>
210 245
211<p> 246<p>
212If you are using PPPoE to connect to the Internet or you are using a dial-up 247If you are using PPPoE to connect to the Internet or you are using a dial-up
213modem, you will need the following options in the kernel: 248modem, you will need the following options in the kernel:
214</p> 249</p>
215 250
216<pre caption="Selecting PPPoE necessary drivers"> 251<pre caption="Selecting PPPoE necessary drivers">
217Device Drivers ---&gt; 252Device Drivers ---&gt;
218 Networking Support ---&gt; 253 Network device support ---&gt;
219 &lt;*&gt; PPP (point-to-point protocol) support 254 &lt;*&gt; PPP (point-to-point protocol) support
220 &lt;*&gt; PPP support for async serial ports 255 &lt;*&gt; PPP support for async serial ports
221 &lt;*&gt; PPP support for sync tty ports 256 &lt;*&gt; PPP support for sync tty ports
222</pre> 257</pre>
223 258
261those as well: 296those as well:
262</p> 297</p>
263 298
264<pre caption="Activating USB Support for Input Devices"> 299<pre caption="Activating USB Support for Input Devices">
265Device Drivers ---&gt; 300Device Drivers ---&gt;
266 USB Support ---&gt; 301 [*] HID Devices ---&gt;
267 &lt;*&gt; USB Human Interface Device (full HID) support 302 &lt;*&gt; USB Human Interface Device (full HID) support
268</pre> 303</pre>
269 304
270</body> 305</body>
271<body test="func:keyval('arch')='x86'"> 306<body test="func:keyval('arch')='x86'">
274If you want PCMCIA support for your laptop, don't forget to enable 309If you want PCMCIA support for your laptop, don't forget to enable
275support for the PCMCIA card bridge present in your system: 310support for the PCMCIA card bridge present in your system:
276</p> 311</p>
277 312
278<pre caption="Enabling PCMCIA support"> 313<pre caption="Enabling PCMCIA support">
279Bus options (PCI, PCMCIA, EISA, MCA, ISA) ---&gt; 314Bus options (PCI etc.) ---&gt;
280 PCCARD (PCMCIA/CardBus) support ---&gt; 315 PCCARD (PCMCIA/CardBus) support ---&gt;
281 &lt;*&gt; PCCard (PCMCIA/CardBus) support 316 &lt;*&gt; PCCard (PCMCIA/CardBus) support
282<comment>(select 16 bit if you need support for older PCMCIA cards. Most people want this.)</comment> 317<comment>(select 16 bit if you need support for older PCMCIA cards. Most people want this.)</comment>
283 &lt;*&gt; 16-bit PCMCIA support 318 &lt;*&gt; 16-bit PCMCIA support
284 [*] 32-bit CardBus support 319 [*] 32-bit CardBus support
285<comment>(select the relevant bridges below)</comment> 320<comment>(select the relevant bridges below)</comment>
286 --- PC-card bridges 321 *** PC-card bridges ***
287 &lt;*&gt; CardBus yenta-compatible bridge support (NEW) 322 &lt;*&gt; CardBus yenta-compatible bridge support (NEW)
288 &lt;*&gt; Cirrus PD6729 compatible bridge support (NEW) 323 &lt;*&gt; Cirrus PD6729 compatible bridge support (NEW)
289 &lt;*&gt; i82092 compatible bridge support (NEW) 324 &lt;*&gt; i82092 compatible bridge support (NEW)
290 &lt;*&gt; i82365 compatible bridge support (NEW)
291 &lt;*&gt; Databook TCIC host bridge support (NEW)
292</pre> 325</pre>
293 326
294<p> 327<p>
295When you've finished configuring the kernel, continue with <uri 328When you've finished configuring the kernel, continue with <uri
296link="#compiling">Compiling and Installing</uri>. 329link="#compiling">Compiling and Installing</uri>.
297</p> 330</p>
298 331
299</body> 332</body>
300</subsection> 333</subsection>
301<subsection id="compiling"> 334<subsection id="compiling">
302<title>Compiling and Installing</title> 335<title>Compiling and Installing</title>
303<body> 336<body>
304 337
305<p> 338<p>
306Now that your kernel is configured, it is time to compile and install it. Exit 339Now that your kernel is configured, it is time to compile and install it. Exit
307the configuration and start the compilation process: 340the configuration and start the compilation process:
308</p> 341</p>
309 342
310<pre caption="Compiling the kernel"> 343<pre caption="Compiling the kernel">
311# <i>make &amp;&amp; make modules_install</i> 344# <i>make &amp;&amp; make modules_install</i>
321 354
322<pre caption="Installing the kernel"> 355<pre caption="Installing the kernel">
323# <i>cp arch/<keyval id="arch-sub"/>/boot/bzImage /boot/<keyval id="kernel-name"/></i> 356# <i>cp arch/<keyval id="arch-sub"/>/boot/bzImage /boot/<keyval id="kernel-name"/></i>
324</pre> 357</pre>
325 358
326<p>
327Now continue with <uri link="#kernel_modules">Kernel Modules</uri>.
328</p>
329
330</body> 359</body>
360</subsection>
331</subsection> 361<subsection>
362<include href="hb-install-initramfs.xml"/>
363</subsection>
364
332</section> 365</section>
333<section id="genkernel"> 366<section id="genkernel">
334<title>Alternative: Using genkernel</title> 367<title>Alternative: Using genkernel</title>
335<body> 368<body>
336 369
338If you are reading this section, you have chosen to use our <c>genkernel</c> 371If you are reading this section, you have chosen to use our <c>genkernel</c>
339script to configure your kernel for you. 372script to configure your kernel for you.
340</p> 373</p>
341 374
342<p> 375<p>
343Now that your kernel source tree is installed, it's now time to compile your 376Now that your kernel source tree is installed, it's now time to compile your
344kernel by using our <c>genkernel</c> script to automatically build a kernel for 377kernel by using our <c>genkernel</c> script to automatically build a kernel for
345you. <c>genkernel</c> works by configuring a kernel nearly identically to the 378you. <c>genkernel</c> works by configuring a kernel nearly identically to the
346way our Installation CD kernel is configured. This means that when you use 379way our Installation CD kernel is configured. This means that when you use
347<c>genkernel</c> to build your kernel, your system will generally detect all 380<c>genkernel</c> to build your kernel, your system will generally detect all
348your hardware at boot-time, just like our Installation CD does. Because 381your hardware at boot-time, just like our Installation CD does. Because
349genkernel doesn't require any manual kernel configuration, it is an ideal 382genkernel doesn't require any manual kernel configuration, it is an ideal
350solution for those users who may not be comfortable compiling their own kernels. 383solution for those users who may not be comfortable compiling their own kernels.
351</p> 384</p>
352 385
353<p> 386<p>
354Now, let's see how to use genkernel. First, emerge the genkernel ebuild: 387Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
355</p> 388</p>
356 389
357<pre caption="Emerging genkernel"> 390<pre caption="Emerging genkernel">
358# <i>emerge genkernel</i> 391# <i>emerge genkernel</i>
359</pre> 392</pre>
360
361</body>
362<body test="func:keyval('arch')='x86'">
363
364<p>
365Next, copy over the kernel configuration used by the Installation CD to the
366location where genkernel looks for the default kernel configuration:
367</p>
368
369<pre caption="Copying over the Installation CD kernel config">
370# <i>zcat /proc/config.gz &gt; /usr/share/genkernel/x86/kernel-config-2.6</i>
371</pre>
372
373</body>
374<body>
375 393
376<p> 394<p>
377Now, compile your kernel sources by running <c>genkernel all</c>. Be aware 395Now, compile your kernel sources by running <c>genkernel all</c>. Be aware
378though, as <c>genkernel</c> compiles a kernel that supports almost all 396though, as <c>genkernel</c> compiles a kernel that supports almost all
379hardware, this compilation will take quite a while to finish! 397hardware, this compilation will take quite a while to finish!
380</p> 398</p>
381 399
382<p> 400<p>
383Note that, if your boot partition doesn't use ext2 or ext3 as filesystem you 401Note that, if your boot partition doesn't use ext2 or ext3 as filesystem you
384might need to manually configure your kernel using <c>genkernel --menuconfig 402might need to manually configure your kernel using <c>genkernel --menuconfig
385all</c> and add support for your filesystem <e>in</e> the kernel (i.e. 403all</c> and add support for your filesystem <e>in</e> the kernel (i.e.
386<e>not</e> as a module). Users of EVMS2 or LVM2 will probably want to add 404<e>not</e> as a module). Users of LVM2 will probably want to add <c>--lvm2</c>
387<c>--evms2</c> or <c>--lvm2</c> as argument as well. 405as an argument as well.
388</p> 406</p>
389 407
390<pre caption="Running genkernel"> 408<pre caption="Running genkernel">
391# <i>genkernel all</i> 409# <i>genkernel all</i>
392</pre> 410</pre>
393 411
394<p> 412<p>
395Once <c>genkernel</c> completes, a kernel, full set of modules and 413Once <c>genkernel</c> completes, a kernel, full set of modules and
396<e>initial root disk</e> (initrd) will be created. We will use the kernel 414<e>initial ram disk</e> (initramfs) will be created. We will use the kernel
397and initrd when configuring a boot loader later in this document. Write 415and initrd when configuring a boot loader later in this document. Write
398down the names of the kernel and initrd as you will need it when writing 416down the names of the kernel and initrd as you will need it when writing
399the bootloader configuration file. The initrd will be started immediately after 417the bootloader configuration file. The initrd will be started immediately after
400booting to perform hardware autodetection (just like on the Installation CD) 418booting to perform hardware autodetection (just like on the Installation CD)
401before your "real" system starts up. 419before your "real" system starts up.
402</p> 420</p>
403 421
404<pre caption="Checking the created kernel image name and initrd"> 422<pre caption="Checking the created kernel image name and initrd">

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

  ViewVC Help
Powered by ViewVC 1.1.20