This HOWTO is intended to outline the steps required to create a bootable ISO image for use on a Linux on POWER system. Some possible reasons for creating a bootable ISO image for Linux on POWER include creating a rescue Cd, creating a self-contained distribution that runs off the CD (e.g. Knoppix or a Live CD), or creating an installation CD for a new distribution. This paper also covers the software requirements and the file and directory structure needed to create a bootable Linux on POWER ISO image.
POWER - (Power Optimization With Enhanced RISC) 64-bit processor architecture found in many IBM servers that include the POWER3, POWER4, and POWER5 processor
Linux on POWER - running the Linux operating system on a POWER-based processors
PowerPC™ 970 - single core version of the 64-bit POWER4 processor
ISO image - a file that contains a copy of an entire filesystem, usually a CDROM ISO9660 filesystem
Open Firmware - a hardware independent boot firmware
PReP (PowerPC Reference Platform) - an early PowerPC hardware reference design
CHRP (Common Hardware Reference Platform) - a PowerPC hardware reference design, successor to PReP
initrd - initial ramdisk loaded by a linux kernel into RAM
ELF (Executable and Linking Format) - a standard file format
There are a few pieces of software that you will need before you start creating your ISO image. They are:
The mkisofs utility is now part of the cdrtools package and can be downloaded from ftp://ftp.berlios.de/pub/cdrecord/. Version 2.01 is the latest as of this writing, you'll want to make sure you have this version since it's important that you have the CHRP patch. To check if your version of mkisofs has the CHRP patch try the following command and look for the -chrp-boot option output:
[engel@powerbunk fs]$ mkisofs --help 2>&1 | grep chrp
-chrp-boot Add CHRP boot header
The yaboot utility is the Open Firmware bootloader that is used to load the ISO image and can be download from http://penguinppc.org/bootloaders/yaboot/. It must be compiled as a 32-bit application, even on a 64-bit platform. You can find more information about yaboot and configuration options at http://penguinppc.org/bootloaders/yaboot/.
The latest 2.4 or 2.6 linux kernel can be downloaded at ftp://ftp.kernel.org/pub/linux/kernel/.
This HOWTO should cover any POWER processor-based system running Linux including IBM POWER5, POWER4, and eServer BladeCenter JS20.
This section will pull together all the pieces needed to create a bootable ISO image for a Linux on POWER system.
The first step in creating the ISO image is to create the directory structure and create the necessary files. Here is an example of a working directory structure to get started.
<base_directory>/etc
/etc/yaboot.conf
/ppc/
/ppc/bootinfo.txt
/ppc/chrp/
/ppc/chrp/yaboot
/ppc/chrp/vmlinux
/ppc/chrp/ramdisk.image.gz
Let's take a look at each of these files and what they are used for:
This file is used to customize your yaboot configuration. The following example is a yaboot config file that shows the minimal options you need to get started.
init-message = "\nWelcome to XYZ Installation\n\n"
timeout=6000
default=linux
image=ppc/chrp/vmlinux
label=linux
initrd=ppc/chrp/ramdisk.image.gz
read-only
All of the yaboot configuration options can be found at http://penguinppc.org/bootloaders/yaboot/doc/yaboot-howto.shtml/ch6.en.shtml.
The CHRP boot process uses a bootinfo.txt configuaration file. You'll find more details on the CHRP boot process and bootinfo config variables at http://playground.sun.com/1275/bindings/chrp/chrp1_7a.ps. Here is an example bootinfo.txt:
<chrp-boot>
<description> XYZ Installation </description>
<os-name> My Distribution </os-name>
<boot-script>boot &device;:\ppc\chrp\yaboot</boot-script>
</chrp-boot>
The boot-script variable is important here as it lists where the yaboot binary is located.
This is the 32-bit yaboot binary. Your bootinfo.txt <boot-script> variable should point to this location.
A 2.4 or 2.6 linux kernel.
An optional initrd to load into memory. The initrd is documented in the kernel source tree at /usr/src/linux/Documentation/initrd.txt.
Now that we have the files laid out and configured with the correct options, we can use mkisofs to create the ISO image. As mentioned previously, it is important to make sure the version of mkisofs you have supports the -chrp-boot option.
The mkisofs man page lists all the options that can be passed on the command line, here is a simple set of options that will be enough to produce a bootable CD.
mkisofs -r -U -chrp-boot -o <image.iso> <base_directory>
You should now have a bootable ISO image that you can boot on a Linux on POWER system.
If you are creating an installation CD, you will probably be interested in how to install yaboot onto a PReP partition so you can boot from a hard drive. Here are three simple steps to get you started:
dd if=/your/path/yaboot of=/dev/sdaX
where /dev/sdaX is the PReP partition
/etcYou should now be able to boot from the PReP partition with yaboot installed on it.
Verify that the ISO image was created successfully by mounting the image over a loopback device.
mount -o loop /path/to/your/isoimage.iso /mnt/loop
If this fails, run the mkisofs command again and look for any errors.
You probably don't have the latest version of mkisofs. Upgrade and check for the -chrp-boot option.
[engel@powerbunk engel]$ mkisofs --help 2>&1 | grep chrp-boot
-chrp-boot Add CHRP boot header
Open Firmware will only recognize disks with valid ELF headers on them. Verify that the yaboot executables were written to the PReP partition correctly. Check the header of your PReP partition:
dd if=/dev/sda1 of=/tmp/prep.out count=10
And then look at the first few characters of /tmp/prep.out for the characters ELF.
The PReP partition must not be larger than 8MB and must be marked bootable in the partition map.
If you are at a prompt that looks like this:
ok
0 >
You are at the Open Firmware prompt. You can find information here on Open Firmware commands
http://developer.apple.com/technotes/tn/tn1061.html.
One reason for ending up at the Open Firmware prompt is the kernel is too large. Type reset-all at the prompt to reboot the system.
Trademarks and special notices