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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.55 - (hide annotations) (download) (as text)
Sun May 11 07:26:10 2014 UTC (4 years, 2 months ago) by swift
Branch: MAIN
Changes since 1.54: +6 -4 lines
File MIME type: application/xml
Add link to kernel configuration guide on the wiki as per suggestion on #gentoo-doc by micsha

1 neysx 1.1 <?xml version='1.0' encoding='UTF-8'?>
2     <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3    
4     <!-- The content of this document is licensed under the CC-BY-SA license -->
5     <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6    
7 swift 1.55 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml,v 1.54 2014/04/12 06:13:45 swift Exp $ -->
8 neysx 1.1
9     <sections>
10    
11 neysx 1.6 <abstract>
12     The Linux kernel is the core of every distribution. This chapter
13     explains how to configure your kernel.
14     </abstract>
15    
16 swift 1.55 <version>25</version>
17     <date>2014-05-11</date>
18 neysx 1.1
19     <section>
20     <title>Installing the Sources</title>
21     <subsection>
22     <title>Choosing a Kernel</title>
23     <body>
24    
25     <p>
26     The core around which all distributions are built is the Linux kernel. It is the
27     layer between the user programs and your system hardware. Gentoo provides its
28     users several possible kernel sources. A full listing with description is
29 swift 1.53 available at the <uri link="https://wiki.gentoo.org/wiki/Kernel/Overview">Gentoo Kernel
30 swift 1.38 Guide</uri>.
31 neysx 1.1 </p>
32    
33 nightmorph 1.22 <p>
34     For <keyval id="arch"/>-based systems we have <c>gentoo-sources</c>
35 neysx 1.18 (kernel source patched for extra features).
36 neysx 1.1 </p>
37    
38     <p>
39 nightmorph 1.8 Choose your kernel source and install it using <c>emerge</c>.
40 neysx 1.1 </p>
41    
42     <pre caption="Installing a kernel source">
43 nightmorph 1.8 # <i>emerge gentoo-sources</i>
44 neysx 1.1 </pre>
45    
46     <p>
47     When you take a look in <path>/usr/src</path> you should see a symlink called
48     <path>linux</path> pointing to your kernel source. In this case, the installed
49 neysx 1.2 kernel source points to <c>gentoo-sources-<keyval id="kernel-version"/></c>.
50     Your version may be different, so keep this in mind.
51 neysx 1.1 </p>
52    
53     <pre caption="Viewing the kernel source symlink">
54     # <i>ls -l /usr/src/linux</i>
55 neysx 1.2 lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-<keyval id="kernel-version"/>
56 neysx 1.1 </pre>
57    
58     <p>
59 neysx 1.2 Now it is time to configure and compile your kernel source. You can use
60     <c>genkernel</c> for this, which will build a generic kernel as used by the
61     Installation CD. We explain the "manual" configuration first though, as it is
62     the best way to optimize your environment.
63 neysx 1.1 </p>
64    
65     <p>
66     If you want to manually configure your kernel, continue now with <uri
67 swift 1.38 link="#manual">Default: Manual Configuration</uri>. If you want to use
68     <c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
69 neysx 1.1 genkernel</uri> instead.
70     </p>
71    
72     </body>
73     </subsection>
74     </section>
75     <section id="manual">
76     <title>Default: Manual Configuration</title>
77     <subsection>
78     <title>Introduction</title>
79     <body>
80    
81     <p>
82     Manually configuring a kernel is often seen as the most difficult procedure a
83     Linux user ever has to perform. Nothing is less true -- after configuring a
84     couple of kernels you don't even remember that it was difficult ;)
85     </p>
86    
87     <p>
88     However, one thing <e>is</e> true: you must know your system when you start
89 swift 1.38 configuring a kernel manually. Most information can be gathered by emerging
90     pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now
91     be able to use <c>lspci</c> within the chrooted environment. You may safely
92     ignore any <e>pcilib</e> warnings (like pcilib: cannot open
93     /sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run
94     <c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
95     You can also run <c>lsmod</c> to see what kernel modules the Installation CD
96 neysx 1.1 uses (it might provide you with a nice hint on what to enable).
97     </p>
98    
99     <p>
100     Now go to your kernel source directory and execute <c>make menuconfig</c>. This
101     will fire up an ncurses-based configuration menu.
102     </p>
103    
104     <pre caption="Invoking menuconfig">
105     # <i>cd /usr/src/linux</i>
106     # <i>make menuconfig</i>
107     </pre>
108    
109     <p>
110     You will be greeted with several configuration sections. We'll first list some
111     options you must activate (otherwise Gentoo will not function, or not function
112 swift 1.55 properly without additional tweaks). We also have a <uri
113     link="https://wiki.gentoo.org/wiki/Kernel/Gentoo_Kernel_Configuration_Guide">Gentoo
114     Kernel Configuration Guide</uri> on the Gentoo wiki that might help you further.
115 neysx 1.1 </p>
116    
117     </body>
118     </subsection>
119     <subsection>
120     <title>Activating Required Options</title>
121     <body>
122    
123     <p>
124     Make sure that every driver that is vital to the booting of your system (such as
125     SCSI controller, ...) is compiled <e>in</e> the kernel and not as a module,
126     otherwise your system will not be able to boot completely.
127     </p>
128    
129 neysx 1.2 </body>
130     <body test="func:keyval('arch')='AMD64'">
131    
132     <p>
133     We shall then select the exact processor type. The x86_64 kernel maintainer
134     strongly recommends users enable MCE features so that they are able to be
135     notified of any hardware problems. On x86_64, these errors are not printed to
136     <c>dmesg</c> like on other architectures, but to <path>/dev/mcelog</path>. This
137 nightmorph 1.19 requires the <c>app-admin/mcelog</c> package. Make sure you select IA32
138     Emulation if you want to be able to run 32-bit programs. Gentoo will install a
139 nightmorph 1.33 multilib system (mixed 32-bit/64-bit computing) by default, so this option is
140     required.
141 neysx 1.2 </p>
142    
143 nightmorph 1.33 <note>
144     If you plan to use a non-multilib profile (for a pure 64-bit system), then you
145     don't have to select IA32 Emulation support. However, you'll also need to follow
146     the <uri link="?part=1&amp;chap=6#doc_chap2_sect2">instructions</uri> for
147 swift 1.53 switching to a <uri link="https://wiki.gentoo.org/wiki/AMD64/FAQ">non-multilib
148 nightmorph 1.33 profile</uri>, as well as choosing the correct <uri
149     link="?part=1&amp;chap=10#doc_chap2_sect2">bootloader</uri>.
150     </note>
151    
152 neysx 1.2 <pre caption="Selecting processor type and features">
153     Processor type and features --->
154 swift 1.38 [ ] Machine Check / overheating reporting
155 nightmorph 1.27 [ ] Intel MCE Features
156     [ ] AMD MCE Features
157 neysx 1.2 Processor family (AMD-Opteron/Athlon64) --->
158 nightmorph 1.27 ( ) Opteron/Athlon64/Hammer/K8
159     ( ) Intel P4 / older Netburst based Xeon
160     ( ) Core 2/newer Xeon
161 nightmorph 1.32 ( ) Intel Atom
162 neysx 1.2 ( ) Generic-x86-64
163 nightmorph 1.19 Executable file formats / Emulations --->
164     [*] IA32 Emulation
165 neysx 1.2 </pre>
166    
167     </body>
168     <body test="func:keyval('arch')='x86'">
169    
170 neysx 1.1 <p>
171     Now select the correct processor family:
172     </p>
173    
174     <pre caption="Selecting correct processor family">
175     Processor type and features ---&gt;
176     <comment>(Change according to your system)</comment>
177     (<i>Athlon/Duron/K7</i>) Processor family
178     </pre>
179    
180 neysx 1.2 </body>
181     <body>
182    
183 neysx 1.1 <p>
184 swift 1.47 Next select <e>Maintain a devtmpfs file system to mount at /dev</e> so that
185     critical device files are already available early in the boot process.
186     </p>
187    
188     <pre caption="Enabling devtmpfs support">
189     Device Drivers ---&gt;
190     Generic Driver Options ---&gt;
191     [*] Maintain a devtmpfs filesystem to mount at /dev
192     [ ] Automount devtmpfs at /dev, after the kernel mounted the rootfs
193     </pre>
194    
195     <p>
196 neysx 1.1 Now go to <c>File Systems</c> and select support for the filesystems you use.
197 swift 1.51 <e>Don't</e> compile the file system you use for the root filesystem as module,
198     otherwise your Gentoo system will not be able to mount your partition. Also
199     select <c>Virtual memory</c> and <c>/proc file system</c>.
200 neysx 1.2 </p>
201    
202 neysx 1.1 <pre caption="Selecting necessary file systems">
203     File systems ---&gt;
204     <comment>(Select one or more of the following options as needed by your system)</comment>
205 swift 1.39 &lt;*&gt; Second extended fs support
206     &lt;*&gt; Ext3 journalling file system support
207     &lt;*&gt; The Extended 4 (ext4) filesystem
208 neysx 1.1 &lt;*&gt; Reiserfs support
209     &lt;*&gt; JFS filesystem support
210     &lt;*&gt; XFS filesystem support
211 swift 1.39 ...
212     Pseudo Filesystems ---&gt;
213     [*] /proc file system support
214     [*] Virtual memory file system support (former shm fs)
215 swift 1.42
216 nightmorph 1.43 <comment>(Enable GPT partition label support if you used that previously)</comment>
217 nightmorph 1.49 -*- Enable the block layer --->
218     ...
219     Partition Types --->
220 swift 1.42 [*] Advanced partition selection
221     ...
222     [*] EFI GUID Partition support
223 neysx 1.1 </pre>
224    
225     <p>
226     If you are using PPPoE to connect to the Internet or you are using a dial-up
227     modem, you will need the following options in the kernel:
228     </p>
229    
230 nightmorph 1.25 <pre caption="Selecting PPPoE necessary drivers">
231 neysx 1.2 Device Drivers ---&gt;
232 swift 1.46 Network device support ---&gt;
233 neysx 1.2 &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     </pre>
237    
238 neysx 1.1 <p>
239     The two compression options won't harm but are not definitely needed, neither
240 nightmorph 1.10 does the <c>PPP over Ethernet</c> option, that might only be used by <c>ppp</c>
241     when configured to do kernel mode PPPoE.
242 neysx 1.1 </p>
243    
244     <p>
245     If you require it, don't forget to include support in the kernel for your
246     ethernet card.
247     </p>
248    
249 neysx 1.2 <p test="func:keyval('arch')='x86'">
250 neysx 1.1 If you have an Intel CPU that supports HyperThreading (tm), or you have a
251     multi-CPU system, you should activate "Symmetric multi-processing support":
252     </p>
253    
254 neysx 1.2 <p test="func:keyval('arch')='AMD64'">
255     If you have a multi-CPU Opteron or a multi-core (e.g. AMD64 X2) system, you
256     should activate "Symmetric multi-processing support":
257     </p>
258    
259 neysx 1.1 <pre caption="Activating SMP support">
260     Processor type and features ---&gt;
261     [*] Symmetric multi-processing support
262     </pre>
263    
264     <note>
265     In multi-core systems, each core counts as one processor.
266     </note>
267    
268 nightmorph 1.24 <p test="func:keyval('arch')='x86'">
269     If you have more than 4GB of RAM, you need to enable "High Memory Support
270     (64G)".
271     </p>
272    
273 neysx 1.1 <p>
274     If you use USB Input Devices (like Keyboard or Mouse) don't forget to enable
275     those as well:
276     </p>
277    
278     <pre caption="Activating USB Support for Input Devices">
279 neysx 1.2 Device Drivers ---&gt;
280 nightmorph 1.26 [*] HID Devices ---&gt;
281 neysx 1.2 &lt;*&gt; USB Human Interface Device (full HID) support
282 neysx 1.1 </pre>
283    
284 neysx 1.2 </body>
285     <body test="func:keyval('arch')='x86'">
286    
287 neysx 1.1 <p>
288 nightmorph 1.10 If you want PCMCIA support for your laptop, don't forget to enable
289 neysx 1.1 support for the PCMCIA card bridge present in your system:
290     </p>
291    
292 nightmorph 1.10 <pre caption="Enabling PCMCIA support">
293 swift 1.39 Bus options (PCI etc.) ---&gt;
294 neysx 1.1 PCCARD (PCMCIA/CardBus) support ---&gt;
295     &lt;*&gt; PCCard (PCMCIA/CardBus) support
296     <comment>(select 16 bit if you need support for older PCMCIA cards. Most people want this.)</comment>
297     &lt;*&gt; 16-bit PCMCIA support
298     [*] 32-bit CardBus support
299     <comment>(select the relevant bridges below)</comment>
300 swift 1.39 *** PC-card bridges ***
301 neysx 1.1 &lt;*&gt; CardBus yenta-compatible bridge support (NEW)
302     &lt;*&gt; Cirrus PD6729 compatible bridge support (NEW)
303     &lt;*&gt; i82092 compatible bridge support (NEW)
304     </pre>
305    
306     <p>
307 swift 1.38 When you've finished configuring the kernel, continue with <uri
308 neysx 1.1 link="#compiling">Compiling and Installing</uri>.
309     </p>
310    
311     </body>
312     </subsection>
313     <subsection id="compiling">
314     <title>Compiling and Installing</title>
315     <body>
316    
317     <p>
318 swift 1.38 Now that your kernel is configured, it is time to compile and install it. Exit
319 neysx 1.1 the configuration and start the compilation process:
320     </p>
321    
322 nightmorph 1.10 <pre caption="Compiling the kernel">
323 neysx 1.2 # <i>make &amp;&amp; make modules_install</i>
324     </pre>
325    
326 neysx 1.1 <p>
327     When the kernel has finished compiling, copy the kernel image to
328     <path>/boot</path>. Use whatever name you feel is appropriate for your kernel
329 swift 1.54 choice but make sure it starts with <path>linux-</path> or <path>vmlinuz-</path>
330     so that the boot loader scripts can automatically detect the new kernels later.
331     Remember to replace <c><keyval id="kernel-name"/></c> with the name and version
332     of your kernel.
333 neysx 1.1 </p>
334    
335     <pre caption="Installing the kernel">
336 neysx 1.2 # <i>cp arch/<keyval id="arch-sub"/>/boot/bzImage /boot/<keyval id="kernel-name"/></i>
337 neysx 1.1 </pre>
338    
339 swift 1.46 </body>
340     </subsection>
341 nightmorph 1.48 <subsection>
342     <include href="hb-install-initramfs.xml"/>
343     </subsection>
344 swift 1.46
345 neysx 1.1 </section>
346     <section id="genkernel">
347     <title>Alternative: Using genkernel</title>
348     <body>
349    
350     <p>
351     If you are reading this section, you have chosen to use our <c>genkernel</c>
352     script to configure your kernel for you.
353     </p>
354    
355     <p>
356 swift 1.38 Now that your kernel source tree is installed, it's now time to compile your
357     kernel by using our <c>genkernel</c> script to automatically build a kernel for
358     you. <c>genkernel</c> works by configuring a kernel nearly identically to the
359     way our Installation CD kernel is configured. This means that when you use
360     <c>genkernel</c> to build your kernel, your system will generally detect all
361     your hardware at boot-time, just like our Installation CD does. Because
362     genkernel doesn't require any manual kernel configuration, it is an ideal
363 neysx 1.1 solution for those users who may not be comfortable compiling their own kernels.
364     </p>
365    
366     <p>
367     Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
368     </p>
369    
370     <pre caption="Emerging genkernel">
371     # <i>emerge genkernel</i>
372     </pre>
373    
374     <p>
375     Now, compile your kernel sources by running <c>genkernel all</c>. Be aware
376     though, as <c>genkernel</c> compiles a kernel that supports almost all
377     hardware, this compilation will take quite a while to finish!
378     </p>
379    
380     <p>
381     Note that, if your boot partition doesn't use ext2 or ext3 as filesystem you
382 swift 1.38 might need to manually configure your kernel using <c>genkernel --menuconfig
383     all</c> and add support for your filesystem <e>in</e> the kernel (i.e.
384 swift 1.52 <e>not</e> as a module). Users of LVM2 will probably want to add <c>--lvm</c>
385 swift 1.41 as an argument as well.
386 neysx 1.1 </p>
387    
388     <pre caption="Running genkernel">
389     # <i>genkernel all</i>
390     </pre>
391    
392     <p>
393 swift 1.38 Once <c>genkernel</c> completes, a kernel, full set of modules and
394     <e>initial ram disk</e> (initramfs) will be created. We will use the kernel
395 neysx 1.1 and initrd when configuring a boot loader later in this document. Write
396     down the names of the kernel and initrd as you will need it when writing
397 swift 1.38 the bootloader configuration file. The initrd will be started immediately after
398 neysx 1.1 booting to perform hardware autodetection (just like on the Installation CD)
399     before your "real" system starts up.
400     </p>
401    
402     <pre caption="Checking the created kernel image name and initrd">
403     # <i>ls /boot/kernel* /boot/initramfs*</i>
404     </pre>
405    
406     </body>
407     </section>
408     <section id="kernel_modules">
409     <title>Kernel Modules</title>
410 nightmorph 1.22
411 neysx 1.1 <subsection>
412 nightmorph 1.22 <include href="hb-install-kernelmodules.xml"/>
413     </subsection>
414 neysx 1.1
415     </section>
416     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20