/[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.54 - (hide annotations) (download) (as text)
Sat Apr 12 06:13:45 2014 UTC (4 days ago) by swift
Branch: MAIN
CVS Tags: HEAD
Changes since 1.53: +7 -6 lines
File MIME type: application/xml
Fix bug #497134 - Correct naming convention for kernel

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.54 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml,v 1.53 2013/12/17 10:38:05 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.54 <version>24</version>
17     <date>2014-04-12</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     properly without additional tweaks).
113     </p>
114    
115     </body>
116     </subsection>
117     <subsection>
118     <title>Activating Required Options</title>
119     <body>
120    
121     <p>
122     Make sure that every driver that is vital to the booting of your system (such as
123     SCSI controller, ...) is compiled <e>in</e> the kernel and not as a module,
124     otherwise your system will not be able to boot completely.
125     </p>
126    
127 neysx 1.2 </body>
128     <body test="func:keyval('arch')='AMD64'">
129    
130     <p>
131     We shall then select the exact processor type. The x86_64 kernel maintainer
132     strongly recommends users enable MCE features so that they are able to be
133     notified of any hardware problems. On x86_64, these errors are not printed to
134     <c>dmesg</c> like on other architectures, but to <path>/dev/mcelog</path>. This
135 nightmorph 1.19 requires the <c>app-admin/mcelog</c> package. Make sure you select IA32
136     Emulation if you want to be able to run 32-bit programs. Gentoo will install a
137 nightmorph 1.33 multilib system (mixed 32-bit/64-bit computing) by default, so this option is
138     required.
139 neysx 1.2 </p>
140    
141 nightmorph 1.33 <note>
142     If you plan to use a non-multilib profile (for a pure 64-bit system), then you
143     don't have to select IA32 Emulation support. However, you'll also need to follow
144     the <uri link="?part=1&amp;chap=6#doc_chap2_sect2">instructions</uri> for
145 swift 1.53 switching to a <uri link="https://wiki.gentoo.org/wiki/AMD64/FAQ">non-multilib
146 nightmorph 1.33 profile</uri>, as well as choosing the correct <uri
147     link="?part=1&amp;chap=10#doc_chap2_sect2">bootloader</uri>.
148     </note>
149    
150 neysx 1.2 <pre caption="Selecting processor type and features">
151     Processor type and features --->
152 swift 1.38 [ ] Machine Check / overheating reporting
153 nightmorph 1.27 [ ] Intel MCE Features
154     [ ] AMD MCE Features
155 neysx 1.2 Processor family (AMD-Opteron/Athlon64) --->
156 nightmorph 1.27 ( ) Opteron/Athlon64/Hammer/K8
157     ( ) Intel P4 / older Netburst based Xeon
158     ( ) Core 2/newer Xeon
159 nightmorph 1.32 ( ) Intel Atom
160 neysx 1.2 ( ) Generic-x86-64
161 nightmorph 1.19 Executable file formats / Emulations --->
162     [*] IA32 Emulation
163 neysx 1.2 </pre>
164    
165     </body>
166     <body test="func:keyval('arch')='x86'">
167    
168 neysx 1.1 <p>
169     Now select the correct processor family:
170     </p>
171    
172     <pre caption="Selecting correct processor family">
173     Processor type and features ---&gt;
174     <comment>(Change according to your system)</comment>
175     (<i>Athlon/Duron/K7</i>) Processor family
176     </pre>
177    
178 neysx 1.2 </body>
179     <body>
180    
181 neysx 1.1 <p>
182 swift 1.47 Next select <e>Maintain a devtmpfs file system to mount at /dev</e> so that
183     critical device files are already available early in the boot process.
184     </p>
185    
186     <pre caption="Enabling devtmpfs support">
187     Device Drivers ---&gt;
188     Generic Driver Options ---&gt;
189     [*] Maintain a devtmpfs filesystem to mount at /dev
190     [ ] Automount devtmpfs at /dev, after the kernel mounted the rootfs
191     </pre>
192    
193     <p>
194 neysx 1.1 Now go to <c>File Systems</c> and select support for the filesystems you use.
195 swift 1.51 <e>Don't</e> compile the file system you use for the root filesystem as module,
196     otherwise your Gentoo system will not be able to mount your partition. Also
197     select <c>Virtual memory</c> and <c>/proc file system</c>.
198 neysx 1.2 </p>
199    
200 neysx 1.1 <pre caption="Selecting necessary file systems">
201     File systems ---&gt;
202     <comment>(Select one or more of the following options as needed by your system)</comment>
203 swift 1.39 &lt;*&gt; Second extended fs support
204     &lt;*&gt; Ext3 journalling file system support
205     &lt;*&gt; The Extended 4 (ext4) filesystem
206 neysx 1.1 &lt;*&gt; Reiserfs support
207     &lt;*&gt; JFS filesystem support
208     &lt;*&gt; XFS filesystem support
209 swift 1.39 ...
210     Pseudo Filesystems ---&gt;
211     [*] /proc file system support
212     [*] Virtual memory file system support (former shm fs)
213 swift 1.42
214 nightmorph 1.43 <comment>(Enable GPT partition label support if you used that previously)</comment>
215 nightmorph 1.49 -*- Enable the block layer --->
216     ...
217     Partition Types --->
218 swift 1.42 [*] Advanced partition selection
219     ...
220     [*] EFI GUID Partition support
221 neysx 1.1 </pre>
222    
223     <p>
224     If you are using PPPoE to connect to the Internet or you are using a dial-up
225     modem, you will need the following options in the kernel:
226     </p>
227    
228 nightmorph 1.25 <pre caption="Selecting PPPoE necessary drivers">
229 neysx 1.2 Device Drivers ---&gt;
230 swift 1.46 Network device support ---&gt;
231 neysx 1.2 &lt;*&gt; PPP (point-to-point protocol) support
232     &lt;*&gt; PPP support for async serial ports
233     &lt;*&gt; PPP support for sync tty ports
234     </pre>
235    
236 neysx 1.1 <p>
237     The two compression options won't harm but are not definitely needed, neither
238 nightmorph 1.10 does the <c>PPP over Ethernet</c> option, that might only be used by <c>ppp</c>
239     when configured to do kernel mode PPPoE.
240 neysx 1.1 </p>
241    
242     <p>
243     If you require it, don't forget to include support in the kernel for your
244     ethernet card.
245     </p>
246    
247 neysx 1.2 <p test="func:keyval('arch')='x86'">
248 neysx 1.1 If you have an Intel CPU that supports HyperThreading (tm), or you have a
249     multi-CPU system, you should activate "Symmetric multi-processing support":
250     </p>
251    
252 neysx 1.2 <p test="func:keyval('arch')='AMD64'">
253     If you have a multi-CPU Opteron or a multi-core (e.g. AMD64 X2) system, you
254     should activate "Symmetric multi-processing support":
255     </p>
256    
257 neysx 1.1 <pre caption="Activating SMP support">
258     Processor type and features ---&gt;
259     [*] Symmetric multi-processing support
260     </pre>
261    
262     <note>
263     In multi-core systems, each core counts as one processor.
264     </note>
265    
266 nightmorph 1.24 <p test="func:keyval('arch')='x86'">
267     If you have more than 4GB of RAM, you need to enable "High Memory Support
268     (64G)".
269     </p>
270    
271 neysx 1.1 <p>
272     If you use USB Input Devices (like Keyboard or Mouse) don't forget to enable
273     those as well:
274     </p>
275    
276     <pre caption="Activating USB Support for Input Devices">
277 neysx 1.2 Device Drivers ---&gt;
278 nightmorph 1.26 [*] HID Devices ---&gt;
279 neysx 1.2 &lt;*&gt; USB Human Interface Device (full HID) support
280 neysx 1.1 </pre>
281    
282 neysx 1.2 </body>
283     <body test="func:keyval('arch')='x86'">
284    
285 neysx 1.1 <p>
286 nightmorph 1.10 If you want PCMCIA support for your laptop, don't forget to enable
287 neysx 1.1 support for the PCMCIA card bridge present in your system:
288     </p>
289    
290 nightmorph 1.10 <pre caption="Enabling PCMCIA support">
291 swift 1.39 Bus options (PCI etc.) ---&gt;
292 neysx 1.1 PCCARD (PCMCIA/CardBus) support ---&gt;
293     &lt;*&gt; PCCard (PCMCIA/CardBus) support
294     <comment>(select 16 bit if you need support for older PCMCIA cards. Most people want this.)</comment>
295     &lt;*&gt; 16-bit PCMCIA support
296     [*] 32-bit CardBus support
297     <comment>(select the relevant bridges below)</comment>
298 swift 1.39 *** PC-card bridges ***
299 neysx 1.1 &lt;*&gt; CardBus yenta-compatible bridge support (NEW)
300     &lt;*&gt; Cirrus PD6729 compatible bridge support (NEW)
301     &lt;*&gt; i82092 compatible bridge support (NEW)
302     </pre>
303    
304     <p>
305 swift 1.38 When you've finished configuring the kernel, continue with <uri
306 neysx 1.1 link="#compiling">Compiling and Installing</uri>.
307     </p>
308    
309     </body>
310     </subsection>
311     <subsection id="compiling">
312     <title>Compiling and Installing</title>
313     <body>
314    
315     <p>
316 swift 1.38 Now that your kernel is configured, it is time to compile and install it. Exit
317 neysx 1.1 the configuration and start the compilation process:
318     </p>
319    
320 nightmorph 1.10 <pre caption="Compiling the kernel">
321 neysx 1.2 # <i>make &amp;&amp; make modules_install</i>
322     </pre>
323    
324 neysx 1.1 <p>
325     When the kernel has finished compiling, copy the kernel image to
326     <path>/boot</path>. Use whatever name you feel is appropriate for your kernel
327 swift 1.54 choice but make sure it starts with <path>linux-</path> or <path>vmlinuz-</path>
328     so that the boot loader scripts can automatically detect the new kernels later.
329     Remember to replace <c><keyval id="kernel-name"/></c> with the name and version
330     of your kernel.
331 neysx 1.1 </p>
332    
333     <pre caption="Installing the kernel">
334 neysx 1.2 # <i>cp arch/<keyval id="arch-sub"/>/boot/bzImage /boot/<keyval id="kernel-name"/></i>
335 neysx 1.1 </pre>
336    
337 swift 1.46 </body>
338     </subsection>
339 nightmorph 1.48 <subsection>
340     <include href="hb-install-initramfs.xml"/>
341     </subsection>
342 swift 1.46
343 neysx 1.1 </section>
344     <section id="genkernel">
345     <title>Alternative: Using genkernel</title>
346     <body>
347    
348     <p>
349     If you are reading this section, you have chosen to use our <c>genkernel</c>
350     script to configure your kernel for you.
351     </p>
352    
353     <p>
354 swift 1.38 Now that your kernel source tree is installed, it's now time to compile your
355     kernel by using our <c>genkernel</c> script to automatically build a kernel for
356     you. <c>genkernel</c> works by configuring a kernel nearly identically to the
357     way our Installation CD kernel is configured. This means that when you use
358     <c>genkernel</c> to build your kernel, your system will generally detect all
359     your hardware at boot-time, just like our Installation CD does. Because
360     genkernel doesn't require any manual kernel configuration, it is an ideal
361 neysx 1.1 solution for those users who may not be comfortable compiling their own kernels.
362     </p>
363    
364     <p>
365     Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
366     </p>
367    
368     <pre caption="Emerging genkernel">
369     # <i>emerge genkernel</i>
370     </pre>
371    
372     <p>
373     Now, compile your kernel sources by running <c>genkernel all</c>. Be aware
374     though, as <c>genkernel</c> compiles a kernel that supports almost all
375     hardware, this compilation will take quite a while to finish!
376     </p>
377    
378     <p>
379     Note that, if your boot partition doesn't use ext2 or ext3 as filesystem you
380 swift 1.38 might need to manually configure your kernel using <c>genkernel --menuconfig
381     all</c> and add support for your filesystem <e>in</e> the kernel (i.e.
382 swift 1.52 <e>not</e> as a module). Users of LVM2 will probably want to add <c>--lvm</c>
383 swift 1.41 as an argument as well.
384 neysx 1.1 </p>
385    
386     <pre caption="Running genkernel">
387     # <i>genkernel all</i>
388     </pre>
389    
390     <p>
391 swift 1.38 Once <c>genkernel</c> completes, a kernel, full set of modules and
392     <e>initial ram disk</e> (initramfs) will be created. We will use the kernel
393 neysx 1.1 and initrd when configuring a boot loader later in this document. Write
394     down the names of the kernel and initrd as you will need it when writing
395 swift 1.38 the bootloader configuration file. The initrd will be started immediately after
396 neysx 1.1 booting to perform hardware autodetection (just like on the Installation CD)
397     before your "real" system starts up.
398     </p>
399    
400     <pre caption="Checking the created kernel image name and initrd">
401     # <i>ls /boot/kernel* /boot/initramfs*</i>
402     </pre>
403    
404     </body>
405     </section>
406     <section id="kernel_modules">
407     <title>Kernel Modules</title>
408 nightmorph 1.22
409 neysx 1.1 <subsection>
410 nightmorph 1.22 <include href="hb-install-kernelmodules.xml"/>
411     </subsection>
412 neysx 1.1
413     </section>
414     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20