Bug 1290369

Summary: [RFE] Add switch to enforce EFI bootloader installation
Product: Red Hat Enterprise Linux 7 Reporter: Fabian Deutsch <fdeutsch>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED NOTABUG QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: bcl, mkolman
Target Milestone: rcKeywords: FutureFeature
Target Release: 7.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-15 02:20:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1140646    

Description Fabian Deutsch 2015-12-10 10:49:44 UTC
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.

i.e.:

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-12 01:38:41 UTC
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 06:49:37 UTC
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-15 02:20:20 UTC
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 06:08:48 UTC
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 19:48:57 UTC
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 14:48:13 UTC
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 17:39:55 UTC
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.