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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.33 - (show annotations) (download) (as text)
Wed Feb 22 21:27:45 2012 UTC (2 years, 4 months ago) by swift
Branch: MAIN
Changes since 1.32: +7 -5 lines
File MIME type: application/xml
Fix bug #405271 (thanks to Ogelpre) to update /etc/timezone wherever we say to update /etc/localtime as it is /etc/timezone that is the master, read by timezone-data to update localtime

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-mips-kernel.xml,v 1.32 2010/07/27 22:54:33 nightmorph Exp $ -->
8 <sections>
9
10 <abstract>
11 The Linux kernel is the core of every distribution. This chapter
12 explains how to configure your kernel.
13 </abstract>
14
15 <version>11</version>
16 <date>2012-02-22</date>
17
18 <section>
19 <title>Timezone</title>
20 <body>
21
22 <p>
23 You first need to select your timezone so that your system knows where it is
24 located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then copy
25 it to <path>/etc/localtime</path>. Please avoid the
26 <path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not
27 indicate the expected zones. For instance, <path>GMT-8</path> is in fact
28 GMT+8.
29 </p>
30
31 <pre caption="Setting the timezone information">
32 # <i>ls /usr/share/zoneinfo</i>
33 <comment>(Suppose you want to use Europe/Brussels)</comment>
34 # <i>cp /usr/share/zoneinfo/Europe/Brussels /etc/localtime</i>
35 <comment>(Next set the timezone)</comment>
36 # <i>echo "Europe/Brussels" &gt; /etc/timezone</i>
37 </pre>
38
39 </body>
40 </section>
41
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
50 the layer between the user programs and your system hardware. Gentoo provides
51 its 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 Guide</uri>.
54 </p>
55
56 <p>
57 MIPS-based systems have just the one kernel tree to choose from,
58 <c>mips-sources</c>. This patchset differs from the ones available for other
59 architectures, in that it has lots of patches specific to the MIPS
60 architecture.
61 </p>
62
63 <pre caption="Merging kernel sources...">
64 # <i>emerge mips-sources</i>
65 </pre>
66
67 <impo>
68 On the Origin 200/2000, Indigo2 Impact (R10000), Octane/Octane2 and O2, a 64-bit
69 kernel is required to boot these systems. For these machines, you should
70 <c>emerge kgcc64</c> to create a cross-compiler for building 64-bit kernels.
71 </impo>
72
73 <pre caption="Installing kgcc64">
74 # <i>emerge kgcc64</i>
75 </pre>
76
77 <p>
78 When you take a look in <path>/usr/src</path> you should see a symlink called
79 <path>linux</path> pointing to your kernel source. In this case, the installed
80 kernel source points to <c>mips-sources-<keyval id="kernel-version"/></c>. Your
81 version may be different, so keep this in mind.
82 </p>
83
84 <pre caption="Viewing the kernel source symlink">
85 # <i>ls -l /usr/src/linux</i>
86 lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-<keyval id="kernel-version"/>
87 </pre>
88
89 <p>
90 Now it is time to configure and compile your kernel source.
91 </p>
92
93 </body>
94 </subsection>
95 </section>
96 <section>
97 <title>Kernel Compilation &amp; Installation</title>
98 <subsection>
99 <title>Introduction</title>
100 <body>
101
102 <p>
103 Previously, we went through the manual configuration of how to set up the
104 kernel sources. This has become impractical with the number of systems we now
105 support. This section details various sources for sample kernel configurations.
106 </p>
107
108 </body>
109 </subsection>
110 <subsection>
111 <title>Using sample configurations in the kernel source</title>
112 <body>
113
114 <p>
115 Many of the systems supported have sample .configs hiding in amongst the kernel
116 source. Not all systems have configs distributed in this way. Those that do,
117 can be configured using the commands mentioned in the table below.
118 </p>
119
120 <table>
121 <tr>
122 <th>System</th>
123 <th>Configure command</th>
124 </tr>
125 <tr>
126 <ti>Cobalt Servers</ti>
127 <ti><c>make cobalt_defconfig</c></ti>
128 </tr>
129 <tr>
130 <ti>Indy, Indigo2 (R4k), Challenge S</ti>
131 <ti><c>make ip22_defconfig</c></ti>
132 </tr>
133 <tr>
134 <ti>Origin 200/2000</ti>
135 <ti><c>make ip27_defconfig</c></ti>
136 </tr>
137 <tr>
138 <ti>Indigo2 Impact (R10k)</ti>
139 <ti>
140 <c>make ip28_defconfig</c>
141 </ti>
142 </tr>
143 <tr>
144 <ti>O2</ti>
145 <ti><c>make ip32_defconfig</c></ti>
146 </tr>
147 </table>
148
149 </body>
150 </subsection>
151
152 <subsection>
153 <title>Using the running kernel config from the installation media</title>
154 <body>
155
156 <p>
157 All of the Gentoo installation images provide a kernel config option as part of
158 the image itself, accessible as <path>/proc/config.gz</path>. This may be used
159 in many cases. It is best though if your kernel source matches closely, the
160 kernel that is currently running. To extract it, simply run it through
161 <c>zcat</c> as shown below.
162 </p>
163
164 <pre caption="Extracting .config from /proc/config.gz">
165 # <i>zcat /proc/config.gz > .config</i>
166 </pre>
167
168 <impo>
169 This kernel config is set up for a netboot image. That is, it will expect to
170 find a root filesystem image somewhere nearby, either as a directory for
171 initramfs, or a loopback device for initrd. When you run <c>make menuconfig</c>
172 below, don't forget to go into General Setup and disable the options for
173 initramfs.
174 </impo>
175
176 </body>
177 </subsection>
178
179 <subsection>
180 <title>The Hardware Compatability Database</title>
181 <body>
182
183 <p>
184 As an aid to users in finding working settings, a hardware compatability
185 database was set up. This database lists the support for various MIPS devices,
186 and allows users to contribute kernel configurations that are known to work.
187 The address for this site is
188 <uri>http://stuartl.longlandclan.hopto.org/gentoo/mips</uri>.
189 </p>
190
191 <p>
192 If you find this service useful, you're welcome to contribute your notes and
193 .config files so that others may benefit from your experience. It should be
194 noted however that there is no guarantee that any of the configuration files
195 downloaded from this site will work.
196 </p>
197
198 </body>
199 </subsection>
200
201 <subsection>
202 <title>Customising the configuration for your needs</title>
203 <body>
204
205 <p>
206 Once you have found a configuration, download it into your kernel source
207 directory, and rename it to <path>.config</path>. From there, you can run
208 <c>make oldconfig</c> to bring everything up to date, and allow you to
209 customise the configuration before compiling.
210 </p>
211
212 <pre caption="Configuring the kernel">
213 # <i>cd /usr/src/linux</i>
214 # <i>cp /path/to/example-config .config</i>
215 # <i>make oldconfig</i>
216 <comment>(Just press ENTER at each prompt to accept the defaults... we'll customise later)</comment>
217 # <i>make menuconfig</i>
218 </pre>
219
220 <impo>
221 In the Kernel Hacking section, there is an option named "Are You Using A Cross
222 Compiler?". This tells the kernel Makefiles to prepend "<c>mips-linux-</c>" (or
223 <c>mipsel-linux</c> ... etc) to <c>gcc</c> and <c>as</c> commands when
224 compiling the kernel. This should be turned off, even if cross-compiling.
225 Instead, if you do need to call a cross-compiler, specify the prefix using the
226 <c>CROSS_COMPILE</c> variable as shown in the next section.
227 </impo>
228
229 <impo>
230 There is a known issue with JFS and ALSA on Octane systems where the ALSA fails
231 to work. Given the experimental nature of JFS on MIPS, it is recommended that
232 people avoid using JFS for the time being.
233 </impo>
234
235 </body>
236 </subsection>
237 <subsection id="compiling">
238 <title>Compiling and Installing</title>
239 <body>
240
241 <p>
242 Now that your kernel is configured, it is time to compile and install it. Exit
243 the configuration and start the compilation process:
244 </p>
245
246 <note>
247 On 64-bit machines, you need to specify
248 <c>CROSS_COMPILE=mips64-unknown-linux-gnu-</c> (or <c>mips64el-...</c> if on a
249 little-endian system) to use the 64-bit compiler.
250 </note>
251
252 <pre caption="Compiling the kernel">
253 <comment>(Compiling natively)</comment>
254 # <i>make vmlinux modules modules_install</i>
255
256 <comment>(Cross-compiling on target machine)</comment>
257 <comment>(Adjust the mips64-unknown-linux-gnu- accordingly)</comment>
258 # <i>make vmlinux modules modules_install CROSS_COMPILE=mips64-unknown-linux-gnu-</i>
259
260 <comment>(When compiling on another machine, such as an x86 box, use the)</comment>
261 <comment>(following commands to compile the kernel &amp; install modules into)</comment>
262 <comment>(a specific directory to be transferred to the target machine.)</comment>
263 # <i>make vmlinux modules CROSS_COMPILE=mips64-unknown-linux-gnu-</i>
264 # <i>make modules_install INSTALL_MOD_PATH=/somewhere</i>
265 </pre>
266
267 <impo>
268 When compiling a 64-bit kernel for the Indy, Indigo2 (R4k), Challenge S and O2,
269 use the <c>vmlinux.32</c> target instead of <c>vmlinux</c>. Otherwise, your
270 machine will not be able to boot. This is to work around the PROM not
271 understanding the ELF64 format.
272 </impo>
273
274 <pre caption="Using the vmlinux.32 target">
275 # <i>make vmlinux.32</i>
276 <comment>(This will create vmlinux.32 -- which is your final kernel)</comment>
277 </pre>
278
279 <p>
280 When the kernel has finished compiling, copy the kernel image to
281 <path>/boot</path>.
282 </p>
283
284 <note>
285 On Cobalt servers, the bootloader will expect to see a compressed kernel image.
286 Remember to <c>gzip -9</c> the file once it is in <path>/boot</path>.
287 </note>
288
289 <pre caption="Installing the kernel">
290 # <i>cp vmlinux /boot/kernel-<keyval id="kernel-version"/></i>
291
292 <comment>(Cobalt Servers -- Compressing the kernel image)</comment>
293 # <i>gzip -9v /boot/kernel-<keyval id="kernel-version"/></i>
294 </pre>
295
296 </body>
297 </subsection>
298 </section>
299 <section id="kernel_modules">
300 <title>Kernel Modules</title>
301
302 <subsection>
303 <include href="hb-install-kernelmodules.xml"/>
304 </subsection>
305
306 </section>
307 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20