Foreman not generating grub.cfg with mac address

pxe boot is searching for grub2/grub-mac_adress file which is not present under grub2, how can I generate it for ubuntu:20.04

Make sure to select the grub2 pxe loader for the host.

1 Like

Hi there,

I’ve got the same problem with Ubuntu 20:04. Grub2 files are not generated when clicking “Build” button.
It’s working great with PXELinux and Legacy bios boot but with Grub2 UEFI, no files are generated.

The “Preseed default PXEGrub2” template is associated with the operating system, Grub2 UEFI is selected as the PXE Loader from the Host Group.

When clicking “Build”, we can read into log file:

2022-05-11T15:03:43 [I|app|92ad0925] Skipping TFTP PXELinux configuration for REDACTED
2022-05-11T15:03:43 [I|app|92ad0925] Fetching required TFTP boot files for REDACTED

Looks like templating step results in no content. But i don’t understand why :frowning:

Any insight ?

Thanks !

According to Foreman code, the error is coming from

logger.info "Skipping TFTP #{kind} configuration for #{host.name}"
(foreman/tftp.rb at e231a35e05dc4b958c3244d674deeb21654b11d8 · theforeman/foreman · GitHub)

It seems that kind is set to PXELinux whereas it should be PXEGrub2.

Changing the “kind” order in app/models/operatingsystem.rb like this

  def template_kinds
    ['PXEGrub2', 'PXELinux', 'PXEGrub', 'iPXE']
  end

allows the grub2 files to be generated.
It is not a viable workaround i guess, but may be it can help to determine the root cause ?