The Yaboot package contains a PowerPC Boot Loader for machines using Open Firmware such as NewWorld Macintoshes.
Yaboot has a compilation error. The following patch properly fixes the issue:
patch -Np1 -i ../yaboot-1.3.13-fix-1.patch
The following patch removes a redundant test which prevents ofpath from executing against SATA disks:
patch -Np1 -i ../yaboot-1.3.13-ofpath_sata-1.patch
Existing multilib distributions alter gcc to default to 32-bit output. Because our gcc defaults to 64-bit, we need to pass appropriate options to both the compiler and the linker. 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/\(-print-libgcc-file-name\)/${BUILD32} \1/" \ -e "s/\(-Bstatic\)/-melf32ppclinux \1/" Makefile
The meaning of the sed parameters:
This picks a convenient place within the Makefile's lgcc variable and inserts the flag to force gcc to create 32-bit code when compiling yaboot.
This picks the end of the LFLAGS which the Makefile passes to the linker to create the second-stage linux loader, and inserts a flag to force ld to use a suitable 32-bit emulation picked from the output of 'ld -V'.
The supplied man pages have /usr/local in the text. This sed will correct that:
sed -i 's%/usr/local%/usr%' man/*
Compile the package:
CFLAGS="${BUILD32}" make PREFIX=/usr
Install the package:
The multilib install of yaboot can fail if you miss any of the patches or seds, or omit the CFLAGS variable. 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.