/[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 - (hide annotations) (download) (as text)
Wed Feb 22 21:27:45 2012 UTC (2 years, 9 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 swift 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 neysx 1.16 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 swift 1.1
7 swift 1.33 <!-- $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 swift 1.1 <sections>
9 swift 1.7
10 nightmorph 1.32 <abstract>
11     The Linux kernel is the core of every distribution. This chapter
12     explains how to configure your kernel.
13     </abstract>
14    
15 swift 1.33 <version>11</version>
16     <date>2012-02-22</date>
17 swift 1.7
18 swift 1.1 <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 neysx 1.25 located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then copy
25     it to <path>/etc/localtime</path>. Please avoid the
26 neysx 1.16 <path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not
27 neysx 1.25 indicate the expected zones. For instance, <path>GMT-8</path> is in fact
28     GMT+8.
29 swift 1.1 </p>
30    
31 nightmorph 1.24 <pre caption="Setting the timezone information">
32     # <i>ls /usr/share/zoneinfo</i>
33 swift 1.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 swift 1.1 </pre>
38    
39     </body>
40     </section>
41 nightmorph 1.22
42 swift 1.1 <section>
43     <title>Installing the Sources</title>
44     <subsection>
45     <title>Choosing a Kernel</title>
46     <body>
47    
48     <p>
49 neysx 1.21 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 swift 1.1 available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
53 neysx 1.21 Guide</uri>.
54 swift 1.1 </p>
55    
56     <p>
57 neysx 1.21 MIPS-based systems have just the one kernel tree to choose from,
58 nightmorph 1.24 <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 swift 1.1 </p>
62    
63 nightmorph 1.22 <pre caption="Merging kernel sources...">
64 nightmorph 1.23 # <i>emerge mips-sources</i>
65 fox2mike 1.20 </pre>
66    
67     <impo>
68 nightmorph 1.24 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 fox2mike 1.20 </impo>
72    
73 nightmorph 1.32 <pre caption="Installing kgcc64">
74 nightmorph 1.24 # <i>emerge kgcc64</i>
75 swift 1.1 </pre>
76    
77     <p>
78     When you take a look in <path>/usr/src</path> you should see a symlink called
79 neysx 1.19 <path>linux</path> pointing to your kernel source. In this case, the installed
80 nightmorph 1.24 kernel source points to <c>mips-sources-<keyval id="kernel-version"/></c>. Your
81     version may be different, so keep this in mind.
82 swift 1.1 </p>
83    
84     <pre caption="Viewing the kernel source symlink">
85     # <i>ls -l /usr/src/linux</i>
86 nightmorph 1.24 lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-<keyval id="kernel-version"/>
87 swift 1.1 </pre>
88    
89     <p>
90 neysx 1.21 Now it is time to configure and compile your kernel source.
91 swift 1.1 </p>
92    
93     </body>
94     </subsection>
95     </section>
96     <section>
97 swift 1.11 <title>Kernel Compilation &amp; Installation</title>
98 swift 1.1 <subsection>
99     <title>Introduction</title>
100     <body>
101    
102     <p>
103 neysx 1.21 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 fox2mike 1.20 </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 neysx 1.21 source. Not all systems have configs distributed in this way. Those that do,
117 fox2mike 1.20 can be configured using the commands mentioned in the table below.
118 swift 1.11 </p>
119    
120     <table>
121 fox2mike 1.20 <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 nightmorph 1.24 <c>make ip28_defconfig</c>
141 fox2mike 1.20 </ti>
142     </tr>
143     <tr>
144     <ti>O2</ti>
145     <ti><c>make ip32_defconfig</c></ti>
146     </tr>
147 swift 1.11 </table>
148    
149 fox2mike 1.20 </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 neysx 1.21 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 fox2mike 1.20 <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 neysx 1.21 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 fox2mike 1.20 </impo>
175    
176     </body>
177     </subsection>
178    
179     <subsection>
180     <title>The Hardware Compatability Database</title>
181     <body>
182 swift 1.11
183 fox2mike 1.20 <p>
184     As an aid to users in finding working settings, a hardware compatability
185 neysx 1.21 database was set up. This database lists the support for various MIPS devices,
186 fox2mike 1.20 and allows users to contribute kernel configurations that are known to work.
187     The address for this site is
188 swift 1.14 <uri>http://stuartl.longlandclan.hopto.org/gentoo/mips</uri>.
189 fox2mike 1.20 </p>
190    
191     <p>
192     If you find this service useful, you're welcome to contribute your notes and
193 neysx 1.21 .config files so that others may benefit from your experience. It should be
194 fox2mike 1.20 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 neysx 1.21 <title>Customising the configuration for your needs</title>
203 fox2mike 1.20 <body>
204 swift 1.14
205 swift 1.11 <p>
206     Once you have found a configuration, download it into your kernel source
207 neysx 1.21 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 swift 1.1 </p>
211    
212 swift 1.11 <pre caption="Configuring the kernel">
213 swift 1.1 # <i>cd /usr/src/linux</i>
214 swift 1.11 # <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 swift 1.1 # <i>make menuconfig</i>
218     </pre>
219    
220 fox2mike 1.20 <impo>
221     In the Kernel Hacking section, there is an option named "Are You Using A Cross
222 neysx 1.21 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 fox2mike 1.20 <c>CROSS_COMPILE</c> variable as shown in the next section.
227     </impo>
228    
229 nightmorph 1.22 <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 swift 1.1 </body>
236     </subsection>
237     <subsection id="compiling">
238     <title>Compiling and Installing</title>
239     <body>
240    
241     <p>
242 neysx 1.21 Now that your kernel is configured, it is time to compile and install it. Exit
243 swift 1.13 the configuration and start the compilation process:
244 swift 1.1 </p>
245    
246 fox2mike 1.20 <note>
247     On 64-bit machines, you need to specify
248 neysx 1.21 <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 fox2mike 1.20 </note>
251    
252 swift 1.1 <pre caption="Compiling the kernel">
253 nightmorph 1.24 <comment>(Compiling natively)</comment>
254 fox2mike 1.20 # <i>make vmlinux modules modules_install</i>
255 swift 1.1
256 nightmorph 1.24 <comment>(Cross-compiling on target machine)</comment>
257     <comment>(Adjust the mips64-unknown-linux-gnu- accordingly)</comment>
258 fox2mike 1.20 # <i>make vmlinux modules modules_install CROSS_COMPILE=mips64-unknown-linux-gnu-</i>
259    
260 nightmorph 1.24 <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 fox2mike 1.20 # <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 neysx 1.21 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 fox2mike 1.20 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 swift 1.1 </pre>
278    
279     <p>
280 neysx 1.5 When the kernel has finished compiling, copy the kernel image to
281 swift 1.1 <path>/boot</path>.
282     </p>
283    
284 swift 1.14 <note>
285 neysx 1.19 On Cobalt servers, the bootloader will expect to see a compressed kernel image.
286 fox2mike 1.20 Remember to <c>gzip -9</c> the file once it is in <path>/boot</path>.
287 swift 1.14 </note>
288    
289 swift 1.1 <pre caption="Installing the kernel">
290 nightmorph 1.24 # <i>cp vmlinux /boot/kernel-<keyval id="kernel-version"/></i>
291 fox2mike 1.20
292 swift 1.14 <comment>(Cobalt Servers -- Compressing the kernel image)</comment>
293 nightmorph 1.24 # <i>gzip -9v /boot/kernel-<keyval id="kernel-version"/></i>
294 swift 1.1 </pre>
295    
296     </body>
297     </subsection>
298     </section>
299     <section id="kernel_modules">
300 nightmorph 1.31 <title>Kernel Modules</title>
301    
302 swift 1.1 <subsection>
303 nightmorph 1.31 <include href="hb-install-kernelmodules.xml"/>
304     </subsection>
305 swift 1.1
306     </section>
307     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20