PXEBoot not working for UEFI

Hello,

I've read some posts/issues about UEFI support for foreman:

and to be honest I've no idea what is the status for PXEbooting Debian OSes

First of all how to configure UEFI in foreman GUI?

  • the OS is supposed to have PXEGrub2 template set or not?
  • what is the meaning of PXE Loader dropdown in host creation screen? why
    PXELinux UEFI doesn't require grub template but grub(2) uefi does?
  • as I'm using dnsmasq (DHCPProxy) I assume those two aforementioned
    options doesn't have any effect on me? I should handle dhcp config myself?

For now lets assume I've configured it properly…
My issue is following:

The latest foreman comes with some grub2/grubx64.efi file and generates
the
grub2/grub.cfg-01-aa-bb-cc-dd-ee-ff which seems to be ok (for debian 8/9)
The grub2/grubx64.efi filename is served properly by dnsmasq (ver. 2.67
which is supposed to support UEFI)

But when I use e.g. notebook with UEFI, disable secure boot and enable
network boot, all what happens is:

  • dhcp discover is sent, offers (one from DHCP server one from proxydhcp)
    is sent
  • notebook hangs for like a 2 minutes and grub 2 shell appears…
  • in wireshark I see only tftp grubx64.efi download, no requests for
    grub.cfg-01-aa-bb… config file

I've seen some info about debian bootloader not downloading config file but
I've used the stock one that comes with foreman (which
I believe should download grub.cfg file)

How do I get UEFI boot to work?
How do I even debug it?
Do I understand correctly that grubx64.efi file should contain bootloader
that will download it's config file, (maybe) display some menu and start
automated installation?
If so, why I don't see any requests for grub.cfg-01-mac file?

Thank you in advance

I've taken closer look at *grub.cfg-01-MAC *and I believe it doesn't
generate properly.
It contains only:
Chainload Grub2 EFI from ESP, Chainload into BIOS bootloader on first disk, Foreman
Discovery Image
Which I believe is not enough, I see that my host's menuentry lies in:
pxelinux.cfg/01-MAC file
How does this file relate to grub.cfg? Shouldn't this entry land in
grub.cfg-01-MAC?

··· On Saturday, June 17, 2017 at 9:58:55 PM UTC+2, Stanisław Jakiel wrote: > > Hello, > > I've read some posts/issues about UEFI support for foreman: > - https://github.com/theforeman/foreman-bootloaders > - https://github.com/theforeman/community-templates/pull/346 > - https://github.com/theforeman/puppet-foreman_proxy/pull/324 > - http://projects.theforeman.org/issues/16654 > > and to be honest I've no idea what is the status for PXEbooting Debian OSes > > First of all how to configure UEFI in foreman GUI? > - the OS is supposed to have PXEGrub2 template set or not? > - what is the meaning of PXE Loader dropdown in host creation screen? why > PXELinux UEFI doesn't require grub template but grub(2) uefi does? > - as I'm using dnsmasq (DHCPProxy) I assume those two aforementioned > options doesn't have any effect on me? I should handle dhcp config myself? > > For now lets assume I've configured it properly... > My issue is following: > > The latest foreman comes with some *grub2/grubx64.efi* file and generates > the > *grub2/grub.cfg-01-aa-bb-cc-dd-ee-ff* which seems to be ok (for debian > 8/9) > The grub2/grubx64.efi filename is served properly by dnsmasq (ver. 2.67 > which is supposed to support UEFI) > > But when I use e.g. notebook with UEFI, disable secure boot and enable > network boot, all what happens is: > - dhcp discover is sent, offers (one from DHCP server one from proxydhcp) > is sent > - notebook hangs for like a 2 minutes and *grub 2 shell appears...* > - in wireshark I see only tftp grubx64.efi download, no requests for > grub.cfg-01-aa-bb... config file > > I've seen some info about debian bootloader not downloading config file > but I've used the stock one that comes with foreman (which > I believe should download grub.cfg file) > > How do I get UEFI boot to work? > How do I even debug it? > Do I understand correctly that grubx64.efi file should contain bootloader > that will download it's config file, (maybe) display some menu and start > automated installation? > If so, why I don't see any requests for grub.cfg-01-mac file? > > Thank you in advance >

I believe grub.cfg is a file used for a system we don’t know (based on it’s MAC address). grub.cfg-01-MAC is there for a system Foreman manages and either currently provision or has provisioned in the past. In the first case, it would contain instructions to boot the OS installer, in the second, it should contain the instruction to boot from the local disk.

The desired flow (as I understand it)

  1. machine gets the DHCP reply telling it to download grubx64.efi from the TFTP
  2. machine downloads and boots it
  3. machine then asks for menus, if one fails, it proceeds with another, the first that should succeed is grub.cfg-01-mac
  4. the menu contains instructions to start the debian installer (where to get the initramfs and the kernel, kernel parameters for the installed to get the preseed file)

Perhaps this material could help to better understand the process Provisioning Guide