BOOT EFI issue - WorkStationPro 15.5 - Ubuntu 18.04.05 LTS - bionic

hi @lzap,

If I sum up correctly, the process of provisioning is the following:

  1. UEFI downloads grub2/grubx64.efi from TFTP

  2. GRUB2 looks for grub2/grub.cfg-[mac address]
    => I don’t know why ??

  3. Grub2 template contains the automated install configuration generated by Foreman

  4. GRUB2 downloads kernel (vmlinuz0) and initrd0.img and boots the kernel and starts the installer
    => from fdi-image/

  5. The image of the system is retrieved from the installation media specified in OS and from the client:
    => http://archive.ubuntu.com/ubuntu (in my case)

  6. After installation is complete, PXELinux template is changed back to chainload local disk

How can I generate a grubx64.efi which can work?

I wish I could use CentOS but I cannot, I must use Ubuntu 18.04.5 LTS.

Regards,

@Gueug78400

This looks like a bug we are looking into.

For the rest I don’t know what you’re after.

For better understanding I suggest you to read https://docs.theforeman.org/master/Provisioning_Guide/index-foreman.html

Grub2 in Red Hat automatically searches for these configuration files, if they are missing it skips. Grub2 in Debian does not have this feature patched-in so we emulate this behavior:

Grub2 should not fail on these. It should carry on, I don’t have Foreman on Debian myself but in CentOS this only shows warning/error but carries on.

Note there are some limitations for IPv6 provisioning. More about these in the guide.

Our installer generates grubx64.efi for you. Just run it again to have it regenerated.

I suggest you to start with BIOS to get an understanding how all bits fit together. Then move on to EFI.

hi @lzap,

I was focusing on grubx64.efi while something else was disturbuing the process. I had tested with Legacy BIOS and I knew it worked; I followed your advice and could not understand why it failed this time …

My apologies for your time spent on this. DHCP is a tricky thing, even though Foreman provided an IP address my BOX’s DHCP was interacting. I was sure that it could not be possible but:

Rule 1: If you want Foreman or any PXE solution to work, be sure not to have any other DHCP server in the area.

You can consider this request solved. Foreman is powerful and thanks to you @lzap and all the team for this product!!

@Gueug78400

WORD. :slight_smile:

For the record, this error happens when HDD is not selected as the second boot device.

https://github.com/theforeman/foreman/pull/8073/files

Hi @lzap,

Thanks for this information. I will continue my tests with different options, custom partitioning, different scripts, … I am very amazed to see such a support on Open Source; congrats!!!

Regards,

@Gueug78400

1 Like

Hi @lzap,

I wanted to finish on this after a new installation following exactly the same steps I did on Workstationpro.
I had this DHCP issue at first as I told you but what was strange I had another issue on my second installation which is a Bare Metal one:

Both grubx64.efi were not the same and I encounter the same issue I had on WorkStationPro:

The one which doesn’t work:
sha256sum grubx64.efi
f6f88693e6131383815e6eced2165a7fe9f3877ed154aa50f6a2467195c1a552 grubx64.efi

The one which works:
sha256sum grubx64.efi.working
e2ccd77013bdd4d15d5939675ed9a25c93b4f4c4b039268f9bd7787fae0f9b24 grubx64.efi.working

I don’t know why but for the same version of Foreman I got two different versions of grubx64.efi.

The result is a race between both files and at the end provisioning fails:
"/httpboot/grub2/grub.cfg-4c:d9:8f:ba:36:3b" octet blksize 1024 tsize 0
"/grub2/grub.cfg-4c:d9:8f:ba:36:3b" octet blksize 1024 tsize 0

I wanted to send these files but couldn’t … I don’t know how is this file generated but an insight would be cool!

Regards,

Gregory

This file comes from grub2-efi RPM package which installs it into /boot/EFI. Then Foreman installer copies this file (everytime you execute it if the file is older) from this location to /var/lib/tftpboot.

BUT. On Debian installation this is different, instead our installer uses grub-mknetdir command to compile the file from a grub2 subpackage. The key difference is that on Debian the resulting file is NOT digitally signed so SecureBoot does not work. Debian does not sign its bootloaders, you can copy one from Ubuntu or sign it yourself.

Hi @lzap,

I went in my Foreman server that is the same Ubuntu version I want to deploy on Bare Metals and want to know if I can use this file?
/boot/efi/EFI/BOOT/BOOTX64.EFI*

Otherwise I have grubx64.efi*, shimx64.efi* in /boot/efi/EFI/ubuntu …

Perhaps it will do the trick?

I do understand that Red Hat/CentOS is more adapted but I am compelled to work on Ubuntu …

Regards,

@Gueug78400

Well, what can I say. Foreman depends on several patches that has been sent upstream by Red Hat developers, for example

https://lists.gnu.org/archive/html/grub-devel/2020-09/msg00037.html

These patches are already included in RHEL 7 and 8, if you want to use grub2 from Debian or Ubuntu you need to ask Debian/Ubuntu developers to carry those patches. Or build your grub from sources. I think it’s easier to simply take Grub2 from Fedora Rawhide which is the latest and greatest with all Red Hat patches applied and use that, even within Ubuntu/Debian environment. Bonus: SecureBoot will work too.

Hi @lzap,

Once more you were right!

I tried with a fedora grubx64.efi and it works (on WorkStationPro) like a charm.
I will carry out tests on Bare Metals …

For those who encounter the same issue than I with Ubuntu EFI and this file grubx64.efi:
https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/30/Server/x86_64/os/EFI/BOOT/grubx64.efi

You are the man, Lukáš!!

Thanks!!

Gregory alias @Gueug78400

Hi @lzap,

I confirm, this boot loader is the answer to my incident:
https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/30/Server/x86_64/os/EFI/BOOT/grubx64.efi

On Bare Metals it works well with Ubuntu; I wanted to let you know.

Regards,

@Gueug78400

Great, thanks for getting back to us. Honestly Fedora 30 has slightly old grub, I suggest to use the newest from Rawhide or at least 32:

1 Like