pmb.qemu: Support booting with OpenFirmware

The normal way of booting a PowerPC machine is OpenFirmware. QEMU ships with SLOF (Slimline Open Firmware) and uses it by default to boot VMs unless direct kernel boot is used. Let's use it by default and stop using direct kernel boot on ppc64le.

PowerPC devices using Open Firmware typically come with two partitions: one PReP boot partition that is 1-8MB large and holds the bootloader (GRUB) and one for the root filesystem.

GRUB hates being installed in a chroot and has very hard dependencies on a somewhat properly populated /dev and /sys. Since we need to invoke grub-install with the PReP boot partition as a parameter, we can only run it in the native chroot, so grub must be installed in the native chroot. Also, it cannot guess the modules necessary for booting since it's running in a chroot, so we need to hardcode them. The name of the device GRUB is being installed must be the one reported by the SysFS, so we need to install it to /dev/loop0p1 instead of /dev/installp1.

Edited by Aelin

Merge request reports

Loading