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

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

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

Revision 1.9 Revision 1.10
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/1.0 --> 5<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-mips-bootloader.xml,v 1.9 2005/01/04 18:11:20 swift Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-mips-bootloader.xml,v 1.10 2005/02/14 14:59:19 swift Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<version>1.5</version> 11<version>1.6</version>
12<date>2004-10-23</date> 12<date>2005-02-14</date>
13
14<section id="sgi">
15<title>Silicon Graphics Machines -- Setting Up Arcboot</title>
16<subsection>
17<title>Installing arcboot</title>
18<body>
19
20<p>
21Previously in this guide, we showed you how to make a kernel, then copy it to
22the volume header using <c>dvhtool</c>. There were two main flaws with this
23system:
24</p>
25
26<ul>
27 <li>This is not supported on all SGI systems</li>
28 <li>It requires a significantly larger volume header</li>
29</ul>
30
31<p>
32In order to boot the machine, a bootloader, <c>arcboot</c> was developed for
33this purpose. Instead of putting the kernel directly into the volume header, we
34leave it in <path>/boot</path> (which resides on a EXT2/3 partition), and tell
35<c>arcboot</c> (which sits in the volume header in place of the kernel) where to
36find it. So our first step, is to emerge some tools that we'll use later...
37</p>
38
39<pre caption="Installing the required tools">
40# <i>emerge dvhtool arcboot</i>
41</pre>
42
43<p>
44That should have installed two tools, <c>arcboot</c> which sits in the volume
45header and loads kernels for us, and <c>dvhtool</c> which helps us put
46<c>arcboot</c> into the volume header.
47</p>
48<p>
49The magic binary we want, hides in <path>/usr/lib/arcboot</path> -- on IP22
50systems (Indy, Indigo 2, Challenge S), it'll be called
51<path>arcboot.ip22</path>. Other systems should be similar. We
52first copy this file into the volume header.
53</p>
54
55<pre caption="Installing arcboot into the volume header">
56# <i>dvhtool --unix-to-vh /usr/lib/arcboot/arcboot.ip?? arcboot</i>
57</pre>
58
59<p>
60We then verify the presence of the file in the volume header.
61</p>
62
63<pre caption="Checking if arcboot made it okay">
64# <i>dvhtool --print-volume-directory</i>
65----- directory entries -----
66Entry #0, name "linux", start 4, bytes 3262570
67Entry #1, name "newlinux", start 6377, bytes 7619627
68Entry #3, name "arcboot", start 21260, bytes 51448
69#
70</pre>
71
72<note>
73You'll notice that in my case, I've got two old kernels sitting around there,
74<path>linux</path> and <path>newlinux</path>. This is a hangover from before we
75started using <c>arcboot</c>. Their presence doesn't matter -- just so long as
76<c>arcboot</c> is present, everything is fine.
77</note>
78
79</body>
80</subsection>
81
82<subsection>
83<title>Configuring arcboot</title>
84
85<body>
86
87<p>
88If you've ever set up the Linux Loader (<c>lilo</c>) before, you'll find that
89<c>arcboot</c> employs a similar syntax in its configuration file. Bear in mind
90though; <c>arcboot</c> expects to find its configuration file existing on an
91EXT2/3 partition as <path>/etc/arcboot.conf</path>. The easiest way around this
92is to make sure <path>/boot</path> is an EXT2/3 partition and that there's a
93file called <path>arcboot.conf</path> inside the <path>/boot/etc</path>
94directory. An example config can be found in
95<path>/etc/arcboot.conf.sample</path>
96</p>
97
98<pre caption="Putting arcboot.conf in its place">
99<comment>(Create the /boot/etc directory)</comment>
100# <i>mkdir /boot/etc</i>
101
102<comment>(Put our configuration into the target directory)</comment>
103# <i>cp /etc/arcboot.conf.sample /boot/etc/arcboot.conf</i>
104
105<comment>(Create a symlink back to /etc)</comment>
106# <i>ln -s /boot/etc/arcboot.conf /etc/arcboot.conf</i>
107
108<comment>(... and a symlink in /boot pointing to itself)</comment>
109# <i>(cd /boot; ln -s . boot)</i>
110</pre>
111
112<p>
113You can then edit <path>/etc/arcboot.conf</path> to your own preference.
114Personally, I prefer to set up two kernel images: <path>new</path>, a freshly built
115image that may or may not work; and <path>working</path>, a proven trustworthy
116kernel image. My <path>arcboot.conf</path> looks a bit like this.
117</p>
118
119<pre caption="Example arcboot.conf">
120<comment># arcboot.conf</comment>
121<comment>#</comment>
122<comment># copyright 2002 Guido Guenther &lt;agx@sigxcpu.org&gt;</comment>
123<comment>#</comment>
124label=working
125 image=/vmlinux
126 append="root=/dev/sda3"
127
128<comment># backup version</comment>
129label=new
130 image=/vmlinux-new
131 append="root=/dev/sda3"
132</pre>
133
134<p>
135Once that is set up, there's then just some little tweaks that you need to do
136within the SGI PROM to make this magic work. This is covered in, not the next
137section (that's for Cobalt servers) but the following section
138<uri link="#reboot">Rebooting the System</uri>.
139</p>
140
141</body>
142</subsection>
143</section>
144
145<section id="cobalt">
146<title>Cobalt MicroServers -- Setting Up CoLo</title>
147<subsection>
148<title>Installing CoLo</title>
149<body>
150
151<p>
152On Cobalt servers, these machines have a much less capable firmware installed on
153chip. The Cobalt BOOTROM is primitive, by comparison to the SGI PROM, and has a
154number of serious limitations.
155</p>
156
157<ul>
158 <li>
159 There's a 675kB limit on kernels. The current size of Linux 2.4 makes it
160 damn near impossible to make a kernel this size. Linux 2.6 is totally out
161 of the question.
162 </li>
163 <li>
164 64-bit kernels are not supported by the stock firmware (although these are
165 highly experimental on Cobalt machines at this time)
166 </li>
167 <li>
168 The shell is basic at best
169 </li>
170</ul>
171
172<p>
173To overcome these limitations, an alternative firmware, called
174<uri link="http://www.colonel-panic.org/cobalt-mips/">CoLo</uri> (Cobalt
175Loader) was developed. This is a BOOTROM image that can either be flashed into
176the chip inside the Cobalt server, or loaded from the existing firmware.
177</p>
178
179<note>
180This guide will take you through setting up CoLo so that it is loaded by the
181stock firmware. This is the only truly safe, and recommended way to set up CoLo.
182</note>
183
184<warn>
185You may, if you wish, flash it into the server, and totally
186replace the original firmware -- however, you are entirely on your own in that
187endeavour. Should anything go wrong, you will need to physically remove the
188BOOTROM and reprogram it yourself with the stock firmware. If you are not
189sure how to do this -- then <e>DO NOT</e> flash your machine. We take no
190responsibility for whatever happens if you ignore this advice.
191</warn>
192
193<p>
194Okay, with the warnings over now, we'll get on with installing CoLo. First,
195start by emerging the package.
196</p>
197
198<pre caption="Emerging colo">
199# <i>emerge colo</i>
200</pre>
201
202<p>
203With that installed (I hope you read those messages ;-) you should be able to
204look inside the <path>/usr/lib/colo</path> directory to find two files,
205<path>colo-chain.elf</path>: the "kernel" for the stock firmware to load, and
206<path>colo-rom-image.bin</path>: a ROM image for flashing into the BOOTROM. We
207start by mounting /boot and dumping a compressed copy of
208<path>colo-chain.elf</path> in <path>/boot</path> where the system expects it.
209</p>
210
211<pre caption="Putting CoLo in its place">
212# <i>gzip -9vc /usr/lib/colo/colo-chain.elf &gt; /boot/vmlinux.gz</i>
213</pre>
214
215</body>
216</subsection>
217
218<subsection>
219<title>Configuring CoLo</title>
220
221<body>
222
223<p>
224Now, when the system first boots up, it'll load CoLo which will spit up a menu
225on the back LCD. The first option (and default that is assumed after roughly 5
226seconds) is to boot to the hard disk. The system would then attempt to mount
227the first Linux partition it finds, and run the script
228<path>default.colo</path>. The syntax is fully documented in the CoLo
229documentation (have a peek at
230<path>/usr/share/doc/colo-X.YY/README.shell.gz</path> -- where X.YY is the
231version installed), and is very simple.
232</p>
233
234<pre caption="A basic default.colo">
235<comment>#:CoLo:#</comment>
236mount hda1
237load /vmlinux-working.gz
238execute root=/dev/hda3 ro console=ttyS0,115200
239</pre>
240
241<note>
242CoLo will refuse to load a script that does not begin with the <c>#:CoLo:#</c>
243line. Think of it as the equivalent of saying <c>#!/bin/sh</c> in shell
244scripts.
245</note>
246
247<p>
248It is also possible to ask a question, such as which kernel &amp; configuration
249you'd like to boot, with a default timeout. This is the configuration I use on
250my Cobalt server:
251</p>
252
253<pre caption="Menu-based configuration">
254<comment>#:CoLo:#</comment>
255
256lcd "Mounting hda1"
257mount hda1
258menu "Which Kernel?" 50 Working working New new
259lcd "Loading Linux" {menu-option}
260load /vmlinux.gz.{menu-option}
261lcd "Booting..."
262execute root=/dev/hda5 ro console=ttyS0,115200
263boot
264</pre>
265
266<p>
267The above script asks the user which kernel he/she would like to boot (either
268New or Working), then loads <path>vmlinux.gz.new</path> or
269<path>vmlinux.gz.working</path> depending on the selection. If a selection is
270not made within 5 seconds (50/10ths of a second) it boots the first option.
271</p>
272</body>
273
274</subsection>
275</section>
13 276
14<section> 277<section>
15<title>The MIPS PROM</title> 278<title>Setting up for Serial Console</title>
16<subsection>
17<body>
18 279
19<p> 280<subsection>
20MIPS doesn't require that you install a bootloader. The MIPS PROM handles the 281<body>
21booting, but you need to install your kernel as a viable option. 282
22</p> 283<p>
23 284Okay, the Linux installation as it stands now, would boot fine, but assumes
285you're going to be logged in at a physical terminal. On Cobalt machines, this
286is particularly bad -- there's no such thing as a physical terminal.
24<p> 287</p>
25First, install <c>dvhtool</c>, needed to copy the kernel to the SGI Volume 288
26Header. 289<note>
290Those who do have the luxury of a supported framebuffer may skip this section if
291they wish.
292</note>
293
27</p> 294<p>
28 295First, pull up an editor and hack away at <path>/etc/inittab</path>. Further
29<pre caption="Installing dvhtool"> 296down in the file, you'll see something like this:
30# <i>emerge dvhtool</i>
31</pre>
32
33<p> 297</p>
34Now copy over the kernel to the SGI Volume Header. By default <c>dvhtool</c> 298
35assumes that the SGI Volume Header is on <path>/dev/sda</path>. If this is not 299<pre caption="inittab Configuration">
36the case (for instance when IRIX is installed on <path>/dev/sda</path> and 300<comment># SERIAL CONSOLE</comment>
37Gentoo/MIPS on <path>/dev/sdb</path>) you need to inform <c>dvhtool</c> about it 301<comment>#c0:12345:respawn:/sbin/agetty 9600 ttyS0 vt102</comment>
38using <c>-d &lt;device&gt;</c>. 302
303<comment># TERMINALS</comment>
304c1:12345:respawn:/sbin/agetty 38400 tty1 linux
305c2:12345:respawn:/sbin/agetty 38400 tty2 linux
306c3:12345:respawn:/sbin/agetty 38400 tty3 linux
307c4:12345:respawn:/sbin/agetty 38400 tty4 linux
308c5:12345:respawn:/sbin/agetty 38400 tty5 linux
309c6:12345:respawn:/sbin/agetty 38400 tty6 linux
310
311<comment># What to do at the "Three Finger Salute".</comment>
312ca:12345:ctrlaltdel:/sbin/shutdown -r now
313</pre>
314
39</p> 315<p>
40 316First, uncomment the <c>c0</c> line. By default, it's set to use a terminal
41<pre caption="Copying a kernel to the SGI Volume Header"> 317baud rate of 9600 bps. On Cobalt servers, you may want to change this to 115200
42# <i>dvhtool --unix-to-vh &lt;kernel name in /boot&gt; &lt;name you want to give in volume header&gt;</i> 318to match the baud rate decided by the BOOT ROM. This is how that section looks
43</pre> 319on my machine. On a headless machine (e.g. Cobalt servers), I'll also recommend
44 320commenting out the local terminal lines (<c>c1</c> through to <c>c6</c>)
321as these have a habit of misbehaving when they can't open
322<path>/dev/ttyX</path>.
45<p> 323</p>
46If you want to see all available entries in the volume, use 324
47<c>--print-volume-directory</c>: 325<pre caption="Example snippet from inittab">
326<comment># SERIAL CONSOLE</comment>
327c0:12345:respawn:/sbin/agetty 115200 ttyS0 vt102
328
329<comment># TERMINALS -- These are useless on a headless qube</comment>
330<comment>#c1:12345:respawn:/sbin/agetty 38400 tty1 linux</comment>
331<comment>#c2:12345:respawn:/sbin/agetty 38400 tty2 linux</comment>
332<comment>#c3:12345:respawn:/sbin/agetty 38400 tty3 linux</comment>
333<comment>#c4:12345:respawn:/sbin/agetty 38400 tty4 linux</comment>
334<comment>#c5:12345:respawn:/sbin/agetty 38400 tty5 linux</comment>
335<comment>#c6:12345:respawn:/sbin/agetty 38400 tty6 linux</comment>
336</pre>
337
48</p> 338<p>
49 339Now, lastly... we have to tell the system, that the local serial port can be
50<pre caption="Viewing all available entries in the volume"> 340trusted as a secure terminal. The file we need to poke at is
51# <i>dvhtool --print-volume-directory</i> 341<path>/etc/securetty</path>. It contains a list of terminals that the system
52</pre> 342trusts. We simply stick in two more lines, permitting the serial line to be
53 343used for <c>root</c> logins.
54<p> 344</p>
55To set up your system to boot Gentoo/MIPS you need to go tweak some settings in 345
56the MIPS PROM. 346<pre caption="Enabling root logins on serial console">
347<comment>(/dev/ttyS0 -- the traditional name for the first serial port)</comment>
348# <i>echo 'ttyS0' >> /etc/securetty</i>
349
350<comment>(Lately, Linux also calls this /dev/tts/0 -- so we add this
351too)</comment>
352# <i>echo 'tts/0' >> /etc/securetty</i>
57</p> 353</pre>
58
59<p>
60Continue with <uri link="#reboot">Rebooting the System</uri>.
61</p>
62 354
63</body> 355</body>
64</subsection> 356</subsection>
65</section> 357</section>
358
66<section id="reboot"> 359<section id="reboot">
67<title>Rebooting the System</title> 360<title>Rebooting the System</title>
68<subsection> 361<subsection>
69<body> 362<body>
70 363
78cdimage ~# <i>cd</i> 371cdimage ~# <i>cd</i>
79cdimage ~# <i>umount /mnt/gentoo/boot /mnt/gentoo/proc /mnt/gentoo</i> 372cdimage ~# <i>umount /mnt/gentoo/boot /mnt/gentoo/proc /mnt/gentoo</i>
80cdimage ~# <i>reboot</i> 373cdimage ~# <i>reboot</i>
81</pre> 374</pre>
82 375
376<note>
377<e>Cobalt Users:</e> The rest of this section covers the setting up of the SGI
378PROM so that it boots <c>arcboot</c> off disk and loads Linux. This is not
379applicable to the setup of Cobalt servers. In fact, all your work is done --
380there is no configuration needed for the first boot up, you can skip to the next
381section: <uri link="?part=1&amp;chap=11">Finalising your Gentoo
382Installation</uri>
383</note>
384
83</body> 385</body>
84</subsection> 386</subsection>
85</section> 387</section>
86<section> 388<section>
87<title>Tweaking the MIPS PROM</title> 389<title>Tweaking the SGI PROM</title>
88<subsection> 390<subsection>
89<body> 391<body>
90 392
91<p> 393<p>
92When you are rebooted, go to the <e>System Maintenance Menu</e> and select 394When you are rebooted, go to the <e>System Maintenance Menu</e> and select
93<e>Enter Command Monitor</e> (<c>5</c>). If you want to test your new Gentoo 395<e>Enter Command Monitor</e> (<c>5</c>). If you want to test your new Gentoo
94installation, you can just run <c>boot -f &lt;kernel name&gt;</c>. To have your 396installation, you can just run <c>boot -f &lt;kernel name&gt;</c>. To have your
95system permanently boot into the Gentoo installation, you need to set some 397system permanently boot into the Gentoo installation, you need to set some
96variables in the MIPS PROM: 398variables in the SGI PROM:
97</p> 399</p>
98 400
99<pre caption="Configuring the PROM to Boot Gentoo"> 401<pre caption="Configuring the PROM to Boot Gentoo">
1001) Start System 4021) Start System
1012) Install System Software 4032) Install System Software

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20