RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1567018 - grub2-install fails in anaconda (pre) shell with 'grub2-install : error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist. Please specify --target or --directory'
Summary: grub2-install fails in anaconda (pre) shell with 'grub2-install : error: /usr...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lorax
Version: 7.5
Hardware: Unspecified
OS: Linux
urgent
urgent
Target Milestone: rc
: ---
Assignee: Brian Lane
QA Contact: Release Test Team
URL:
Whiteboard:
: 1626269 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-13 09:57 UTC by Abhijeet Sadawarte
Modified: 2023-09-07 19:07 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-22 22:27:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Abhijeet Sadawarte 2018-04-13 09:57:46 UTC
Description of problem:

grub2-install fails if run from anaconda pre shell or used within pre script on 

The grub target is missing.  There is no /usr/lib/grub/i386-pc


Version-Release number of selected component (if applicable):
RHEL 7.3, RHEL 7.4 and RHEL 7.5 

How reproducible:

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

Steps to Reproduce:
1. kickstart or otherwise boot BIOS 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/i386-pc/modinfo.sh doesn't exist. Please specify --target or --directory.



Expected results:

[anaconda root@localhost]# grub2-install /dev/sda
Installing for i386-pc platform.
Instalation finished. No error reported.


Additional info:


Copying the contents of /usr/lib/grub/i386-pc/ from an installed machine gets grub2-install working properly.

- BZ 1277227 raised for uEFI based machines but seems we still have same issue around for both the platforms.(i386 and x64_86)

Comment 3 Brian Lane 2018-04-13 16:22:57 UTC
I think what happened was that when we made the changes for the new grub2 subpackages in commit 5d204bd21e28b3624ff258e03ce79c9c3e91fbb9 it lost the requirement for grub2-pc (which pulls in grub2-pc-modules) because we're not pulling in the main grub2 package anymore. The same goes for grub2-efi-modules.

Comment 4 Peter Jones 2018-04-13 16:50:59 UTC
Well, we shouldn't ever need grub2-efi-*-modules, because grub2-efi-* have pre-built grub$ARCH.efi images in them, so there's no need to run grub2-install on UEFI. I think we just need to add "installpkg grub2-${basearch}" for the non-efi cases.

Comment 5 Brian Lane 2018-06-06 22:18:06 UTC
(In reply to Peter Jones from comment #4)
> Well, we shouldn't ever need grub2-efi-*-modules, because grub2-efi-* have
> pre-built grub$ARCH.efi images in them, so there's no need to run
> grub2-install on UEFI. I think we just need to add "installpkg
> grub2-${basearch}" for the non-efi cases.

I'm not sure what to do here. Nothing provides grub2-x86_64, and the rpm that these files are in only provides:

grub2-pc-modules = 1:2.02-0.65.el7_4.2

Comment 6 Joseph Tingiris 2018-08-12 20:42:00 UTC
Please excuse me;  I reported 'grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist.', here: https://bugzilla.redhat.com/show_bug.cgi?id=1277227 in '15

At the time,  /usr/lib/grub/i386-pc/modinfo.sh existed (in 7.1 1403).  

Now, both are missing (x86_64-efi and i386-pc).  The main purpose of this comment is to link them together.   

1277227 was re-opened but somehow closed again?   Does this replace that?  
 
FWIW, there are issues upgrading from f26 to f27 that appear related.  There's sill an issue in f28, too.  It's missing both as well.

IMHO, much of this stems from the inclusion of the 'prebaked', custom grubx86.efi

Another use case that will follow, and break on all of the RedHat variants, is moving /boot to a cryptodisk.  

grub2-install should work as advertised upstream and be included in preboot, squashfs, etc.

et cetera

Comment 7 Joseph Tingiris 2018-08-12 20:51:12 UTC
(In reply to Peter Jones from comment #4)
> Well, we shouldn't ever need grub2-efi-*-modules, because grub2-efi-* have
> pre-built grub$ARCH.efi images in them, so there's no need to run
> grub2-install on UEFI. I think we just need to add "installpkg
> grub2-${basearch}" for the non-efi cases.

Respectfully, there are multiple reasons people (like me) will want to run grub2-install on UEFI.

With articles going out like this, https://dustymabe.com/2015/07/06/encrypting-more-boot-joins-the-party/ (for BIOS).  

All newer machines are UEFI.  The same can be done (move /boot to an encrypted volume) as long as the proper grub2 modules are there.  The fact that they aren't included in the RedHat versions of grubx86.efi prompts the necessity to be able to run grub2-install on UEFI, for anyone wanting a more secure system.

Comment 8 Brian Lane 2018-09-07 15:49:43 UTC
*** Bug 1626269 has been marked as a duplicate of this bug. ***

Comment 16 Brian Lane 2020-04-17 00:25:10 UTC
Ok, I took another look at this with 7.9 today, adding the grub2-*-module packages to the boot.iso
On UEFI running grub2-install now complains about not being able to find the EFI directory.
On BIOS it complains 'error: unable to identify a filesystem in hostdisk//dev/sda; safety check can't be performed.'

So as far as I can see, even with the modules included, it isn't useful. The other issue is that this adds about 12M to the rootfs and on some architectures we're pretty close to being too large for a CD, so we need to be very careful about what we add.

Unless someone can provide a really good reason to add this, and demonstrate that it solves an actual problem for them, I'm going to close this.


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