/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-ia64-kernel.xml
Gentoo

Contents of /xml/htdocs/doc/en/handbook/hb-install-ia64-kernel.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.27 - (show annotations) (download) (as text)
Tue Sep 11 22:49:20 2012 UTC (22 months, 1 week ago) by nightmorph
Branch: MAIN
Changes since 1.26: +64 -12 lines
File MIME type: application/xml
update handbooks for initramfs changes needed for separate /usr and other partitions. bug #415175, bug #434550, bug #434554, bug #434732

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 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ia64-kernel.xml,v 1.26 2012/03/27 17:46:07 swift Exp $ -->
8
9 <sections>
10
11 <version>17</version>
12 <date>2012-09-11</date>
13
14 <section>
15 <title>Timezone</title>
16 <body>
17
18 <p>
19 You first need to select your timezone so that your system knows where it is
20 located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then copy
21 it to <path>/etc/localtime</path>. Please avoid the
22 <path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not
23 indicate the expected zones. For instance, <path>GMT-8</path> is in fact
24 GMT+8.
25 </p>
26
27 <pre caption="Setting the timezone information">
28 # <i>ls /usr/share/zoneinfo</i>
29 <comment>(Suppose you want to use Europe/Brussels)</comment>
30 # <i>cp /usr/share/zoneinfo/Europe/Brussels /etc/localtime</i>
31 <comment>(Next set the timezone)</comment>
32 # <i>echo "Europe/Brussels" &gt; /etc/timezone</i>
33 </pre>
34
35 </body>
36 </section>
37 <section>
38 <title>Installing the Sources</title>
39 <subsection>
40 <title>Choosing a Kernel</title>
41 <body>
42
43 <p>
44 The core around which all distributions are built is the Linux kernel. It is the
45 layer between the user programs and your system hardware. Gentoo provides its
46 users several possible kernel sources. A full listing with description is
47 available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
48 Guide</uri>.
49 </p>
50
51 <p>
52 For <keyval id="arch"/> systems, we will use <c>gentoo-sources</c> (contains
53 additional patches for extra features).
54 </p>
55
56 <p>
57 Now install it using <c>emerge</c>.
58 </p>
59
60 <pre caption="Installing a kernel source">
61 # <i>emerge gentoo-sources</i>
62 </pre>
63
64 <p>
65 When you take a look in <path>/usr/src</path> you should see a symlink called
66 <path>linux</path> pointing to your kernel source. In this case, the installed
67 kernel source points to <c>gentoo-sources-<keyval id="kernel-version"/></c>.
68 Your version may be different, so keep this in mind.
69 </p>
70
71 <pre caption="Viewing the kernel source symlink">
72 # <i>ls -l /usr/src/linux</i>
73 lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-<keyval id="kernel-version"/>
74 </pre>
75
76 <p>
77 Now it is time to configure and compile your kernel source. You can use
78 <c>genkernel</c> for this, which will build a generic kernel as used by the
79 Installation CD. We explain the "manual" configuration first though, as it is
80 the best way to optimize your environment.
81 </p>
82
83 <p>
84 If you want to manually configure your kernel, continue now with <uri
85 link="#manual">Default: Manual Configuration</uri>. If you want to use
86 <c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
87 genkernel</uri> instead.
88 </p>
89
90 </body>
91 </subsection>
92 </section>
93 <section id="manual">
94 <title>Default: Manual Configuration</title>
95 <subsection>
96 <title>Introduction</title>
97 <body>
98
99 <p>
100 Manually configuring a kernel is often seen as the most difficult procedure a
101 Linux user ever has to perform. Nothing is less true -- after configuring a
102 couple of kernels you don't even remember that it was difficult ;)
103 </p>
104
105 <p>
106 However, one thing <e>is</e> true: you must know your system when you start
107 configuring a kernel manually. Most information can be gathered by emerging
108 pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now
109 be able to use <c>lspci</c> within the chrooted environment. You may safely
110 ignore any <e>pcilib</e> warnings (like pcilib: cannot open
111 /sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run
112 <c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
113 You can also run <c>lsmod</c> to see what kernel modules the Installation CD
114 uses (it might provide you with a nice hint on what to enable).
115 </p>
116
117 <p>
118 Now go to your kernel source directory and execute <c>make menuconfig</c>. This
119 will fire up an ncurses-based configuration menu.
120 </p>
121
122 <pre caption="Invoking menuconfig">
123 # <i>cd /usr/src/linux</i>
124 # <i>make menuconfig</i>
125 </pre>
126
127 <p>
128 You will be greeted with several configuration sections. We'll first list some
129 options you must activate (otherwise Gentoo will not function, or not function
130 properly without additional tweaks).
131 </p>
132
133 </body>
134 </subsection>
135 <subsection>
136 <title>Activating Required Options</title>
137 <body>
138
139 <p>
140 Make sure that every driver that is vital to the booting of your system (such as
141 SCSI controller, ...) is compiled <e>in</e> the kernel and not as a module,
142 otherwise your system will not be able to boot completely.
143 </p>
144
145 <p>
146 Now select the correct system type and processor type. If you don't know what
147 kind of IA64 system type you have, <c>DIG-compliant</c> is a good default
148 choice. If you are installing on an SGI system make sure you select the
149 SGI system type, your kernel may just lock up and refuse to boot otherwise.
150 </p>
151
152 <pre caption="Selecting correct system type">
153 System type ---&gt;
154 <comment>(Change according to your system)</comment>
155 <i>DIG-compliant</i>
156 Processor type ---&gt;
157 <comment>(Change according to your system)</comment>
158 <i>Itanium 2</i>
159 </pre>
160
161 <p>
162 Now go to <c>File Systems</c> and select support for the filesystems you use.
163 <e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
164 able to mount your partitions. Also select <c>Virtual memory</c> and <c>/proc
165 file system</c>.
166 </p>
167
168 <pre caption="Selecting necessary file systems">
169 File systems ---&gt;
170 Pseudo Filesystems ---&gt;
171 [*] /proc file system support
172 [*] Virtual memory file system support (former shm fs)
173
174 <comment>(Select one or more of the following options as needed by your system)</comment>
175 &lt;*&gt; Reiserfs support
176 &lt;*&gt; Ext3 journalling file system support
177 &lt;*&gt; JFS filesystem support
178 &lt;*&gt; Second extended fs support
179 &lt;*&gt; XFS filesystem support
180
181 <comment>(Be sure to enable VFAT support for the EFI partition)</comment>
182 DOS/FAT/NT Filesystems ---&gt;
183 &lt;*&gt; VFAT (Windows-95) fs support
184
185 <comment>(Enable GPT partition label support if you used that previously</comment>
186 Partition Types ---&gt;
187 [*] Advanced partition selection
188 ...
189 [*] EFI GUID Partition support
190 </pre>
191
192 <p>
193 If you are using PPPoE to connect to the Internet or you are using a dial-up
194 modem, you will need the following options in the kernel:
195 </p>
196
197 <pre caption="Selecting PPPoE necessary drivers">
198 Device Drivers ---&gt;
199 Network device support ---&gt;
200 &lt;*&gt; PPP (point-to-point protocol) support
201 &lt;*&gt; PPP support for async serial ports
202 &lt;*&gt; PPP support for sync tty ports
203 </pre>
204
205 <p>
206 The two compression options won't harm but are not definitely needed, neither
207 does the <c>PPP over Ethernet</c> option, that might only be used by <c>ppp</c>
208 when configured to do kernel mode PPPoE.
209 </p>
210
211 <p>
212 If you require it, don't forget to include support in the kernel for your
213 ethernet card.
214 </p>
215
216 <p>
217 If you have an Intel CPU that supports HyperThreading (tm), or you have a
218 multi-CPU system, you should activate "Symmetric multi-processing support":
219 </p>
220
221 <pre caption="Activating SMP support">
222 Processor type and features ---&gt;
223 [*] Symmetric multi-processing support
224 </pre>
225
226 <p>
227 If you use USB Input Devices (like Keyboard or Mouse) don't forget to enable
228 those as well:
229 </p>
230
231 <pre caption="Activating USB Support for Input Devices">
232 Device Drivers ---&gt;
233 [*] HID Devices ---&gt;
234 &lt;*&gt; USB Human Interface Device (full HID) support
235 </pre>
236
237 <p>
238 When you've finished configuring the kernel, continue with <uri
239 link="#compiling">Compiling and Installing</uri>.
240 </p>
241
242 </body>
243 </subsection>
244 <subsection id="compiling">
245 <title>Compiling and Installing</title>
246 <body>
247
248 <p>
249 Now that your kernel is configured, it is time to compile and install it. Exit
250 the configuration and start the compilation process:
251 </p>
252
253 <pre caption="Compiling the kernel">
254 # <i>make &amp;&amp; make modules_install</i>
255 </pre>
256
257 <p>
258 When the kernel has finished compiling, copy the kernel image to <path>/</path>.
259 Use whatever name you feel is appropriate for your kernel choice and remember it
260 as you will need it later on when you configure your bootloader. Remember to
261 replace <c>vmlinuz</c> with the name and version of your kernel.
262 </p>
263
264 <pre caption="Installing the kernel">
265 # <i>cp vmlinux.gz /boot/vmlinuz</i>
266 </pre>
267
268 </body>
269 </subsection>
270 <subsection id="initramfs">
271 <title>(Optional) Building an Initramfs</title>
272 <body>
273
274 <p>
275 If you use a specific partition layout where important file system locations
276 (like <path>/usr</path> or <path>/var</path>) are on separate partitions, then
277 you will need to setup an initramfs so that this partition can be mounted before
278 it is needed.
279 </p>
280
281 <p>
282 Without an initramfs, you risk that the system will not boot up properly as the
283 tools that are responsible for mounting the file systems need information that
284 resides on those file systems. An initramfs will pull in the necessary files
285 into an archive which is used right after the kernel boots, but before the
286 control is handed over to the <c>init</c> tool. Scripts on the initramfs will
287 then make sure that the partitions are properly mounted before the system
288 continues booting.
289 </p>
290
291 <p>
292 To install an initramfs, install <c>genkernel</c> first, then have it
293 generate an initramfs for you.
294 </p>
295
296 <pre caption="Building an initramfs">
297 # <i>emerge genkernel</i>
298 # <i>genkernel --bootdir=/. --no-mountboot --install initramfs</i>
299 </pre>
300
301 <p>
302 If you need specific support in the initramfs, such as lvm or raid, add in the
303 appropriate options to genkernel. See <c>genkernel --help</c> for more
304 information, or the next example which enables support for LVM and software raid
305 (mdadm):
306 </p>
307
308 <pre caption="Building an initramfs with support for LVM and software raid">
309 # <i>genkernel --bootdir=/. --no-mountboot --lvm --mdadm --install initramfs</i>
310 </pre>
311
312 <p>
313 The initramfs will be stored in <path>/</path>. You can find the file by simply
314 listing the files starting with <path>initramfs</path>:
315 </p>
316
317 <pre caption="Checking the initramfs file name">
318 # <i>ls /initramfs*</i>
319 </pre>
320
321 <p>
322 Now continue with <uri link="#kernel_modules">Kernel Modules</uri>.
323 </p>
324
325 </body>
326 </subsection>
327 </section>
328 <section id="genkernel">
329 <title>Alternative: Using genkernel</title>
330 <body>
331
332 <p>
333 If you are reading this section, you have chosen to use our <c>genkernel</c>
334 script to configure your kernel for you.
335 </p>
336
337 <p>
338 Now that your kernel source tree is installed, it's now time to compile your
339 kernel by using our <c>genkernel</c> script to automatically build a kernel for
340 you. <c>genkernel</c> works by configuring a kernel nearly identically to the
341 way our Installation CD kernel is configured. This means that when you use
342 <c>genkernel</c> to build your kernel, your system will generally detect all
343 your hardware at boot-time, just like our Installation CD does. Because
344 genkernel doesn't require any manual kernel configuration, it is an ideal
345 solution for those users who may not be comfortable compiling their own kernels.
346 </p>
347
348 <p>
349 Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
350 </p>
351
352 <pre caption="Emerging genkernel">
353 # <i>emerge genkernel</i>
354 </pre>
355
356 <p>
357 Now, compile your kernel sources by running <c>genkernel</c>. Be aware
358 though, as <c>genkernel</c> compiles a kernel that supports almost all hardware,
359 this compilation will take quite a while to finish!
360 </p>
361
362 <note>
363 Users of LVM2 will probably want to add <c>--lvm2</c> to the genkernel
364 command-line.
365 </note>
366
367 <pre caption="Running genkernel">
368 # <i>genkernel --bootdir=/. --no-mountboot all</i>
369 </pre>
370
371 <p>
372 Once <c>genkernel</c> completes, a kernel, full set of modules and
373 <e>initial ram disk</e> (initramfs) will be created. We will use the kernel
374 and initrd when configuring a boot loader later in this document. Write
375 down the names of the kernel and initrd as you will need it when writing
376 the bootloader configuration file. The initrd will be started immediately after
377 booting to perform hardware autodetection (just like on the Installation CD)
378 before your "real" system starts up.
379 </p>
380
381 <pre caption="Checking the created kernel image name and initrd">
382 # <i>ls /kernel* /initramfs*</i>
383 </pre>
384
385 </body>
386 </section>
387 <section id="kernel_modules">
388 <title>Kernel Modules</title>
389
390 <subsection>
391 <include href="hb-install-kernelmodules.xml"/>
392 </subsection>
393
394 </section>
395 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20