Bug 1290369 - [RFE] Add switch to enforce EFI bootloader installation
[RFE] Add switch to enforce EFI bootloader installation
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: anaconda (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: 7.3
Assigned To: Anaconda Maintenance Team
Release Test Team
: FutureFeature
Depends On:
Blocks: ovirt-node-ng
  Show dependency treegraph
Reported: 2015-12-10 05:49 EST by Fabian Deutsch
Modified: 2016-01-27 12:39 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-12-14 21:20:20 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Fabian Deutsch 2015-12-10 05:49:44 EST
Description of problem:
anaconda will currently only install the EFI related bootloader bits if EFI is detected on the system.

This is an issue if anaconda is used to build images (liveimg compat squashfs image), where EFI is not present at build time, but can likely be present at installation time.

The currently solution is to add the necessary packages to the kickstart as described in [1] and [2].

To centralize the knowledge about what packages are required, it would be good if the bootloader directive of anaconda had a switch to enforece that the EFI bootloader bits get instaleld - even if no EFI system was dected.


bootloader --efi

[1] https://www.brianlane.com/creating-live-isos-with-livemedia-creator.html
[2] http://lorax.readthedocs.org/en/latest/livemedia-creator.html#kickstarts
Comment 1 Brian Lane 2015-12-11 20:38:41 EST
This isn't really possible. I looked into doing this for lmc and ran into trouble with grub2 for a start. Various tools detect the system they are running on and change their behavior based on it. If you want to create UEFI disk images you need to create them on a UEFI system, or VM.
Comment 2 Fabian Deutsch 2015-12-14 01:49:37 EST
Right. I can imagine that setting the EFI bootloader will fail, i.e. grub2-efi, because it can not write the relevant EFI variables.

But wouldn't it make sense to at least provide a switch for lmc or anaconda to package the necessary packages?

I'm thinking about the use case where lmc is used to generate an liveimg, and then EFI can be installed depending on the target system upon installation.

Anaconda will do the EFI installation, but this requires that the necessary packages are part of the liveimg.
Comment 3 Brian Lane 2015-12-14 21:20:20 EST
If you are building an installer image this already works, you don't need any switches. Simply include the grub2-efi package in the %packages section of the kickstart. eg. https://github.com/rhinstaller/lorax/blob/master/docs/fedora-livemedia.ks
Comment 4 Fabian Deutsch 2015-12-15 01:08:48 EST
Right, but does this also install support for SecureBoot?

And: It's not about adding this package or not to the kickstarts.
It is really more about keeping the responsibilities to add this high-level EFI functionality in lmc/anaconda.
By keeping this package based solution, the responsibility is on the side of the image builder, to make sure that the right (maybe in future changing) packages are included in the kickstart,
if there was a high-level efi switch, then the responsibility would stay in anaconda - like it already is anaconda's responsibility today to add the "right packages" (tm) if an EFI system is detected.
Comment 5 Brian Lane 2016-01-25 14:48:57 EST
Good question, if you are making a live installer iso and include the @anaconda-tools group it will pull in shim, grub2-efi, etc. Otherwise you will need to add the correct packages for the type of iso you want to build.

UEFI disk images should add shim if they aren't including the group. But you have to build a UEFI disk image on a UEFI system (or VM) so shim will get added automatically.
Comment 6 Fabian Deutsch 2016-01-27 09:48:13 EST
My assumption is that anaconda (and/or lmc) is intended for image builds as well - And under this assumption I don't understand why anaconda/lmc does not bring the features to allow building an image which can also be booted on UEFI machines.
Comment 7 Brian Lane 2016-01-27 12:39:55 EST
The problem is that many of the tools used by anaconda assume they are running on the targeted platform so the disk image can't be setup for UEFI when built inside a BIOS vm. Creating isos that work on BIOS and UEFI is possible because the boot sequence is created by lmc, not anaconda and associated tools.

Note You need to log in before you can comment on or make changes to this bug.