PPC: Configure the lilo bootloader on PowerPC machines

Support knowledgebase (olh_ppc_lilo)
Applies to

SuSE Linux PowerPC: Version 6.4+

"lilo" is a frontend for the various bootloaders on PowerPC machines. An easy configuration file simplifies setting up the various bootloaders. The configuration is very similar to setting up lilo on an x86 machine.

These bootloaders will be configured:

Please note that we have no real bootloader on PReP based machines. The firmware on these machines gives us no chance to access an external devices such as a hard drive. The kernel image zImage.prep will be booted; it contains a little program to enter additional kernel parameters. To change these defaults permantently you have to recompile the kernel.

We can not configure the bootloader, BootX, on older PowerMacs and Mac clones. There is no secure way to determine whether or not a partition is in the new HFS+ format. Please configure BootX with MacOS, you need only the root partition of your Linux installation in most cases. The configuration of BootX is explained in a separate SDB article.

Procedure:

A simple lilo.conf file could look like this:

boot=/dev/_your_boot_partition
timeout=100
default=linux
image=/boot/vmlinux
        label=linux
        root=/dev/hda11
        append=" optional kernel argumente"
image=/boot/vmlinux.new
        label=new
        root=/dev/hda11
other=/dev/_your_macos_partition
        label=macos
lilo use this config file to generate the needed config files for the bootloaders and to copy them to the right places.

* PowerMac new:

On new PowerMacs (iMac and later) the bootloader yaboot is used. A separate SDB article explain the configuration of yaboot with more details.

You need a small partition in standard HFS format, size ~ 32MB. This partition contains the needed file for the OpenFirmware to load yaboot.

The section "other=" is only needed when you have also MacOS installed on your machine. Use the spacebar to choose between MacOS and Linux at system startup time.
If the section "other=" is activated with the option "default=" the MacOS will be booted per default, otherwise it defaults to Linux.

Some SCSI controllers, such as the Adaptec 2906, are not bootable. Your boot partition must be on a bootable drive, but the kernel and your Linux installation can remain on the non-bootable drive. The option "copy" tells lilo to copy all needed files and the kernel onto the boot partition.

* PowerMac old:

On older PowerMacs and Mac clones, the use of BootX is recommended if you want to dual boot between MacOS and Linux. There is a separate SDB article that explains the configuration of BootX.

lilo can only setup the bootloader MiBoot. This is a stripped-down BootX that can live without MacOS. Unfortunately, it is not possible to dual boot with this configuration. Miboot is designed for Linux only machines (no MacOS).

miboot does not read a config file. The only needed paramter is the correct root device for the kernel. We use an initrd (initial ramdisk) to change that at boot time. You can edit the file System.bin either with ResEdit or a hexeditor to modify the kernel args. There is no need to modify that file for most configurations.

You need a small partition in standard HFS format that contains the needed files for the boot process.

lilo uses only the lines "boot=" and "default=" to copy the needed files to that boot partition.

* RS/6000 (CHRP):

We use yaboot on the IBM RS/6000 machines, rather than the older bootloader quik. There is a separate SDB article which explains the configuration of yaboot in detail.

You need a small partition with type "41 PReP boot partition". This partition is automatically generated by yast if you choose "configure whole hard drive". This partition must not be larger than 4MB. The partition must be labeled as active.
The bootloader, yaboot, will be written raw onto that partition. Make sure that the multiboot menu in the OpenFirmware boots that partition.

yaboot looks for partitions with an ext2 format and a file /etc/yaboot.conf on that partition. It looks from the highest partition number to the lowest partition number. The first matching partition must also contain the configured kernel file.

The option "other=" will be ignored on CHRP. There is no way to boot AIX from the yaboot prompt.

* PReP machines:

The Firmware of PReP machines can not be used to access external devices such as hard drives to load a kernel file. This is the reason why there is no bootloader. The file arch/ppc/boot/zImage will be written raw into a partition of type "41 PReP boot partition". There is a little program that allows you to enter kernel parameters. If you want to change the default parameters permanently, you have to recompile the kernel. The compiled cmd_line can be edited since kernel version 2.4.12:

  - Check the file lenght of /boot/zImage.prep
ls -l /boot/zImage.prep
  - Open /boot/zImage.prep with vi in binary mode:
vi -b /boot/zImage.prep
  - Search for the string 'root=/dev/sda3':
/root=
  - Use the vi command 'R' to replace the existing whitespaces.
  - Use the escape key to leave the replace mode.
  - The vi command ':x' will safe the changes.
  - The vi command ':q!' will leave vi without safing your changes.
  - Check the file length of /boot/zImage.prep again:
ls -l /boot/zImage.prep
  - It _must_ not differ with the previuos length.

More configure options:

activate

  This option activates the boot partition. It is only used on PReP and CHRP
  to activate the "41 PReP boot partition". That feature is not yet
  implemented on PowerMacs.

boot=/dev/partition

  This options points to your boot partition. It must be the partition of type
  "41 PReP boot partition" on PReP and CHRP.
  The file zImage.prep will be written onto that partition on PReP.
  The file yaboot will be written onto that partition on CHRP.
  The partition must contain a standard HFS format on PowerMacs, lilo will
  copy the needed files onto that partition.
  To initialize such a partition on a PowerMac, use these commands (all data is lost
  on that partition!):
  
    dd if=/dev/zero of=/dev/_boot_partition_number
    hformat /dev/_boot_partition_number

bootfolder=suseboot

  This option contains the name of the folder where all the needed files for
  booting are stored. There is no need to change this name.

default=labelname

  This contains the name of the section that should be booted per default. It
  can be used to boot MacOS per default on PowerMacs.

timeout=100

  Specifies the number of tenths of a second the boot loader should wait
  before booting the default image.
  100 means 10 seconds.


options for an image section:

  image=/path/to/kernelfile
  
    This is the path to a valid kernel image file. Use a plain vmlinux.

  label=
  
    This is the name of that section.

  root=/dev/linux_root_partition

    This is the root partition of your Linux installation. You can use the
    command " df / " to see the active root partition.

  append="kernelparameters"

    This option allows you to set some kernel parameters at boot time, as
    example for the serial console.

  initrd=/path/to/initrd

    This is a pathname to an initrd file. Such a file is used at installation
    time to load the installer. It is not needed in most cases.

  copy

    This option forces lilo to copy all files onto the boot partition. This
    gives you the chance to boot into the installer (with the initrd option)
    when your installation is damaged.



other=/path/to/macos_installation

  This option allows you to boot into MacOS. The os-chooser is used. Use the
  spacebar at system boot to switch between MacOS and Linux.
  This option requires the option "label=" , the name doesnt matter.

The current version of lilo can be found here:

ftp://ftp.suse.com/pub/projects/powerpc/lilo/lilo.rpm
The source code of the current version is also available:
ftp://ftp.suse.com/pub/projects/powerpc/lilo/lilo.spm


Keywords: PPC, POWERPC, APPLE, RS6000, YABOOT, QUIK, BOOT, LILO, PREP

Categories: Power PC

SDB-olh_ppc_lilo, Copyright SuSE Linux AG, Nürnberg, Germany - Version: 30. Okt 2000
SuSE Linux AG - Last generated: 03. Dez 2001 by olh (sdb_gen 1.40.0)