/[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.19 Revision 1.20
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.19 2006/01/08 14:05:29 neysx Exp $ --> 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 $ -->
8 8
9<sections> 9<sections>
10 10
11<version>1.15</version> 11<version>1.16</version>
12<date>2006-01-06</date> 12<date>2006-02-27</date>
13 13
14<section> 14<section>
15<title>Timezone</title> 15<title>Timezone</title>
16<body> 16<body>
17 17
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> 44</p>
45 45
46<p> 46<p>
47MIPS-based systems can choose from <c>mips-sources</c> (the default kernel 47MIPS-based systems have just the one kernel tree to choose from, <c>mips-sources</c>.
48source for the MIPS architecture) and <c>mips-prepatch-sources</c> (prerelease 48Special patches are needed to make certain systems work. The table below
49kernel tree). 49displays the USE flags required to enable the patchsets. Note that Indy,
50</p> 50Indigo2 (R4k) and Challenge S systems do not require any additional patchsets.
51
52<p> 51</p>
53Choose your kernel source and install it using <c>emerge</c>. Of course 52
54substitute with your choice of sources, this is merely an example. The 53<table>
55<c>USE="-doc"</c> is necessary to avoid installing xorg-x11 or other 54<tr>
56dependencies at this point. <c>USE="symlink"</c> is not necessary for a new 55 <th>USE flag</th>
57install, but ensures proper creation of the <path>/usr/src/linux</path> 56 <th>System</th>
58symlink. 57</tr>
59</p> 58<tr>
59 <ti><c>cobalt</c></ti>
60 <ti>Cobalt Qube/RaQ support</ti>
61</tr>
62<tr>
63 <ti><c>ip27</c></ti>
64 <ti>SGI Origin 200/2000 support (1)</ti>
65</tr>
66<tr>
67 <ti><c>ip28</c></ti>
68 <ti>SGI Indigo2 Impact (R10000) support (1,2)</ti>
69</tr>
70<tr>
71 <ti><c>ip30</c></ti>
72 <ti>SGI Octane/Octane2 support (1)</ti>
73</tr>
74</table>
60 75
61<note> 76<note>
62Special patches are needed to make a kernel work on Cobalt servers. The 77The <c>USE="-doc"</c> disables the generation of kernel API documentation, which
63<c>cobalt</c> USE flag must be defined in order to grab the necessary patches 78would otherwise pull in numerous dependancies not required for this step.
64and apply them.
65</note> 79</note>
66 80
67<pre caption="Installing a kernel source"> 81<pre caption="Setting USE flags and merging kernel sources...">
68<comment>(For SGI machines)</comment> 82<comment>(Substitute cobalt with the appropriate USE flag for your system if required)</comment>
69# <i>USE="-doc symlink" emerge mips-sources</i>
70
71<comment>(For Cobalt machines)</comment>
72# <i>mkdir -p /etc/portage</i> 83# <i>mkdir /etc/portage</i>
73# <i>echo "sys-kernel/mips-sources cobalt" &gt;&gt; /etc/portage/package.use</i> 84# <i>echo "sys-kernel/mips-sources cobalt" &gt;&gt; /etc/portage/package.use</i>
85
86<comment>(Unpack &amp; install the kernel sources)</comment>
74# <i>USE="-doc symlink" emerge mips-sources</i> 87# <i>USE="-doc" emerge mips-sources</i>
88</pre>
89
90<impo>
91(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
93switch to the <path>default-linux/mips/mips64/RELEASE</path>
94profile by altering the <path>/etc/make.profile</path> symlink. Then you can
95<c>emerge gcc-mips64</c> to create a cross-compiler for building 64-bit kernels.
96</impo>
97
98<impo>
99(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
101patch 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
103speculative execution. This USE flag can be set in
104<path>/etc/make.conf</path>. This is done for you by setting your profile to
105<path>default-linux/mips/mips64/ip28/RELEASE</path>, which also
106takes care of (1).
107</impo>
108
109<pre caption="Changing Profiles and installing gcc-mips64...">
110<comment>(This assumes PORTDIR is in the usual location; /usr/portage)</comment>
111# <i>rm /etc/make.profile</i>
112# <i>ln -s /usr/portage/profiles/default-linux/mips/mips64/2005.0</i> <comment>(or .../mips64/ip28/2005.0)</comment>
113
114<comment>(Install the 64-bit kernel toolchain)</comment>
115# <i>emerge gcc-mips64</i>
75</pre> 116</pre>
76 117
77<p> 118<p>
78When you take a look in <path>/usr/src</path> you should see a symlink called 119When 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 120<path>linux</path> pointing to your kernel source. In this case, the installed
81different, so keep this in mind. 122different, so keep this in mind.
82</p> 123</p>
83 124
84<pre caption="Viewing the kernel source symlink"> 125<pre caption="Viewing the kernel source symlink">
85# <i>ls -l /usr/src/linux</i> 126# <i>ls -l /usr/src/linux</i>
86lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-2.4.24 127lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-2.6.13.4
128</pre>
129
130<p>
131If this isn't the case (i.e. the symlink points to a different kernel source)
132change the symlink before you continue:
133</p>
134
135<pre caption="Changing the kernel source symlink">
136# <i>rm /usr/src/linux</i>
137# <i>cd /usr/src</i>
138# <i>ln -s linux-2.6.13.4 linux</i>
87</pre> 139</pre>
88 140
89<p> 141<p>
90Now it is time to configure and compile your kernel source. 142Now it is time to configure and compile your kernel source.
91</p> 143</p>
99<title>Introduction</title> 151<title>Introduction</title>
100<body> 152<body>
101 153
102<p> 154<p>
103Previously, we went through the manual configuration of how to set up the kernel 155Previously, we went through the manual configuration of how to set up the kernel
104sources. Instead, we have uploaded a number of sample configurations which you 156sources. This has become impractical with the number of systems we now support.
105can base your configuration upon. Simply click on the closest option that 157This section details various sources for sample kernel configurations.
106matches your system and kernel version. You may also find other configuration 158</p>
107samples at the URLs mentioned below. 159
160</body>
161</subsection>
162<subsection>
163<title>Using sample configurations in the kernel source</title>
164<body>
165
166<p>
167Many 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,
169can be configured using the commands mentioned in the table below.
108</p> 170</p>
109 171
110<table> 172<table>
111 <tr> 173<tr>
112 <th>System</th> 174 <th>System</th>
113 <th>Kernel Version</th> 175 <th>Configure command</th>
114 </tr> 176</tr>
115 <tr> 177<tr>
178 <ti>Cobalt Servers</ti>
179 <ti><c>make cobalt_defconfig</c></ti>
180</tr>
181<tr>
116 <ti>SGI IP22 (Indy, Indigo 2, Challenge S)</ti> 182 <ti>Indy, Indigo2 (R4k), Challenge S</ti>
183 <ti><c>make ip22_defconfig</c></ti>
184</tr>
185<tr>
186 <ti>Origin 200/2000</ti>
187 <ti><c>make ip27_defconfig</c></ti>
188</tr>
189<tr>
190 <ti>Indigo2 Impact (R10k)</ti>
117 <ti> 191 <ti>
118 <uri link="http://www.longlandclan.hopto.org/~stuartl/mips-linux/sgi/ip22/config/2.4.29-mipscvs-20050130.gz">2.4.29</uri> 192 <c>make ip28_defconfig</c> (requires <c>mips-sources-2.6.14.5</c> or
193 later)
119 </ti> 194 </ti>
120 </tr> 195</tr>
121 <tr> 196<tr>
122 <ti>Cobalt Qube/Raq 2800</ti> 197 <ti>O2</ti>
123 <ti> 198 <ti><c>make ip32_defconfig</c></ti>
124 <uri link="http://dev.gentoo.org/~kumba/mips/cobalt/kernel/cobalt-2605.config">2.6.5</uri>
125 <uri link="http://dev.gentoo.org/~kumba/mips/cobalt/kernel/cobalt-2606.config">2.6.6</uri>
126 <uri link="http://dev.gentoo.org/~kumba/mips/cobalt/kernel/cobalt-config-2609">2.6.9</uri>
127 </ti>
128 </tr> 199</tr>
129</table> 200</table>
130 201
131<ul> 202</body>
132 <li> 203</subsection>
133 IP22 (Indy, Indigo2, Challenge S) Configurations:
134 <uri link="http://www.longlandclan.hopto.org/~stuartl/mips-linux/sgi/ip22/config">
135 http://www.longlandclan.hopto.org/~stuartl/mips-linux/sgi/ip22/config
136 </uri>
137 </li>
138 <li>
139 Cobalt Server Configurations:
140 <uri link="http://dev.gentoo.org/~kumba/mips">
141 http://dev.gentoo.org/~kumba/mips
142 </uri>
143 </li>
144</ul>
145 204
146<note> 205<subsection>
147More kernel configuration examples can be found on the Gentoo/MIPS Hardware 206<title>Using the running kernel config from the installation media</title>
148Support Database, which is located at 207<body>
208
209<p>
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
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
214<c>zcat</c> as shown below.
215</p>
216
217<pre caption="Extracting .config from /proc/config.gz">
218# <i>zcat /proc/config.gz > .config</i>
219</pre>
220
221<impo>
222This kernel config is set up for a netboot image. That
223is, it will expect to find a root filesystem image somewhere nearby, either as a
224directory for initramfs, or a loopback device for initrd. When you run <c>make
225menuconfig</c> below, don't forget to go into General Setup and disable the
226options for initramfs.
227</impo>
228
229</body>
230</subsection>
231
232<subsection>
233<title>The Hardware Compatability Database</title>
234<body>
235
236<p>
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,
239and allows users to contribute kernel configurations that are known to work.
240The address for this site is
149<uri>http://stuartl.longlandclan.hopto.org/gentoo/mips</uri>. 241<uri>http://stuartl.longlandclan.hopto.org/gentoo/mips</uri>.
150</note> 242</p>
243
244<p>
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
247noted however that there is no guarantee that any of the configuration files
248downloaded from this site will work.
249</p>
250
251</body>
252</subsection>
253
254<subsection>
255<title>Customising the configuration for your needs.</title>
256<body>
151 257
152<p> 258<p>
153Once you have found a configuration, download it into your kernel source 259Once you have found a configuration, download it into your kernel source
154directory, 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
155<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 customise
162# <i>make oldconfig</i> 268# <i>make oldconfig</i>
163<comment>(Just press ENTER at each prompt to accept the defaults... we'll customise later)</comment> 269<comment>(Just press ENTER at each prompt to accept the defaults... we'll customise later)</comment>
164# <i>make menuconfig</i> 270# <i>make menuconfig</i>
165</pre> 271</pre>
166 272
273<impo>
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
276<c>mipsel-linux</c> ... etc) to <c>gcc</c> and <c>as</c> commands when compiling
277the kernel. This should be turned off, even if cross-compiling. Instead, if
278you do need to call a cross-compiler, specify the prefix using the
279<c>CROSS_COMPILE</c> variable as shown in the next section.
280</impo>
281
167</body> 282</body>
168</subsection> 283</subsection>
169<subsection id="compiling"> 284<subsection id="compiling">
170<title>Compiling and Installing</title> 285<title>Compiling and Installing</title>
171<body> 286<body>
173<p> 288<p>
174Now 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
175the configuration and start the compilation process: 290the configuration and start the compilation process:
176</p> 291</p>
177 292
293<note>
294On 64-bit machines, you need to specify
295<c>CROSS_COMPILE=mips64-unknown-linux-gnu-</c> (or <c>mips64el-...</c> if on
296a little-endian system) to use the 64-bit compiler.
297</note>
298
178<pre caption="Compiling the kernel"> 299<pre caption="Compiling the kernel">
179<comment>(For 2.4 kernel)</comment> 300<comment>(For 2.4 kernel only)</comment>
301# <i>make dep</i>
302
303<comment>(2.4 and 2.6 kernels -- compiling natively)</comment>
180# <i>make dep &amp;&amp; make vmlinux modules modules_install</i> 304# <i>make vmlinux modules modules_install</i>
181 305
182<comment>(For 2.6 kernel)</comment> 306<comment>(2.4 and 2.6 kernels -- cross-compiling on target machine)</comment>
183# <i>make &amp;&amp; make modules_install</i> 307<comment>( Adjust the mips64-unknown-linux-gnu- accordingly )</comment>
308# <i>make vmlinux modules modules_install CROSS_COMPILE=mips64-unknown-linux-gnu-</i>
309
310<comment>(When compiling on another machine, such as an x86 box... use the)</comment>
311<comment>( following commands to compile the kernel &amp; install modules into)</comment>
312<comment>( a specific directory to be transferred to the target machine. )</comment>
313# <i>make vmlinux modules CROSS_COMPILE=mips64-unknown-linux-gnu-</i>
314# <i>make modules_install INSTALL_MOD_PATH=/somewhere</i>
315</pre>
316
317<impo>
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
320machine will not be able to boot. This is to work around the PROM not
321understanding the ELF64 format.
322</impo>
323
324<pre caption="Using the vmlinux.32 target">
325# <i>make vmlinux.32</i>
326<comment>(This will create vmlinux.32 -- which is your final kernel)</comment>
184</pre> 327</pre>
185 328
186<p> 329<p>
187When the kernel has finished compiling, copy the kernel image to 330When the kernel has finished compiling, copy the kernel image to
188<path>/boot</path>. 331<path>/boot</path>.
189</p> 332</p>
190 333
191<note> 334<note>
192On Cobalt servers, the bootloader will expect to see a compressed kernel image. 335On Cobalt servers, the bootloader will expect to see a compressed kernel image.
193Remember to <c>gzip -9</c> the file once it is in <path>/boot</path>. In the 336Remember to <c>gzip -9</c> the file once it is in <path>/boot</path>.
194following example, replace <path>&lt;kernel-version&gt;</path> with your kernel
195version.
196</note> 337</note>
197 338
198<pre caption="Installing the kernel"> 339<pre caption="Installing the kernel">
199# <i>cp vmlinux /boot/&lt;kernel-version&lt;</i> 340# <i>cp vmlinux /boot/kernel-2.6.13.4</i>
341
200<comment>(Cobalt Servers -- Compressing the kernel image)</comment> 342<comment>(Cobalt Servers -- Compressing the kernel image)</comment>
201# <i>gzip -9v /boot/&lt;kernel-version&lt;</i> 343# <i>gzip -9v /boot/kernel-2.6.13.4</i>
202</pre> 344</pre>
203 345
204<!-- 346<!--
205Moot point, now that we use arcboot on SGI, and CoLo on Cobalts 347Moot point, now that we use arcboot on SGI, and CoLo on Cobalts
206<p> 348<p>

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

  ViewVC Help
Powered by ViewVC 1.1.20