/[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.49 - (hide annotations) (download) (as text)
Tue Nov 13 06:06:43 2012 UTC (22 months, 2 weeks ago) by nightmorph
Branch: MAIN
Changes since 1.48: +6 -4 lines
File MIME type: application/xml
update EFI partition location, bug #431556

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

  ViewVC Help
Powered by ViewVC 1.1.20