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