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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.20 Revision 1.21
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-mips-kernel.xml,v 1.20 2006/02/27 00:55:34 fox2mike Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-mips-kernel.xml,v 1.21 2006/06/12 10:18:17 neysx Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<version>1.16</version> 11<version>1.16</version>
12<date>2006-02-27</date> 12<date>2006-02-27</date>
34<subsection> 34<subsection>
35<title>Choosing a Kernel</title> 35<title>Choosing a Kernel</title>
36<body> 36<body>
37 37
38<p> 38<p>
39The core around which all distributions are built is the Linux kernel. It is the 39The core around which all distributions are built is the Linux kernel. It is
40layer between the user programs and your system hardware. Gentoo provides its 40the layer between the user programs and your system hardware. Gentoo provides
41users several possible kernel sources. A full listing with description is 41its users several possible kernel sources. A full listing with description is
42available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel 42available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
43Guide</uri>. 43Guide</uri>.
44</p>
45
46<p> 44</p>
45
46<p>
47MIPS-based systems have just the one kernel tree to choose from, <c>mips-sources</c>. 47MIPS-based systems have just the one kernel tree to choose from,
48Special patches are needed to make certain systems work. The table below 48<c>mips-sources</c>. Special patches are needed to make certain systems work.
49displays the USE flags required to enable the patchsets. Note that Indy, 49The table below displays the USE flags required to enable the patchsets. Note
50Indigo2 (R4k) and Challenge S systems do not require any additional patchsets. 50that Indy, Indigo2 (R4k) and Challenge S systems do not require any additional
51patchsets.
51</p> 52</p>
52 53
53<table> 54<table>
54<tr> 55<tr>
55 <th>USE flag</th> 56 <th>USE flag</th>
72 <ti>SGI Octane/Octane2 support (1)</ti> 73 <ti>SGI Octane/Octane2 support (1)</ti>
73</tr> 74</tr>
74</table> 75</table>
75 76
76<note> 77<note>
77The <c>USE="-doc"</c> disables the generation of kernel API documentation, which 78The <c>USE="-doc"</c> disables the generation of kernel API documentation,
78would otherwise pull in numerous dependancies not required for this step. 79which would otherwise pull in numerous dependancies not required for this step.
79</note> 80</note>
80 81
81<pre caption="Setting USE flags and merging kernel sources..."> 82<pre caption="Setting USE flags and merging kernel sources...">
82<comment>(Substitute cobalt with the appropriate USE flag for your system if required)</comment> 83<comment>(Substitute cobalt with the appropriate USE flag for your system if required)</comment>
83# <i>mkdir /etc/portage</i> 84# <i>mkdir /etc/portage</i>
87# <i>USE="-doc" emerge mips-sources</i> 88# <i>USE="-doc" emerge mips-sources</i>
88</pre> 89</pre>
89 90
90<impo> 91<impo>
91(1) On the Origin 200/2000, Indigo2 Impact (R10000), Octane/Octane2 and O2, a 92(1) On the Origin 200/2000, Indigo2 Impact (R10000), Octane/Octane2 and O2, a
9264-bit kernel is required to boot these systems. For these machines, you should 9364-bit kernel is required to boot these systems. For these machines, you should
93switch to the <path>default-linux/mips/mips64/RELEASE</path> 94switch to the <path>default-linux/mips/mips64/RELEASE</path> profile by
94profile by altering the <path>/etc/make.profile</path> symlink. Then you can 95altering the <path>/etc/make.profile</path> symlink. Then you can <c>emerge
95<c>emerge gcc-mips64</c> to create a cross-compiler for building 64-bit kernels. 96gcc-mips64</c> to create a cross-compiler for building 64-bit kernels.
96</impo> 97</impo>
97 98
98<impo> 99<impo>
99(2) The Indigo2 Impact is a special case in that it requires special patch to 100(2) The Indigo2 Impact is a special case in that it requires special patch to
100be applied to <c>gcc</c> before it will build an IP28 kernel correctly. This 101be applied to <c>gcc</c> before it will build an IP28 kernel correctly. This
101patch adds support for the <c>-mip28-cache-barriers</c> CFLAG, which is used 102patch adds support for the <c>-mip28-cache-barriers</c> CFLAG, which is used
102when building kernels to work around the inherent hardware bug brought on by 103when building kernels to work around the inherent hardware bug brought on by
103speculative execution. This USE flag can be set in 104speculative execution. This USE flag can be set in <path>/etc/make.conf</path>.
104<path>/etc/make.conf</path>. This is done for you by setting your profile to 105This is done for you by setting your profile to
105<path>default-linux/mips/mips64/ip28/RELEASE</path>, which also 106<path>default-linux/mips/mips64/ip28/RELEASE</path>, which also takes care of
106takes care of (1). 107(1).
107</impo> 108</impo>
108 109
109<pre caption="Changing Profiles and installing gcc-mips64..."> 110<pre caption="Changing Profiles and installing gcc-mips64...">
110<comment>(This assumes PORTDIR is in the usual location; /usr/portage)</comment> 111<comment>(This assumes PORTDIR is in the usual location; /usr/portage)</comment>
111# <i>rm /etc/make.profile</i> 112# <i>rm /etc/make.profile</i>
126# <i>ls -l /usr/src/linux</i> 127# <i>ls -l /usr/src/linux</i>
127lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-2.6.13.4 128lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-2.6.13.4
128</pre> 129</pre>
129 130
130<p> 131<p>
131If this isn't the case (i.e. the symlink points to a different kernel source) 132If this isn't the case (i.e. the symlink points to a different kernel source)
132change the symlink before you continue: 133change the symlink before you continue:
133</p> 134</p>
134 135
135<pre caption="Changing the kernel source symlink"> 136<pre caption="Changing the kernel source symlink">
136# <i>rm /usr/src/linux</i> 137# <i>rm /usr/src/linux</i>
137# <i>cd /usr/src</i> 138# <i>cd /usr/src</i>
138# <i>ln -s linux-2.6.13.4 linux</i> 139# <i>ln -s linux-2.6.13.4 linux</i>
139</pre> 140</pre>
140 141
141<p> 142<p>
142Now it is time to configure and compile your kernel source. 143Now it is time to configure and compile your kernel source.
143</p> 144</p>
144 145
145</body> 146</body>
146</subsection> 147</subsection>
147</section> 148</section>
150<subsection> 151<subsection>
151<title>Introduction</title> 152<title>Introduction</title>
152<body> 153<body>
153 154
154<p> 155<p>
155Previously, we went through the manual configuration of how to set up the kernel 156Previously, we went through the manual configuration of how to set up the
156sources. This has become impractical with the number of systems we now support. 157kernel sources. This has become impractical with the number of systems we now
157This section details various sources for sample kernel configurations. 158support. This section details various sources for sample kernel configurations.
158</p> 159</p>
159 160
160</body> 161</body>
161</subsection> 162</subsection>
162<subsection> 163<subsection>
163<title>Using sample configurations in the kernel source</title> 164<title>Using sample configurations in the kernel source</title>
164<body> 165<body>
165 166
166<p> 167<p>
167Many of the systems supported have sample .configs hiding in amongst the kernel 168Many of the systems supported have sample .configs hiding in amongst the kernel
168source. Not all systems have configs distributed in this way. Those that do, 169source. Not all systems have configs distributed in this way. Those that do,
169can be configured using the commands mentioned in the table below. 170can be configured using the commands mentioned in the table below.
170</p> 171</p>
171 172
172<table> 173<table>
173<tr> 174<tr>
187 <ti><c>make ip27_defconfig</c></ti> 188 <ti><c>make ip27_defconfig</c></ti>
188</tr> 189</tr>
189<tr> 190<tr>
190 <ti>Indigo2 Impact (R10k)</ti> 191 <ti>Indigo2 Impact (R10k)</ti>
191 <ti> 192 <ti>
192 <c>make ip28_defconfig</c> (requires <c>mips-sources-2.6.14.5</c> or 193 <c>make ip28_defconfig</c> (requires <c>mips-sources-2.6.14.5</c> or later)
193 later)
194 </ti> 194 </ti>
195</tr> 195</tr>
196<tr> 196<tr>
197 <ti>O2</ti> 197 <ti>O2</ti>
198 <ti><c>make ip32_defconfig</c></ti> 198 <ti><c>make ip32_defconfig</c></ti>
206<title>Using the running kernel config from the installation media</title> 206<title>Using the running kernel config from the installation media</title>
207<body> 207<body>
208 208
209<p> 209<p>
210All of the Gentoo installation images provide a kernel config option as part of 210All of the Gentoo installation images provide a kernel config option as part of
211the image itself, accessible as <path>/proc/config.gz</path>. This may be used 211the image itself, accessible as <path>/proc/config.gz</path>. This may be used
212in many cases. It is best though if your kernel source matches closely, the 212in many cases. It is best though if your kernel source matches closely, the
213kernel that is currently running. To extract it, simply run it through 213kernel that is currently running. To extract it, simply run it through
214<c>zcat</c> as shown below. 214<c>zcat</c> as shown below.
215</p> 215</p>
216 216
217<pre caption="Extracting .config from /proc/config.gz"> 217<pre caption="Extracting .config from /proc/config.gz">
218# <i>zcat /proc/config.gz > .config</i> 218# <i>zcat /proc/config.gz > .config</i>
219</pre> 219</pre>
220 220
221<impo> 221<impo>
222This kernel config is set up for a netboot image. That 222This kernel config is set up for a netboot image. That is, it will expect to
223is, it will expect to find a root filesystem image somewhere nearby, either as a 223find a root filesystem image somewhere nearby, either as a directory for
224directory for initramfs, or a loopback device for initrd. When you run <c>make 224initramfs, or a loopback device for initrd. When you run <c>make menuconfig</c>
225menuconfig</c> below, don't forget to go into General Setup and disable the 225below, don't forget to go into General Setup and disable the options for
226options for initramfs. 226initramfs.
227</impo> 227</impo>
228 228
229</body> 229</body>
230</subsection> 230</subsection>
231 231
233<title>The Hardware Compatability Database</title> 233<title>The Hardware Compatability Database</title>
234<body> 234<body>
235 235
236<p> 236<p>
237As an aid to users in finding working settings, a hardware compatability 237As an aid to users in finding working settings, a hardware compatability
238database was set up. This database lists the support for various MIPS devices, 238database was set up. This database lists the support for various MIPS devices,
239and allows users to contribute kernel configurations that are known to work. 239and allows users to contribute kernel configurations that are known to work.
240The address for this site is 240The address for this site is
241<uri>http://stuartl.longlandclan.hopto.org/gentoo/mips</uri>. 241<uri>http://stuartl.longlandclan.hopto.org/gentoo/mips</uri>.
242</p> 242</p>
243 243
244<p> 244<p>
245If you find this service useful, you're welcome to contribute your notes and 245If you find this service useful, you're welcome to contribute your notes and
246.config files so that others may benefit from your experience. It should be 246.config files so that others may benefit from your experience. It should be
247noted however that there is no guarantee that any of the configuration files 247noted however that there is no guarantee that any of the configuration files
248downloaded from this site will work. 248downloaded from this site will work.
249</p> 249</p>
250 250
251</body> 251</body>
252</subsection> 252</subsection>
253 253
254<subsection> 254<subsection>
255<title>Customising the configuration for your needs.</title> 255<title>Customising the configuration for your needs</title>
256<body> 256<body>
257 257
258<p> 258<p>
259Once you have found a configuration, download it into your kernel source 259Once you have found a configuration, download it into your kernel source
260directory, and rename it to <path>.config</path>. From there, you can run 260directory, and rename it to <path>.config</path>. From there, you can run
261<c>make oldconfig</c> to bring everything up to date, and allow you to customise 261<c>make oldconfig</c> to bring everything up to date, and allow you to
262the configuration before compiling. 262customise the configuration before compiling.
263</p> 263</p>
264 264
265<pre caption="Configuring the kernel"> 265<pre caption="Configuring the kernel">
266# <i>cd /usr/src/linux</i> 266# <i>cd /usr/src/linux</i>
267# <i>cp /path/to/example-config .config</i> 267# <i>cp /path/to/example-config .config</i>
270# <i>make menuconfig</i> 270# <i>make menuconfig</i>
271</pre> 271</pre>
272 272
273<impo> 273<impo>
274In the Kernel Hacking section, there is an option named "Are You Using A Cross 274In the Kernel Hacking section, there is an option named "Are You Using A Cross
275Compiler?". This tells the kernel Makefiles to prepend "<c>mips-linux-</c>" (or 275Compiler?". This tells the kernel Makefiles to prepend "<c>mips-linux-</c>" (or
276<c>mipsel-linux</c> ... etc) to <c>gcc</c> and <c>as</c> commands when compiling 276<c>mipsel-linux</c> ... etc) to <c>gcc</c> and <c>as</c> commands when
277the kernel. This should be turned off, even if cross-compiling. Instead, if 277compiling the kernel. This should be turned off, even if cross-compiling.
278you do need to call a cross-compiler, specify the prefix using the 278Instead, if you do need to call a cross-compiler, specify the prefix using the
279<c>CROSS_COMPILE</c> variable as shown in the next section. 279<c>CROSS_COMPILE</c> variable as shown in the next section.
280</impo> 280</impo>
281 281
282</body> 282</body>
283</subsection> 283</subsection>
284<subsection id="compiling"> 284<subsection id="compiling">
285<title>Compiling and Installing</title> 285<title>Compiling and Installing</title>
286<body> 286<body>
287 287
288<p> 288<p>
289Now that your kernel is configured, it is time to compile and install it. Exit 289Now that your kernel is configured, it is time to compile and install it. Exit
290the configuration and start the compilation process: 290the configuration and start the compilation process:
291</p> 291</p>
292 292
293<note> 293<note>
294On 64-bit machines, you need to specify 294On 64-bit machines, you need to specify
295<c>CROSS_COMPILE=mips64-unknown-linux-gnu-</c> (or <c>mips64el-...</c> if on 295<c>CROSS_COMPILE=mips64-unknown-linux-gnu-</c> (or <c>mips64el-...</c> if on a
296a little-endian system) to use the 64-bit compiler. 296little-endian system) to use the 64-bit compiler.
297</note> 297</note>
298 298
299<pre caption="Compiling the kernel"> 299<pre caption="Compiling the kernel">
300<comment>(For 2.4 kernel only)</comment> 300<comment>(For 2.4 kernel only)</comment>
301# <i>make dep</i> 301# <i>make dep</i>
314# <i>make modules_install INSTALL_MOD_PATH=/somewhere</i> 314# <i>make modules_install INSTALL_MOD_PATH=/somewhere</i>
315</pre> 315</pre>
316 316
317<impo> 317<impo>
318When compiling a 64-bit kernel for the Indy, Indigo2 (R4k), Challenge S and O2, 318When compiling a 64-bit kernel for the Indy, Indigo2 (R4k), Challenge S and O2,
319use the <c>vmlinux.32</c> target instead of <c>vmlinux</c>. Otherwise, your 319use the <c>vmlinux.32</c> target instead of <c>vmlinux</c>. Otherwise, your
320machine will not be able to boot. This is to work around the PROM not 320machine will not be able to boot. This is to work around the PROM not
321understanding the ELF64 format. 321understanding the ELF64 format.
322</impo> 322</impo>
323 323
324<pre caption="Using the vmlinux.32 target"> 324<pre caption="Using the vmlinux.32 target">
325# <i>make vmlinux.32</i> 325# <i>make vmlinux.32</i>
360<subsection> 360<subsection>
361<title>Configuring the Modules</title> 361<title>Configuring the Modules</title>
362<body> 362<body>
363 363
364<p> 364<p>
365You should list the modules you want automatically loaded in one of the relevant 365You should list the modules you want automatically loaded in one of the
366files listed below. You can add extra options to the modules too if you want. 366relevant files listed below. You can add extra options to the modules too if
367you want.
367</p> 368</p>
368 369
369<ul> 370<ul>
370 <li><path>/etc/modules.autoload.d/kernel-2.4</path> - Kernel 2.4 only</li> 371 <li><path>/etc/modules.autoload.d/kernel-2.4</path> - Kernel 2.4 only</li>
371 <li><path>/etc/modules.autoload.d/kernel-2.6</path> - Kernel 2.6 only</li> 372 <li><path>/etc/modules.autoload.d/kernel-2.6</path> - Kernel 2.6 only</li>
378Otherwise it can be placed in the appropriate file. 379Otherwise it can be placed in the appropriate file.
379</p> 380</p>
380 381
381<p> 382<p>
382To view all available modules, run the following <c>find</c> command. Don't 383To view all available modules, run the following <c>find</c> command. Don't
383forget to substitute "&lt;kernel version&gt;" with the version of the kernel you 384forget to substitute "&lt;kernel version&gt;" with the version of the kernel
384just compiled: 385you just compiled:
385</p> 386</p>
386 387
387<pre caption="Viewing all available modules"> 388<pre caption="Viewing all available modules">
388# <i>find /lib/modules/&lt;kernel version&gt;/ -type f -iname '*.o' -or -iname '*.ko'</i> 389# <i>find /lib/modules/&lt;kernel version&gt;/ -type f -iname '*.o' -or -iname '*.ko'</i>
389</pre> 390</pre>
409# <i>echo '3c59x' >> /etc/modules.autoload.d/kernel-2.4</i> 410# <i>echo '3c59x' >> /etc/modules.autoload.d/kernel-2.4</i>
410<comment>(or kernel-2.6, or /etc/modules.autoload...)</comment> 411<comment>(or kernel-2.6, or /etc/modules.autoload...)</comment>
411</pre> 412</pre>
412 413
413<p> 414<p>
414Continue the installation with <uri link="?part=1&amp;chap=8">Configuring 415Continue the installation with <uri link="?part=1&amp;chap=8">Configuring your
415your System</uri>. 416System</uri>.
416</p> 417</p>
417 418
418</body> 419</body>
419</subsection> 420</subsection>
420</section> 421</section>

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.20