Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Implement EFI support #2

Open
matsimon opened this issue May 7, 2018 · 4 comments
Open

Implement EFI support #2

matsimon opened this issue May 7, 2018 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@matsimon
Copy link

matsimon commented May 7, 2018

Currently we only support legacy BIOS or UEFI systems in CSM mode. However the older UEFI gets, the lesser amount of systems (maybe except VMs) will support CSM mode or already show more issues in CSM mode (already happened to me) instead of native UEFI.

We should accomodate for the future and therefore fix our role to detect UEFI and configure grub accordingly.

Facts to differentiate BIOS vs. UEFI mode
There doesn't seem to be many native facts we can use to identify a UEFI system, so far:

  • If a partition exists mounted with mount point /boot/efi
  • If said partition has fstype vfat
  • If i.e. the following packags are present
    • EL6 (grub1): Apparently only efibootmgr
    • EL7 (grub2): efibootmgr, efivar-libs, grub2-efi

What is different
At least on EL6 (confirmed manually) and EL7 (confirmed) the variable grub_boot_cfg needs to be /boot/grub2/grub.cfg instead of /boot/grub2/grub.cfg. However the role explicitely only supports EL7 which brings leads us to the need to accomodate for 3 known variantes based on the supported EL distributions of this module:

  • legacy CSM: /boot/grub2/grub.cfg (same for RHEL and CentOS)
  • UEFI on RHEL: /boot/efi/EFI/redhat/grub.cfg
  • UEFI CentOS: /boot/efi/EFI/centos/grub.cfg

Vendor documentation
Documentation from Red Hat: Red Hat Enterprise Linux 7, Migration Planning Guide 2.2. Installation and Boot

@karras karras added enhancement New feature or request help wanted Extra attention is needed labels May 7, 2018
@matsimon
Copy link
Author

matsimon commented May 7, 2018

A quick investigation revealed the following

  • EL6 is unsupported by this role anyway (being "stuck" on grub1), one concern less.
  • Debian/Ubuntu: @keachi asked how they do things and I discovered that their grub2 package contains a patch adding the necessary plumbing so we don't have to care about the CSM vs. UEFI differences. The patch uefi_firmware_setup.patch can be found on Debian's gitlab.

In the end the detection is only required when running on EL7.

@matsimon
Copy link
Author

I've updated the initial bug report about the 3 different location of grub.cfg based on the targeted support for CentOS and RHEL7 for both UEFI and CSM boot.

@matsimon
Copy link
Author

Discussing with @keachi we might be able to use something as {{ ansible_distribution|lower }} to accomodate for the location.

This might not work with other EL-based distributions such as Scientific or OEL, but it should cover CentOS and RHEL where do know that it matches.

@keachi
Copy link
Contributor

keachi commented May 30, 2018

Scientific and OEL are not supported. We support RHEL and CentOS.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants