/[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.23 Revision 1.24
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.23 2007/02/26 08:54:53 nightmorph Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-mips-kernel.xml,v 1.24 2007/05/07 18:11:41 nightmorph Exp $ -->
8<!-- :vim:ts=2:sts=2:et:tw=80: --> 8<!-- :vim:ts=2:sts=2:et:tw=80: -->
9<sections> 9<sections>
10 10
11<version>7.1</version> 11<version>8.0</version>
12<date>2007-02-26</date> 12<date>2007-05-07</date>
13 13
14<section> 14<section>
15<title>Timezone</title> 15<title>Timezone</title>
16<body> 16<body>
17 17
18<p> 18<p>
19You first need to select your timezone so that your system knows where it is 19You first need to select your timezone so that your system knows where it is
20located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then copy 20located. Look for your timezone in <path>/usr/share/zoneinfo</path>. You then
21it to <path>/etc/localtime</path>. Please avoid the 21set your timezone in <path>/etc/conf.d/clock</path>. Please avoid the
22<path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not 22<path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not
23indicate the expected zones. For instance, <path>GMT-8</path> is in fact GMT+8. 23indicate the expected zones. For instance, <path>GMT-8</path> is in fact GMT+8.
24</p> 24</p>
25 25
26<pre caption="Setting the timezone information to GMT"> 26<pre caption="Setting the timezone information">
27# <i>cp /usr/share/zoneinfo/GMT /etc/localtime</i> 27# <i>ls /usr/share/zoneinfo</i>
28<comment>(Suppose you want to use GMT)</comment>
29# <i>nano -w /etc/conf.d/clock</i>
30TIMEZONE="GMT"
28</pre> 31</pre>
29 32
30</body> 33</body>
31</section> 34</section>
32 35
44Guide</uri>. 47Guide</uri>.
45</p> 48</p>
46 49
47<p> 50<p>
48MIPS-based systems have just the one kernel tree to choose from, 51MIPS-based systems have just the one kernel tree to choose from,
49<c>mips-sources</c>. <!--Special patches are needed to make certain systems work. 52<c>mips-sources</c>. This patchset differs from the ones available for other
50The table below displays the USE flags required to enable the patchsets. Note
51that Indy, Indigo2 (R4k) and Challenge S systems do not require any additional
52patchsets.--> This patchset differs from the ones available for other
53architectures, in that it has lots of patches specific to the MIPS architecture. 53architectures, in that it has lots of patches specific to the MIPS
54architecture.
54</p> 55</p>
55
56<!--
57<table>
58<tr>
59 <th>USE flag</th>
60 <th>System</th>
61</tr>
62<tr>
63 <ti><c>cobalt</c></ti>
64 <ti>Cobalt Qube/RaQ support</ti>
65</tr>
66<tr>
67 <ti><c>ip27</c></ti>
68 <ti>SGI Origin 200/2000 support (1)</ti>
69</tr>
70<tr>
71 <ti><c>ip28</c></ti>
72 <ti>SGI Indigo2 Impact (R10000) support (1,2)</ti>
73</tr>
74<tr>
75 <ti><c>ip30</c></ti>
76 <ti>SGI Octane/Octane2 support (1)</ti>
77</tr>
78</table>-->
79 56
80<pre caption="Merging kernel sources..."> 57<pre caption="Merging kernel sources...">
81<!-- Done by profile?
82<comment>(Substitute cobalt with the appropriate USE flag for your system if required)</comment>
83# <i>mkdir /etc/portage</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>
87# <i>emerge mips-sources</i> 58# <i>emerge mips-sources</i>
88</pre> 59</pre>
89 60
90<impo> 61<impo>
91<!--(1)--> On the Origin 200/2000, Indigo2 Impact (R10000), Octane/Octane2 and 62On the Origin 200/2000, Indigo2 Impact (R10000), Octane/Octane2 and O2, a 64-bit
92O2, a 64-bit kernel is required to boot these systems. For these machines, you 63kernel is required to boot these systems. For these machines, you should
93should <!--switch to the <path>default-linux/mips/mips64/RELEASE</path>
94profile by altering the <path>/etc/make.profile</path> symlink.
95Then you can --><c>emerge
96kgcc64</c> to create a cross-compiler for building 64-bit kernels. 64<c>emerge kgcc64</c> to create a cross-compiler for building 64-bit kernels.
97</impo>
98
99<!--<impo>
100(2) The Indigo2 Impact is a special case in that it requires special patch to
101be applied to <c>gcc</c> before it will build an IP28 kernel correctly. This
102patch adds support for the <c>-mip28-cache-barriers</c> CFLAG, which is used
103when building kernels to work around the inherent hardware bug brought on by
104speculative execution. This USE flag can be set in <path>/etc/make.conf</path>.
105This is done for you by setting your profile to
106<path>default-linux/mips/mips64/ip28/RELEASE</path>, which also takes care of
107(1).
108</impo>--> 65</impo>
109 66
110<pre caption="Installing kgcc64..."> 67<pre caption="Installing kgcc64...">
111<!--<comment>(This assumes PORTDIR is in the usual location; /usr/portage)</comment>
112# <i>rm /etc/make.profile</i>
113# <i>ln -s /usr/portage/profiles/default-linux/mips/mips64/2005.0</i> <comment>(or .../mips64/ip28/2005.0)</comment>
114
115<comment>(Install the 64-bit kernel toolchain)</comment>
116--># <i>emerge kgcc64</i> 68# <i>emerge kgcc64</i>
117</pre> 69</pre>
118 70
119<p> 71<p>
120When you take a look in <path>/usr/src</path> you should see a symlink called 72When you take a look in <path>/usr/src</path> you should see a symlink called
121<path>linux</path> pointing to your kernel source. In this case, the installed 73<path>linux</path> pointing to your kernel source. In this case, the installed
122kernel source points to <c>mips-sources-2.6.13.4</c>. Your version may be 74kernel source points to <c>mips-sources-<keyval id="kernel-version"/></c>. Your
123different, so keep this in mind. 75version may be different, so keep this in mind.
124</p> 76</p>
125 77
126<pre caption="Viewing the kernel source symlink"> 78<pre caption="Viewing the kernel source symlink">
127# <i>ls -l /usr/src/linux</i> 79# <i>ls -l /usr/src/linux</i>
128lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-2.6.13.4 80lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-<keyval id="kernel-version"/>
129</pre>
130
131<p>
132If this isn't the case (i.e. the symlink points to a different kernel source)
133change the symlink before you continue:
134</p>
135
136<pre caption="Changing the kernel source symlink">
137# <i>rm /usr/src/linux</i>
138# <i>cd /usr/src</i>
139# <i>ln -s linux-2.6.13.4 linux</i>
140</pre> 81</pre>
141 82
142<p> 83<p>
143Now it is time to configure and compile your kernel source. 84Now it is time to configure and compile your kernel source.
144</p> 85</p>
188 <ti><c>make ip27_defconfig</c></ti> 129 <ti><c>make ip27_defconfig</c></ti>
189</tr> 130</tr>
190<tr> 131<tr>
191 <ti>Indigo2 Impact (R10k)</ti> 132 <ti>Indigo2 Impact (R10k)</ti>
192 <ti> 133 <ti>
193 <c>make ip28_defconfig</c> (requires <c>mips-sources-2.6.14.5</c> or later) 134 <c>make ip28_defconfig</c>
194 </ti> 135 </ti>
195</tr> 136</tr>
196<tr> 137<tr>
197 <ti>O2</ti> 138 <ti>O2</ti>
198 <ti><c>make ip32_defconfig</c></ti> 139 <ti><c>make ip32_defconfig</c></ti>
301<c>CROSS_COMPILE=mips64-unknown-linux-gnu-</c> (or <c>mips64el-...</c> if on a 242<c>CROSS_COMPILE=mips64-unknown-linux-gnu-</c> (or <c>mips64el-...</c> if on a
302little-endian system) to use the 64-bit compiler. 243little-endian system) to use the 64-bit compiler.
303</note> 244</note>
304 245
305<pre caption="Compiling the kernel"> 246<pre caption="Compiling the kernel">
306<comment>(For 2.4 kernel only)</comment>
307# <i>make dep</i>
308
309<comment>(2.4 and 2.6 kernels -- compiling natively)</comment> 247<comment>(Compiling natively)</comment>
310# <i>make vmlinux modules modules_install</i> 248# <i>make vmlinux modules modules_install</i>
311 249
312<comment>(2.4 and 2.6 kernels -- cross-compiling on target machine)</comment> 250<comment>(Cross-compiling on target machine)</comment>
313<comment>( Adjust the mips64-unknown-linux-gnu- accordingly )</comment> 251<comment>(Adjust the mips64-unknown-linux-gnu- accordingly)</comment>
314# <i>make vmlinux modules modules_install CROSS_COMPILE=mips64-unknown-linux-gnu-</i> 252# <i>make vmlinux modules modules_install CROSS_COMPILE=mips64-unknown-linux-gnu-</i>
315 253
316<comment>(When compiling on another machine, such as an x86 box... use the)</comment> 254<comment>(When compiling on another machine, such as an x86 box, use the)</comment>
317<comment>( following commands to compile the kernel &amp; install modules into)</comment> 255<comment>(following commands to compile the kernel &amp; install modules into)</comment>
318<comment>( a specific directory to be transferred to the target machine. )</comment> 256<comment>(a specific directory to be transferred to the target machine.)</comment>
319# <i>make vmlinux modules CROSS_COMPILE=mips64-unknown-linux-gnu-</i> 257# <i>make vmlinux modules CROSS_COMPILE=mips64-unknown-linux-gnu-</i>
320# <i>make modules_install INSTALL_MOD_PATH=/somewhere</i> 258# <i>make modules_install INSTALL_MOD_PATH=/somewhere</i>
321</pre> 259</pre>
322 260
323<impo> 261<impo>
341On Cobalt servers, the bootloader will expect to see a compressed kernel image. 279On Cobalt servers, the bootloader will expect to see a compressed kernel image.
342Remember to <c>gzip -9</c> the file once it is in <path>/boot</path>. 280Remember to <c>gzip -9</c> the file once it is in <path>/boot</path>.
343</note> 281</note>
344 282
345<pre caption="Installing the kernel"> 283<pre caption="Installing the kernel">
346# <i>cp vmlinux /boot/kernel-2.6.13.4</i> 284# <i>cp vmlinux /boot/kernel-<keyval id="kernel-version"/></i>
347 285
348<comment>(Cobalt Servers -- Compressing the kernel image)</comment> 286<comment>(Cobalt Servers -- Compressing the kernel image)</comment>
349# <i>gzip -9v /boot/kernel-2.6.13.4</i> 287# <i>gzip -9v /boot/kernel-<keyval id="kernel-version"/></i>
350</pre> 288</pre>
351 289
352</body> 290</body>
353</subsection> 291</subsection>
354</section> 292</section>
357<subsection> 295<subsection>
358<title>Configuring the Modules</title> 296<title>Configuring the Modules</title>
359<body> 297<body>
360 298
361<p> 299<p>
362You should list the modules you want automatically loaded in one of the 300You should list the modules you want automatically loaded in
363relevant files listed below. You can add extra options to the modules too if 301<path>/etc/modules.autoload.d/kernel-2.6</path>. You can add extra options to
364you want. 302the modules too if you want.
365</p>
366
367<ul>
368 <li><path>/etc/modules.autoload.d/kernel-2.4</path> - Kernel 2.4 only</li>
369 <li><path>/etc/modules.autoload.d/kernel-2.6</path> - Kernel 2.6 only</li>
370 <li><path>/etc/modules.autoload</path> - All Kernels</li>
371</ul>
372
373<p>
374Therefore, if you have a kernel module that you want to load -- which is common
375to both 2.4 and 2.6, then place it in <path>/etc/modules.autoload</path>.
376Otherwise it can be placed in the appropriate file.
377</p> 303</p>
378 304
379<p> 305<p>
380To view all available modules, run the following <c>find</c> command. Don't 306To view all available modules, run the following <c>find</c> command. Don't
381forget to substitute "&lt;kernel version&gt;" with the version of the kernel 307forget to substitute "&lt;kernel version&gt;" with the version of the kernel
386# <i>find /lib/modules/&lt;kernel version&gt;/ -type f -iname '*.o' -or -iname '*.ko'</i> 312# <i>find /lib/modules/&lt;kernel version&gt;/ -type f -iname '*.o' -or -iname '*.ko'</i>
387</pre> 313</pre>
388 314
389<p> 315<p>
390For instance, to automatically load the <c>3c59x.o</c> module, edit the 316For instance, to automatically load the <c>3c59x.o</c> module, edit the
391appropriate file and enter the module name in it. 317<path>kernel-2.6</path> file and enter the module name in it.
392</p> 318</p>
393 319
394<pre caption="Editing /etc/modules.autoload.d/kernel-2.4"> 320<pre caption="Editing /etc/modules.autoload.d/kernel-2.6">
395# <i>nano -w /etc/modules.autoload.d/kernel-2.4</i> 321# <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
396</pre> 322</pre>
397 323
398<pre caption="/etc/modules.autoload.d/kernel-2.4 or kernel-2.6"> 324<pre caption="/etc/modules.autoload.d/kernel-2.6">
3993c59x 3253c59x
400</pre>
401
402<p>
403This can be also done in a one-liner:
404</p>
405
406<pre caption="Adding a module -- the one-liner method">
407# <i>echo '3c59x' >> /etc/modules.autoload.d/kernel-2.4</i>
408<comment>(or kernel-2.6, or /etc/modules.autoload...)</comment>
409</pre> 326</pre>
410 327
411<p> 328<p>
412Continue the installation with <uri link="?part=1&amp;chap=8">Configuring your 329Continue the installation with <uri link="?part=1&amp;chap=8">Configuring your
413System</uri>. 330System</uri>.

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

  ViewVC Help
Powered by ViewVC 1.1.20