foreman icon indicating copy to clipboard operation
foreman copied to clipboard

Fixes #37345 - Improve "EFI local chainloading" on SecureBoot enabled hosts

Open jloeser opened this issue 10 months ago • 7 comments

Chainloading is not supported when SecureBoot is enabled 1.

Currently, this issue is tried to be tackled by changing the boot order during installation to boot from disk by default. But this disturbs the "always boot from network" workflow which might result in broken attempts for the user to re-provision a host (see https://github.com/theforeman/foreman/pull/9123).

What we can do is to exit network booted GRUB2 with exit 1 resulting in the boot of the next boot device, which is probably the boot file from disk.

The use of efibootmgr_netboot is still possible (if desired). The proposed solution would also work when SecureBoot is disabled, however to avoid side effects I propose to only boot next device if SecureBoot is enabled (GRUB2 variable lockdown=y 2).

jloeser avatar Apr 11 '24 11:04 jloeser

Can one of the admins verify this patch?

theforeman-bot avatar Apr 11 '24 11:04 theforeman-bot

Can one of the admins verify this patch?

theforeman-bot avatar Apr 11 '24 11:04 theforeman-bot

Can one of the admins verify this patch?

theforeman-bot avatar Apr 11 '24 11:04 theforeman-bot

@goarsna feedback on this?

sbernhard avatar Apr 11 '24 11:04 sbernhard

The use of efibootmgr_netboot is still possible (if desired).

To be clear: if we use this approach, we can enable efibootmgr_netboot by default (currently only if efi_bootentry host param is set) to set boot device after the installation back to network.

https://github.com/theforeman/foreman/blob/develop/app/views/unattended/provisioning_templates/snippet/efibootmgr_netboot.erb

But this needs to be tested first.

jloeser avatar Apr 19 '24 11:04 jloeser

Any objections against merging this? Is there anything left to do, @jloeser?

goarsna avatar May 13 '24 09:05 goarsna

@jloeser can you squash the commits? After that it should be all green and ready for merge

stejskalleos avatar May 13 '24 10:05 stejskalleos

Thanks @jloeser @sbernhard

stejskalleos avatar Jun 04 '24 08:06 stejskalleos