]> git.ozlabs.org Git - yaboot.git/blob - doc/yaboot-howto.sgml
Merge ubuntu ofpath fixes
[yaboot.git] / doc / yaboot-howto.sgml
1 <!DOCTYPE debiandoc PUBLIC "-//DebianDoc//DTD DebianDoc//EN" [
2  <!--
3         document conventions:
4           file, directory, device == file
5           program, command == prgn
6           variable == var
7           package == package
8           program output == tt
9           key input == em, example for longer ones
10           command input == tt
11    -->
12 ]>
13
14 <debiandoc>
15   <book>
16     <titlepag>
17       <title>
18         HOWTO-Booting with Yaboot on PowerPC
19       </title>
20       <author>
21         <name>Chris Tillman</name>
22       </author>
23       <version>Version 1.04, Feb 22 2004</version>
24       <abstract>
25 This document contains installation and usage instructions for
26 <prgn>yaboot</prgn>, the GNU/Linux PowerPC bootloader.
27       </abstract>
28       <copyright>
29         <copyrightsummary>
30 This document may be distributed and modified under the terms of the
31 GNU General Public License.
32 &copy; 1998&ndash;2002 Chris Tillman
33         </copyrightsummary>
34         <p>
35 This document is maintained in the upstream yaboot source.  Patches
36 and translations should be sent to erbenson (at) alaska.net.  The most
37 recent sgml version of this document is available via the yaboot rsync
38 tree: rsync://penguinppc.org/yaboot.
39         <p>
40 The master location of this
41 document is <url
42 id="http://penguinppc.org/bootloaders/yaboot/doc/yaboot-howto.shtml"
43 name="http://penguinppc.org/bootloaders/yaboot/doc/yaboot-howto.shtml">.
44         <p>
45 This document is free software; you may redistribute it and/or modify it
46 under the terms of the GNU General Public License as published by the
47 Free Software Foundation; either version 2, or (at your option) any
48 later version.
49         <p>
50 This document is distributed in the hope that it will be useful, but
51 <em>without any warranty</em>; without even the implied warranty of
52 merchantability or fitness for a particular purpose. See the GNU
53 General Public License for more details.
54         <p>
55
56 A copy of the GNU General Public License is available as
57 <file>/usr/share/common-licenses/GPL</file> in the Debian GNU/Linux
58 distribution or on the World Wide Web at the <url
59 id="http://www.gnu.org/copyleft/gpl.html" name="GNU website">. You can also
60 obtain it by writing to the Free Software Foundation, Inc., 59 Temple Place
61 - Suite 330, Boston, MA 02111-1307, USA.
62
63     <toc detail="sect">
64 <chapt>Yaboot's Purpose
65 <p>
66
67 Yaboot is a bootloader for PowerPC computers (NewWorld PowerMacs and IBM
68 CHRP). It loads a Linux operating system kernel from an
69 OpenFirmware-accessible filesystem and initiates operation of the kernel. On
70 PowerMacs, an included CHRP script can display a multi-OS boot menu which
71 can launch <prgn>yaboot</prgn> or other operating systems. Utilities are
72 included to place <prgn>yaboot</prgn> and the associated script on a
73 non-mountable bootstrap partition.
74
75
76 <chapt>System Requirements
77 <p>
78 Motorola PowerPC processors have been used on at least three different
79 kinds of systems: NuBus, OldWorld PCI, and NewWorld PCI. Nubus systems
80 include the 6100/7100/8100 line of Power Macintoshes. OldWorld systems
81 are most Power Macintoshes with a floppy drive and a PCI bus. Most
82 603, 603e, 604, and 604e based Power Macintoshes, including the 7200,
83 7300, 7500, 7600, 8500, 8600, 9500, and 9600 are OldWorld
84 machines. The beige colored G3 systems are also OldWorld.
85 <p>
86
87 <em><prgn>yaboot</prgn> will not work on NuBus or OldWorld machines</em>,
88 those will require <prgn>quik</prgn> or (for MacOS Pre-9.0.4 only)
89 <prgn>BootX/miboot</prgn>.
90
91 <p>
92 The NewWorld PowerMacs, for which <prgn>yaboot</prgn> is designed, are
93 any PowerMacs in translucent colored plastic cases. That includes all
94 iMacs, iBooks, G4 systems, blue colored G3 systems, and most
95 PowerBooks manufactured in and after 1999.
96
97
98 <chapt>Obtaining Yaboot
99 <p>
100
101 Yaboot is included with Debian GNU/Linux installation for PowerPC computers.
102 Updates for Debian may be downloaded via the normal methods, such as
103 <prgn>apt-get</prgn>, <prgn>dselect</prgn>, or <prgn>dpkg</prgn>.
104 Installation of an updated version of <prgn>yaboot</prgn> on your system
105 does not change your boot configuration; you must use the included
106 <prgn>ybin</prgn> utility to do that.
107
108 <p>
109
110 You can also download <prgn>yaboot</prgn> directly from the
111 <prgn>yaboot</prgn> home page at <url
112 id="http://penguinppc.org/bootloaders/yaboot/">. If you download it using MacOS,
113 be sure to download using <em>binary</em> (not text) format, and don't let
114 Stuffit Expander or another utility expand the archive in MacOS.
115
116 <p>
117
118 You can download the precompiled <file>yaboot-binary-X.Y.tar.gz</file>, or
119 the source tarball <file>yaboot-X.Y.tar.gz</file>. To unpack the binary
120 distribution, use the command <tt>tar -zxvpf yaboot-X.Y.tar.gz</tt>. The
121 components are unpacked into a <file>usr/local/</file> directory inside the
122 directory where the command was executed.
123
124 <p>
125
126 To make and install from source, first make sure you have a working compiler
127 (<prgn>gcc</prgn>) and the <prgn>make</prgn> program installed. (If
128 not, download the binary yaboot tarball instead of the source.) Then run the
129 following commands (substitute the actual revision numbers for X and Y):
130
131 <p>
132 <example>
133      tar -zxvpf yaboot-X.Y.tar.gz
134      cd yaboot-X.Y
135      make
136      su
137      make install
138 </example>
139
140 <chapt>Creating the Bootstrap Partition
141 <p>
142
143 Be sure you have reviewed the <prgn>mac-fdisk</prgn> Basics page at <url
144 id="http://penguinppc.org/bootloaders/yaboot/doc/mac-fdisk-basics.shtml">. If
145 you are creating a new Linux installation, the first partition you create
146 with <prgn>mac-fdisk</prgn> should be the bootstrap partition. Just use the
147 <prgn>mac-fdisk</prgn> <tt>b</tt> command to automatically create a
148 bootstrap partition of the proper size and type. If your version of
149 <prgn>mac-fdisk</prgn> doesn't include the <tt>b</tt> command, use:
150
151 <p>
152 <example>
153      Command (? for help): C xxxx 800k bootstrap Apple_Bootstrap
154 </example>
155 <p>
156
157 (Replace xxxx with the starting block number.) A working tarball of a
158 bootstrap-capable version of mac-fdisk (Debian users already have this
159 version) is also distributed at <url
160 id="http://penguinppc.org/~eb/files/">. To install this, use
161
162 <example>
163      su -
164      cd /
165      gzip -dc mac-fdisk.tar.gz | tar -xvp
166 </example>
167
168 <p>
169 The bootstrap partition only takes 800k of space. If you are adding a
170 bootstrap partition to your existing setup, you may have enough free
171 space on your existing drive without changing other partitions. If
172 not, you could avoid re-partitioning the entire disk by stealing a
173 little space from your swap partition. Or <prgn>parted</prgn> would allow
174 you to resize partitions.
175
176 <p>
177
178 The bootstrap partition should end up being partition #2, after the
179 partition map itself but before any other partitions on the disk. You can
180 easily change the order of the partitions in the partition map using the
181 <tt>r</tt> command (see the <prgn>mac-fdisk</prgn> tutorial). In other
182 words, it's not the physical placement of the bootstrap partition that
183 counts, it's the logical order within the partition map. Note, though, if
184 you have an existing system and you shift the partition numbers around, you
185 will need to make the appropriate changes in <file>/etc/fstab</file>.
186
187 <p>
188
189 The reason you want the bootstrap partition as partition #2, is so
190 that it precedes all other partitions in the boot sequence. This helps
191 tremendously to make the entire system more stable, since some OS's
192 are very intrusive in their use of partitions.
193
194 <p>
195
196 When you're finished partitioning, use the <tt>p</tt> command and make note
197 of the final partition numbers. You will need to know the partition
198 number for the bootstrap partition, the location of your kernel, and
199 if you intend to set up <prgn>yaboot</prgn> for multiple OS booting, partition
200 numbers for your alternate OS's.
201
202 <p>
203
204 While it's possible to install <prgn>yaboot</prgn> on a mountable HFS
205 <file>/boot</file> partition, that configuration is deprecated, discouraged
206 and completely unsupported.
207
208 <chapt>Yabootconfig: Make It Easy
209 <p>
210
211 For initial installation on a machine, you can use <prgn>yabootconfig</prgn>
212 to first create a <file>yaboot.conf</file> file and then install everything
213 on your bootstrap partition. Yabootconfig reads the running system's
214 <file>/etc/fstab</file> to determine the kernel location, and detects the
215 location of the 800k Apple_Bootstrap partition. The Debian installer uses
216 <prgn>yabootconfig</prgn> behind the scenes in the Make Hard Disk Bootable
217 step.
218
219 <p>
220
221 Normally, the initial boot configuration is created while in a ramdisk
222 installer environment, with the system being installed being mounted under
223 <file>/target</file> or <file>/mnt</file>. To run <prgn>yabootconfig</prgn>
224 under these conditions, supply the path to the target system with -t or
225 --chroot option. For example: <tt>yabootconfig --chroot /target</tt>
226
227 <p>
228
229 The <file>yaboot.conf</file> automatically created by
230 <prgn>yabootconfig</prgn> will just control booting of the linux system
231 under which it was created. To boot additional OS's or add other options,
232 you will need to edit the <file>yaboot.conf</file> file.
233
234
235 <chapt>Customizing Your Boot Configuration
236 <p>
237
238 To customize your <prgn>yaboot</prgn> installation, use any text editor such
239 as <prgn>vi</prgn> or <prgn>nano</prgn> (or <prgn>nano-tiny</prgn> in the
240 Debian installer) to edit the <file>yaboot.conf</file> file. If you used
241 <prgn>yabootconfig</prgn> to create the initial <file>yaboot.conf</file>, it
242 will already contain a basic configuration to boot the linux system.
243
244 <p>
245
246 The <file>yaboot.conf</file> has numerous options; see the
247 <file>yaboot.conf</file> man page for details. I will briefly cover the most
248 popular items here. The file controls both <prgn>yaboot</prgn> operation
249 during tha actual boot, and <prgn>ybin</prgn> operation while saving the
250 configuration to the boot partition.
251
252 <p>
253
254 Lines in the file beginning with <tt>#</tt> are interpreted as comments. Each
255 option or parameter must be specified on a separate line. Don't use
256 any extra spaces within or following parameter definitions. Also, the
257 file must have unix newlines; be sure to save as a unix type file
258 if you create or edit it within MacOS.
259
260
261 <sect>Linux Style Device Paths
262 <p>
263
264 For those unfamiliar with Linux device naming, partition paths are in
265 the form of <tt>/dev/xxx#</tt> where xxx is the Linux device name and #
266 represents the partition number. Typical Linux device names are:
267
268 <example>
269   Name   Device Type
270   ----   --------------------------------------------------
271   hda    internal ide drive (primary controller, master disk)
272   hdb    internal ide drive (primary controller, slave disk)
273   hdc    secondary controller, master disk (often used for CD-ROM)
274   hdd    secondary controller, slave disk (often used for Zip drive)
275   sda    first SCSI disk (SCSI ID address-wise)
276   sdb    second SCSI disk
277   scd0   first CD-ROM (or sr0)
278   fd0    first floppy drive
279   fd1    second floppy drive
280 </example>
281
282
283 <sect>OpenFirmware Device Paths
284 <p>
285 A utility for finding the OpenFirmware device path corresponding to a
286 given Linux device path is provided: <prgn>ofpath</prgn>. <prgn>ybin</prgn>
287 uses <prgn>ofpath</prgn>
288 internally to convert Linux device names you use in <file>yaboot.conf</file> to
289 OpenFirmware equivalents. Example: <tt>ofpath /dev/hda</tt> (should return hd:).
290 You can also figure out OpenFirmware device paths yourself, see
291 Recovering From Misconfiguration below.
292
293 <sect>Required Settings
294 <p>
295
296 The bootstrap partition is identified with <tt>boot=boot-partition</tt>,
297 where boot-partition is the Linux-style path to the bootstrap partition. If
298 you followed our partitioning recommendations on your internal hard disk,
299 that would be <tt>boot=/dev/hda2</tt>.
300
301 <p>
302
303 For PowerMacs, a magicboot line such as
304 <tt>magicboot=/usr/local/lib/yaboot/ofboot</tt> is also required. Several
305 models cannot execute a straight ELF, and need a CHRP script (which this
306 line in the <file>yaboot.conf</file> makes available).
307
308 <p>
309
310 The <tt>partition=</tt>, <tt>image=</tt>, and <tt>root=</tt> settings (under
311 kernel image settings below) are also required.
312
313 <sect>Boot Menu Options
314 <p>
315
316 A CHRP script (<file>ofboot</file>) has been provided which
317 <prgn>ybin</prgn> will modify using <file>yaboot.conf</file> settings, to
318 display a very handy multi-OS boot menu.
319
320 <p>
321
322 If you are setting up a multi-OS boot menu, you'll need to identify the
323 partitions where each OS lives. You can use Linux-style or OpenFirmware
324 partition paths. Here are some examples illustrating the possibilities:
325
326 <example>
327      macos=/dev/hda10
328      macosx=/dev/hda12
329      darwin=hd:9
330      bsd=zip:1
331 </example>
332
333 When using <tt>macosx=</tt>, if you have OSX installed on a UFS partition,
334 then point the macosx to the OSX bootstrap partition, not the UFS root.
335 Don't be tempted to use the OSX bootstrap partition for <prgn>ybin</prgn>,
336 however &mdash; you still need a separate Apple_Bootstrap partition.
337
338 <p>
339
340 When using <tt>bsd=</tt>, on the other hand, point to the BSD root
341 partition, not a bsd bootstrap partition. To use <tt>bsd=</tt>, you also
342 need to have the bsd bootloader (ofwboot) available in
343 <file>/usr/local/lib/yaboot/</file> when running <prgn>ybin</prgn>.
344
345 <p>
346
347 If nothing is selected from the boot menu when it appears, the system
348 launches <prgn>yaboot</prgn> to start Linux. To launch another OS when no
349 key is pressed, add a <tt>defaultos=</tt> line, for example
350 <tt>defaultos=macos</tt> or <tt>defaultos=bsd</tt>.
351
352
353 <sect>Kernel Image Settings
354 <p>
355 Kernel images to be launched by yaboot can be kept on any partition,
356 in an ext2, ext3, XFS, ReiserFS, or HFS/HFS+ filesystem. Yaboot will
357 need to know the kernel partition number and filesystem path.
358
359 <p>
360
361 The <file>yaboot.conf</file> file has two sections; most options are in the
362 global section at the top of the file, and options pertaining to separate
363 kernel images are grouped together below. Most kernel image options may be
364 specified either globally or locally; a global option is overridden if it is
365 re-specified in a kernel image section. Each kernel image section begins
366 with an <tt>image=/</tt> line specifying the filesystem path to that kernel
367 image; the first <tt>image=/</tt> line marks the end of the global section.
368
369 <p>
370
371 Yaboot must know the device, partition number, and filesystem path for the
372 kernel image that is to be loaded and started. However, <tt>device=</tt> is
373 usually not necessary, because if you don't specify it <prgn>yaboot</prgn>
374 assumes it will find the kernel on the same device it was booted from, which
375 is quite often true. You should always supply the kernel partition number,
376 for example <tt>partition=3</tt>, and of course the image path (for example
377 <tt>image=/boot/vmlinux</tt> ). If your kernel image is at the root level of
378 the partition, don't forget to include the leading slash when specifying the
379 image path (<tt>image=vmlinux</tt> will probably fail).
380
381 <p>
382
383 It's worth noting that <prgn>yaboot</prgn> locates the kernel image within a
384 partition's filesystem without regard to where that partition will
385 eventually be mounted within the Linux root filesystem. So, for example, if
386 you've placed a kernel image or symlink at /boot/vmlinux, but /boot is
387 actually a separate partition on your system, then the image path for
388 <prgn>yaboot</prgn> will just be <tt>image=/vmlinux</tt>.
389
390 <p>
391
392 You must also specify the Linux partition path for the root partition, for
393 example <tt>root=/dev/hda3</tt>. This parameter is passed to the kernel when
394 it starts up to let it know where its root filesystem is located. Many other
395 options are available to pass additional boot parameters to the kernel
396 (<tt>append=</tt>), specify initial ramdisk size (<tt>ramdisk=</tt>), load a
397 ramdisk image (<tt>initrd=</tt>), and others. Refer to the yaboot.conf man
398 page for details on kernel image options.
399
400 <p>
401
402 Here's a simple but complete example <file>yaboot.conf</file> with one
403 kernel image section:
404
405 <example>
406   # Where's the bootstrap partition
407   boot=/dev/hda2
408   # CHRP script spec
409   magicboot=/usr/lib/yaboot/ofboot
410   # Dual boot with MacOS
411   macos=hd:14
412   # How long to wait at the OS boot menu (seconds)
413   delay=5
414
415   # How long to wait at the boot: prompt (tenths of a second)
416   timeout=50
417   # Globally identified root partition
418   root=/dev/hda3
419   # The device where the kernel lives
420   device=hd:
421
422   # Kernel image section begins here
423   # Specify the filesystem path to the kernel image, symlinks are OK
424   image=/vmlinux
425       # Specify the partition number where this path is valid
426       partition=3
427       # Add a label, you can type this at the boot: prompt to load this kernel
428       label=Linux
429       # Specify the type of root fs mounting, read-only allows fsck to run
430       read-only
431
432   ## You must run ybin for changes to take effect!!!!!!!
433 </example>
434 <p>
435
436 To netboot a kernel image via tftp, use <tt>image=/tftpboot/vmlinux</tt> (the
437 path on the tftp server) and <tt>device=enet:10.0.0.1</tt>
438 (substituting the tftp boot server IP address).
439
440 <p>
441
442 Normally the first image specified in the <file>yaboot.conf</file> will be the
443 image booted if no entry is made at the boot: prompt. To have another
444 image loaded by default, add a <tt>default=label</tt> line in the global
445 section.
446
447
448 <sect>Optional and Cool Settings
449 <p>
450
451 Yaboot and your multiboot menu can throw a splash of color into your life!
452 Use <tt>fgcolor=</tt> and <tt>bgcolor=</tt> lines to set your screen to wake
453 you up in the morning with black, blue, light-blue, green, light-green,
454 cyan, light-cyan, red, light-red, purple, light-purple, brown, light-gray,
455 dark-gray, yellow, and white. Make fgcolor and bgcolor the same if you'd
456 really like a challenge.
457
458 <p>
459
460 Add any or all of enableofboot, enablenetboot, or enablecdboot to add
461 the respective options to your OS boot menu: boot from OpenFirmware,
462 the network, or CDROM.
463
464 <p>
465
466 Use Set delay= (in seconds) to determine how long the multiboot OS menu
467 should wait before booting the default OS. <tt>timeout=</tt> (in tenths of
468 seconds) to set how long yaboot should wait at the boot: prompt for
469 you to choose a kernel image before booting the first image in the
470 file or the <tt>default=</tt> image.
471
472 <p>
473
474 Booting password protection is available using a <tt>password=</tt> line.
475 When you add <tt>password=</tt>, a password will be required for all booting.
476 Automatic booting is not possible unless a <tt>restricted</tt> line is added.
477
478 <p>
479
480 If <tt>restricted</tt> is added in the global section, kernel images defined
481 in <file>yaboot.conf</file> may be booted as long as no arguments are added
482 at the boot: prompt. This is useful for unattended booting, while preventing
483 the instant rootshell problems of console access (though OpenFirmare
484 passwords are also needed to make this really secure, along with locking the
485 case). To boot an undefined image, or any image with additional arguments, a
486 password will be required.
487
488 <p>
489
490 The <tt>password=</tt> line may either be a plaintext password or an MD5
491 hash (the same format as the Linux <file>/etc/shadow</file> file). To make an
492 md5 hash use the following perl snippet:
493
494 <example>
495     $ perl -e 'printf("%s\n", crypt("secret", "\$1\$saltstrg"))'
496 </example>
497 The saltstrg should be a random string, for example one generated by
498
499 <example>
500     makepasswd --chars=8
501 </example>
502
503
504 <chapt>Saving Boot Configuration Changes
505 <p>
506
507 There are currently three utilities provided to save your boot configuration
508 changes to the boot partition: <prgn>ybin</prgn>, <prgn>mkofboot</prgn>, and
509 <prgn>yabootconfig</prgn>. Ybin copies <prgn>yaboot</prgn>,
510 <file>yaboot.conf</file>, and the CHRP script to the boot partition, and
511 then performs the necessary blessing. Mkofboot initializes the bootstrap
512 partition, then runs <prgn>ybin</prgn>. And <prgn>yabootconfig</prgn>
513 creates a working <file>yaboot.conf</file> and then runs
514 <prgn>mkofboot</prgn>. For details and options of these utilities, see the
515 associated man pages or type the utility name followed by --help on the
516 command line.
517
518
519 <chapt>Common Mistakes
520 <p>
521
522 The most common mistake made in the usage of <prgn>yaboot</prgn> is trying
523 to use it to boot from a mountable partition on a permanent basis. When a
524 PowerPC first starts up, the booting process is started by locating a
525 so-called `blessed' folder. The MacOS places the blessing so that multiple
526 system folders may exist on a partition, but only one of them will be valid
527 for starting up. If the computer is set up to dual boot Linux and MacOS,
528 when MacOS is booted it will unbless any folders which do not contain a
529 valid MacOS system. Then the next time the machine boots, the partition
530 containing the formerly blessed folder will not be bootable.
531
532 <p>
533
534 The utilities provided with <prgn>yaboot</prgn> should always be used to set
535 it up on its own bootstrap partition for regular booting needs. The only
536 time you should place <prgn>yaboot</prgn> on a mountable partition is for
537 initial installation of Linux and rescue operations. In those cases you can
538 intervene in the normal bootloading process to request a specific file to be
539 executed, and blessed folders are not an issue since this type of booting is
540 not automatic.
541
542 <p>
543
544 After <prgn>yaboot</prgn> has been installed, another common mistake is
545 changing the boot configuration file or updating the <prgn>yaboot</prgn>
546 software and then failing to re-run the <prgn>ybin</prgn> utility to
547 transfer the changed configuration to the boot partition. Booting functions
548 will not be changed unless the changes are saved to the bootstrap partition.
549 If you change your <file>yaboot.conf</file> often, you might want to add a
550 comment line inside the <file>yaboot.conf</file> file to remind yourself to
551 run <prgn>ybin</prgn> after making changes.
552
553
554 <chapt>Recovering From Misconfiguration
555 <p>
556
557 If you have a problem booting, don't panic. Yaboot can boot any
558 installed Linux kernel and system from the boot: prompt.
559
560 <sect>Resetting the NVRAM
561 <p>
562
563 Hold the Command-Option-p-r keys all together at startup to reset all nvram
564 parameters to their factory defaults. Hold the keys until you hear the
565 startup chime two or three times. If the setup recommendations were
566 followed, the <prgn>yaboot</prgn> installation will be be the first bootable
567 partition and OpenFirmware will boot it automatically. It should be noted
568 that MacOS settings such as virtual memory, startup disk, and screen
569 resolution will also be reset to their defaults.
570
571
572 <sect>Loading Yaboot
573 <p>
574
575 If a <tt>boot:</tt> prompt isn't presented, then <prgn>yaboot</prgn> isn't
576 being loaded. You can load it manually from
577 OpenFirmware. Holding the Command-Option-o-f keys all together after
578 pressing the power-on key will give you an OpenFirmware prompt
579
580 <example>
581     0 >
582 </example>
583 (Command is the key with the cloverleaf and/or apple engraved on it).
584
585 <p>
586
587 At the OF prompt, you will need to use OpenFirmware paths for most of
588 the boot configuration items. You can determine most OpenFirmware
589 paths from the OF prompt using a few OF commands, then construct an OF
590 boot command to directly boot your kernel.
591
592 <p>
593
594 The full OpenFirmware path consists of three parts in the format
595
596 <example>
597     device-name:partition-number,/filesystem-path
598 </example>
599
600 <p>
601
602 The OF command devalias will list all the device aliases effective on
603 your system. You may see some of these:
604 <example>
605   Name      Device Type
606   ----      --------------------------------------------------
607   hd        internal ide drive (primary controller, master disk)
608   ultra1    internal ide drive (primary controller, slave disk)
609   ide0      ide drive (secondary controller, master disk)
610   ide1      ide drive (secondary controller, slave disk)
611   cd        CD-ROM
612   zip       Zip drive
613   fw        FireWire interface
614   fd        Floppy drive
615   enet      Ethernet interface
616 </example>
617
618 Append the partition number of the boot partition (in our recommendation, 2)
619 and then follow that with <tt>,yaboot</tt> to boot the <prgn>yaboot</prgn>
620 file on the boot partition.
621
622 <example>
623     0 > boot hd:2,yaboot
624 </example>
625 <p>
626
627 Hit return, and <prgn>yaboot</prgn> should be loaded and display its
628 <file>boot:</file> prompt. If you don't know the partition number, just
629 start at 2 and work your way up until you hit it.
630
631 <sect>Manually Loading a Kernel Image
632 <p>
633
634 Once you have the boot: prompt, you can enter a label defined in your
635 <file>yaboot.conf</file> to boot that kernel image. Or instead of a label,
636 you can enter a full OpenFirmware path. A typical kernel path might be
637
638 <example>
639     boot: hd:3,/vmlinux
640 </example>
641
642 To pass parameters to the kernel, add them on to the <tt>boot:</tt> prompt
643 line after the kernel label or path. You'll need to specify <tt>root=</tt>
644 as a minimum, but you can add any kernel parameters desired. Here's an
645 example;
646
647 <example>
648     boot: hd:3,/vmlinux root=/dev/hda3 ro
649 </example>
650
651
652 <chapt>Yaboot as a Temporary Bootloader
653 <p>
654 It's very convenient for certain tasks like installing a new system
655 the first time without a CD, or rescuing an existing system, to boot a
656 ramdisk system such as an installer directly from files placed on an
657 existing partition.
658
659 <p>
660
661 An example is the Debian installer. It is contained in a floppy-image
662 root.bin file which <prgn>yaboot</prgn> can boot directly. A simple
663 <file>yaboot.conf</file> to initialize the ramdisk, yaboot, root.bin, and a
664 kernel image (named linux in this example) are all that is needed. All files
665 are placed at the root level on an existing partition.
666
667 <p>
668
669 The <file>yaboot.conf</file> file for this purpose contains just
670 four lines:
671 <example>
672     image=linux
673     label=install
674     initrd=root.bin
675     initrd-size=8192
676 </example>
677 <p>
678
679 If you create <file>yaboot.conf</file> in the MacOS, you must convert
680 it to use Unix newlines (linefeeds only). If you use MacOS newlines
681 (just carriage returns), <prgn>yaboot</prgn> will be unable to read the file.
682
683 <p>
684 You must pick a partition that is formatted with either HFS or HFS+.  If
685 you have Mac OS X installed on a UFS partition (You can use the OS X "Disk
686 Utility" app to check this), you will have to find another partition to use.
687 If Mac OS X is installed on UFS, you probably have one or two partitions
688 of the "Apple_Boot" type.  They have HFS filesystems on them.  Pick one,
689 mount it under MacOS X, and store the files there.
690
691 <p>
692 Boot into OpenFirmware, and type at the prompt:
693 <example>
694     0 > boot hd:xx,yaboot
695 </example>
696
697 replacing xx with the partition number of the partition where the
698 kernel and <prgn>yaboot</prgn> files were placed, followed by a return. At the
699 boot: prompt, type <em>install</em> followed by a return.
700
701
702 <chapt>For More Information
703 <p>
704
705 Where's home?
706 <list>
707 <item>    <url id="http://penguinppc.org/bootloaders/yaboot/" name="Yaboot Home">
708 </list>
709
710 <p>
711
712 How do I install Debian?
713 <list>
714 <item>    <url id="http://www.debian.org/releases/woody/powerpc/install"
715     name="Installing Debian GNU/Linux 3.0 For PowerPC">
716 </list>
717
718 <p>
719
720 What's Open Firmware?
721 <list>
722 <item>    <url id="http://developer.apple.com/technotes/tn/tn1044.html">
723 <item>    <url id="http://developer.apple.com/technotes/tn/tn1061.html">
724 <item>    <url id="http://developer.apple.com/technotes/tn/tn1062.html">
725 <item>    <url id="http://developer.apple.com/technotes/tn/tn1167.html">
726 </list>
727
728
729 </chapt>
730   </book>
731 </debiandoc>
732
733
734 <!-- Keep this comment at the end of the file
735 Local variables:
736 mode: sgml
737 sgml-omittag:t
738 sgml-shorttag:t
739 sgml-namecase-general:t
740 sgml-general-insert-case:lower
741 sgml-minimize-attributes:max
742 sgml-always-quote-attributes:t
743 sgml-indent-step:2
744 sgml-indent-data:nil
745 sgml-parent-document:nil
746 sgml-declaration:nil
747 sgml-exposed-tags:nil
748 sgml-local-catalogs:nil
749 sgml-local-ecat-files:nil
750 End:
751 -->