/[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.42 - (hide annotations) (download) (as text)
Sun Sep 18 17:37:47 2011 UTC (2 years, 11 months ago) by swift
Branch: MAIN
Changes since 1.41: +9 -3 lines
File MIME type: application/xml
Fix bug #383523 - Kernel configuration should mention EGI GUID Partition support. Thanks to Justin "yoosty" for reporting

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

  ViewVC Help
Powered by ViewVC 1.1.20