13.3. Making the CLFS System Bootable

Images (kernels) are specified, together with any necessary path, in yaboot.conf - the details are incorporated into the bootloader, but no attempt is made to access or validate the paths until they are selected. There are many possible options that can be specified in yaboot.conf, see the man page for the details. Most people will be able to specify device=hd: (for a single hard disk), but if you have multiple disks, or if you wish to be pedantic, you can specify the full OF path to the device, obtained by running ofpath /dev/hdX .

Using the above information, determine the appropriate designators for the bootstrap partition and the root partition. For the following example, it is assumed that the bootstrap partition is hda2 and the root partition is hda7. We will also assume that you wish to be able to boot an OSX installation on hda4. Change these items as necessary for your machine.

If your machine has a SATA disk, specify the partitions using /dev/sda7 and so forth in the usual way. At least some of the distros specify a full OF path to the 'device' and to the image(s), such as device=/ht@0,f2000000/pci@3/k2-sata-root@c/k2-sata@0/disk@0: for the disk, and image=/ht@0,f2000000/pci@3/k2-sata-root@c/k2-sata@0/disk@0:9,/boot/clfskernel-3.14.13 which definitely works.

Create a “yaboot.conf” file defining yaboot's boot menu:

cat > /etc/yaboot.conf << "EOF"
# Begin /etc/yaboot.conf

# By default, yaboot will boot the first menu entry.

# Allow 10 seconds before booting the default.
# this will also apply to the first-stage os selector
timeout=100

# These variables are global
# first, where to put the bootstrap partition
boot=/dev/hda2

# Which disk to use
device=hd:

# Default partition for the kernel images
partition=7

# default root partition
root=/dev/hda7

# where ybin is to find yaboot and ofboot
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot

# allow the initial menu to offer CD as an option
enablecdboot

# allow the initial menu to offer booting from Open Firmware
enableofboot

# allow the initial menu to boot from mac osx
macosx=/dev/hda4

# white on black is boring!
# note  the spellings : 'fgcolor' but 'light'
# in this context, light means 'without high intensity'
fgcolor=light-green

# The first entry is for CLFS.
# For all images, the pathname is relative to the filesystem
# on which they are situated and can include at most one
# directory
image=/boot/clfskernel-3.14.13
    label=3.0.0-RC1
    read-only
EOF

Add an entry for the host distribution, if you have one. It might look something like this if the kernel and initrd are in the host's '/' directory on hda6:

cat >> /etc/yaboot.conf << "EOF"
title Debian
image=/pci@f4000000/ata-6d/disk@0:6,/vmlinux
    label=Debian
    initrd=/pci@f4000000/ata-6d/disk@0:6,/initrd.gz
    initrd-size=10000
    append="root=/dev/hda7"
    read-only
EOF
[Warning]

Warning

The following command will update the bootstrap partition and the boot variable in Open Firmware. Do not run the command if this is not desired.

ybin

You may see an error message referencing ioctl32 with 'Unknown cmd' and '/dev/nvram'. This does not appear to cause any problems.

Alternatively, if the bootstrap partition has not already been initialized, perhaps because you are using a Live CD, you will need to use a different command to install the bootloader for the first time:

mkofboot