From Gentoo Wiki
Jump to:navigation Jump to:search

GRUB Installation on PowerMac G5

On Linux/PPC64 we can use GRUB as a bootloader.

Using GRUB


root #emerge --ask sys-boot/grub

Setup bootstrap partition

First we need prepare the bootstrap partition we created when preparing the disk at the start which should be /dev/sda2 but we can confirm this by using parted (if not installed you can do this by emerging the sys-block/parted package).

Replace /dev/sda with the correct drive letter if required.

root #parted /dev/sda print

Model: ATA Patriot Burst El (scsi)

Disk /dev/sda: 120GB

Sector size (logical/physical): 512B/512B

Partition Table: mac

Disk Flags:

Number Start End Size File system Name Flags

1      512B    32.8kB  32.3kB               Apple
2      32.8kB  852kB   819kB   hfs          bootstrap  boot
3      852kB   538MB   537MB   ext4         Boot
4      538MB   54.2GB  53.7GB  ext4         Gentoo

As we can see from this output partition 2 has the bootstrap infomation so we know /dev/sda2 is correct partition to use. We need to format this as HFS using the hformat command which is part of the sys-fs/hfsutils package.

root #dd if=/dev/zero of=/dev/sda2 bs=512
root #hformat -l bootstrap /dev/sda2

Create a directory to mount the bootstrap partition and then mount it.

root #mkdir /boot/NWBB
root #mount /dev/sda2 /boot/NWBB

Setup GRUB

root #grub-install --macppc-directory=/boot/NWBB /dev/sda2

If it installs without errors you can now unmount the bootstrap.

root #unmount /boot/NWBB

We now need bless the partition so it will boot for us.

root #hmount /dev/sd2
root #hattrib -t tbxi -c UNIX :System:Library:CoreServices:BootX
root #hattrib -b :System:Library:CoreServices
root #humount

Finally we need to build the grub.cfg file:

root #grub-mkconfig -o /boot/grub/grub.cfg