How to setup QEMU/KVM with EFI to test Foreman PXE

Hey,

I've put together instructions how to setup QEMU KVM environment to test
EFI PXE booting with PXELinux.

http://lukas.zapletalovi.com/2014/09/efi-in-qemu-kvm-on-fedora-20.html

Tomorrow, I want to carry on with a patch for our installer which will
configure DHCP to hand over EFI firmware in case EFI-enabled systems is
booted.

Unfortunately for PXELinux one needs to download 6.03-pre20 release to
get this working because EFI support in PXELinux is not as mature as in
Grub 1/2. But since Foreman ships with PXELinux by default, I wanted to
do the same for EFI-based systems.

Both RHEL6 and RHEL7 ship with grub (1 and 2 respectively) and already
contain EFI firmware whould could be probably extracted by our installer
on the TFTP server. We should be able to preconfigure Foreman systems
for EFI PXE booting with Grub. But I don't know if we should make Grub
the default choice for EFI-based systems.

While we could add a feature that would download the syslinux from the
upstream site, unpack and put the right files on the TFTP server too,
this is only doable upstream. For downstream or for those who do not
prefer to install any software that was not delivered by distribution
this is kinda blocker.

Also, I am not sure how Foreman supports Grub1/2 when a host is put into
provision mode. AFAIK grub loader does not load the configuration using
the PXELinux pattern (pxelinux.cfg/MAC-ADDRESS). If we don't have that
support, it is not feasible to ship with Grub as the default option I
guess.

What you think?

··· -- Later, Lukas #lzap Zapletal

> Both RHEL6 and RHEL7 ship with grub (1 and 2 respectively) and already
> contain EFI firmware whould could be probably extracted by our installer
> on the TFTP server. We should be able to preconfigure Foreman systems
> for EFI PXE booting with Grub. But I don't know if we should make Grub
> the default choice for EFI-based systems.
>
> While we could add a feature that would download the syslinux from the
> upstream site, unpack and put the right files on the TFTP server too,
> this is only doable upstream. For downstream or for those who do not
> prefer to install any software that was not delivered by distribution
> this is kinda blocker.

After some discussion with Ohad, I will carry on with investigating how
Grub 1/2 integrates with PXELinux. It looks like it has same or similar
patter how it finds configuration files (IP/MAC address) but I believe
the syntax is different.

It really looks like adding support for Grub 1/2 is the most feasible
way how to support EFI in Foreman. We could either do this as a switch
for each host (BIOS/UEFI) or deploy configuration files twice on the
TFTP server. Let's identify how complex this would be.

··· -- Later, Lukas #lzap Zapletal