# Yaboot-&yaboot-version;

## Installation of Yaboot

Yaboot defaults to build as 32bit, so we need to pass appropriate options to both the compiler and the linker. To prevent the build from failing due to compiler warnings, the -Werror flag is removed. The Makefile already overrides any CC and ignores LDFLAGS in favour of its own variables, so we need to use the following seds for a successful compile and install.

    sed -i -e "s/m32/m64/g" \
        -e "s/-Werror//" \
        -e "s/elf32ppclinux/elf64ppc/" Makefile

## The meaning of the sed parameters:

`"s/m32/m64/g"`

- Replaces -m32 wih -m64 to force `gcc` to create 64-bit code when compiling yaboot.

`"s/-Werror//"`

- This deletes the -Werror flag from the Makefile.

`"s/elf32ppclinux/elf64ppc/"`

- This replaces the 32 bit emulation with a 64 bit emulation flag to force `ld` to use a suitable 64-bit emulation picked from the output of `'ld -V'`.

    make PREFIX=/usr

The install of yaboot can fail if you miss any of the patches or seds. `ld` will issue warnings, but the install will appear to complete successfully. That would result in an unbootable system, so you need to log the output to check it.

    make PREFIX=/usr install 2>&1 | tee instlog

To ensure that the install was successful, run the following command:

    grep 'powerpc:common64' instlog

If the command gave you any output (... is incompatible with powerpc:common output) the build of yaboot is broken and you will have to correct your error(s) and repeat it.