Description of problem:
On a freshly installed RHEL 7.4 system with UEFI, grub2-mkimage fails to produce an image, with the error message grub2-mkimage: error: cannot open `/usr/lib/grub/x86_64-efi/moddep.lst': No such file or directory.
This file is provided by the grub2-efi-x64-modules package, but this package is not installed by default. If the system is installed directly via uefi, it installs the grub2-pc-modules package instead of the grub2-efi-x64-modules package. Interestingly, grub2-pc does depend on grub2-pc-modules, but grub2-efi does not depend on grub2-efi-modules, nor does grub2-efi-x64 depend on grub2-efi-x64-modules. Why this asymmetry?
This problem prevents ReaR from working out-of-the-box on UEFI systems, see bz1492177
Version-Release number of selected component (if applicable):
Reproducible on newly installed systems, on systems upgraded from previous releases the grub2-efi-x64-modules package is sometimes present and the command does work, see https://bugzilla.redhat.com/show_bug.cgi?id=1492177#c3
Steps to Reproduce:
1. grub2-mkimage -O x86_64-efi -p /EFI/BOOT
grub2-mkimage: error: cannot open `/usr/lib/grub/x86_64-efi/moddep.lst': No such file or directory.
Image is produced on stdout, just like in the case of "grub2-mkimage -O i386-pc -p /boot/grub2" (which works even on an UEFI system, btw).
Closing the bug as the attached customer case is closed.