Bug 1277227 - grub2-install fails in anaconda (pre) shell with 'grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory.'
grub2-install fails in anaconda (pre) shell with 'grub2-install: error: /usr/...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lorax (Show other bugs)
7.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Brian Lane
Release Test Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-02 12:59 EST by Joseph Tingiris
Modified: 2016-11-03 19:44 EDT (History)
3 users (show)

See Also:
Fixed In Version: lorax-19.6.67-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 19:44:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joseph Tingiris 2015-11-02 12:59:18 EST
Description of problem:

grub2-install fails if run from anaconda pre shell or used within pre script on an x86_64 EFI based machine.

The grub target for x86_64-efi is missing.  There is no /usr/lib/grub/x86_64-efi.

Version-Release number of selected component (if applicable):

lorax?

anaconda 19.31.123-1


How reproducible:

run grub2-install when in anaconda 19.31.123-1 pre install shell on an EFI based machine

Steps to Reproduce:
1. kickstart or otherwise boot an x86_64 EFI based machine with install media
2. go to shell (alt+f2 or ssh)
3. execute grub2-install

Actual results:

grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory.

Expected results:

Installing for x86_64-efi platform.
grub2-install: error: cannot find EFI directory.

Additional info:

Copying the contents of /usr/lib/grub/x86_64-efi/ from an installed machine gets grub2-install working properly.
Comment 2 Brian Lane 2015-11-02 13:38:56 EST
Why are you trying to run it from %pre?
Comment 3 Joseph Tingiris 2015-11-02 14:25:37 EST
The project I'm working has a requirement for a custom recovery/install partition.  As a result, all partitioning is done in pre so it can be created (or preserved) as necessary.  The methods and reasoning for doing custom partitioning via pre is well established.

In this case, physical access to the machines is limited.  They are headless appliances and being booted via said recovery/install partition over the Internet via inst.ks (https, not pxe).  Transient network failures are a reality.  Installs don't always go as planned.

In the event post install fails, the machine must be able to reboot itself from the recovery partition and ultimately try again unattended (via grub2/custom.cfg).  The recovery partition is also used as a 'factory reset' mechanism and more.

Everything works as planned on bios based machines.  grub2-install performs as expected, etc.  With the proliferation of more modern hardware, duplicating the same functionality on EFI based machines is desirable.  All of the necessary tools are already available in pre and the only missing component is apparently /usr/lib/grub/x86_64-efi/
Comment 4 Brian Lane 2015-11-02 14:41:30 EST
Thanks for the additional detail. Lorax should include grub2-efi-modules when building the boot.iso
Comment 8 errata-xmlrpc 2016-11-03 19:44:57 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2165.html

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