Bug 1492177
| Summary: | rear fails to create a backup on (some?) UEFI systems, "cannot open `/usr/lib/grub/x86_64-efi/moddep.lst'" | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Julio Entrena Perez <jentrena> |
| Component: | rear | Assignee: | Pavel Cahyna <pcahyna> |
| Status: | CLOSED ERRATA | QA Contact: | Tereza Cerna <tcerna> |
| Severity: | medium | Docs Contact: | Petr Bokoc <pbokoc> |
| Priority: | urgent | ||
| Version: | 7.4 | CC: | apmukher, fkrska, jentrena, ovasik, pcahyna, pjones, rblakley, rmetrich, tbowling |
| Target Milestone: | rc | Keywords: | Documentation, EasyFix |
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
*ReaR* now provides a more helpful error message when _grub2-efi-x64-modules_ is missing
Previously, an attempt to create a *ReaR* backup on UEFI systems using the "rear mkrescue" and "rear mkbackup" commands failed due to a missing _grub2-efi-x64-modules_ package, which is not installed by default but is required by *ReaR* to generate a GRUB image. The commands failed with the following error message:
ERROR: Error occurred during grub2-mkimage of BOOTX64.efi
This message proved to be confusing and unhelpful. With this update, the error will still appear in the same circumstances, but it will point out how to fix the problem:
WARNING: /usr/lib/grub/x86_64-efi/moddep.lst not found, grub2-mkimage will likely fail. Please install the grub2-efi-x64-modules package to fix this.
As the updated message explains, you must install the missing _grub2-efi-x64-modules_ package before you can create a *ReaR* backup on a system with UEFI firmware.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-04-10 18:43: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: | 1512493 | ||
| Bug Blocks: | |||
|
Description
Julio Entrena Perez
2017-09-15 16:19:53 UTC
This error message appears to be caused by the below snippet of code from /usr/share/rear/lib/uefi-functions.sh.
$gmkimage $v -O x86_64-efi -c $TMP_DIR/mnt/EFI/BOOT/embedded_grub.cfg -o $TMP_DIR/mnt/EFI/BOOT/BOOTX64.efi -p "/EFI/BOOT" part_gpt part_msdos fat ext2 normal chain boot configfile linux linuxefi multiboot jfs iso9660 usb usbms usb_keyboard video udf ntfs all_video gzio efi_gop reboot search test echo btrfs
StopIfError "Error occurred during $gmkimage of BOOTX64.efi"
If a server is installed with 7.4 directly via uefi, it installs the grub2-pc-modules package instead of the grub2-efi-x64-modules package. If the server is installed with 7.2 or 7.3 directly then updated to 7.4 some appear to have installed the grub2-efi-x64-modules package, but some haven't.
So based on the above code, for uefi there needs to be a required progs added for the grub2-efi-x64-modules package to prevent this error earlier on.
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? For QE: sanity test was modified for testing this problem on UEFI system, see https://tcms.engineering.redhat.com/case/560858/ suggested workaround: install the grub2-efi-x64-modules package *** Bug 1518217 has been marked as a duplicate of this bug. *** I am afraid of forcing a dependency in spec as it would install it (the grub2-efi-x64-modules package) even on non-UEFI systems and I am not sure about the consequences. Therefore, I intend only to: - document the workaround - and add a more helpful error message, as suggested by Renaud (this would be a patch but probably a simple one). I propose the following change: add a file usr/share/rear/output/ISO/Linux-i386/249_check_rhel_grub2_efi_package.sh with this content:
---------->8-----------
# 249_check_rhel_grub2_efi_package.sh
is_true $USING_UEFI_BOOTLOADER || return # empty or 0 means NO UEFI
(
VERBOSE=1
test -r /usr/lib/grub/x86_64-efi/moddep.lst
PrintIfError "WARNING: /usr/lib/grub/x86_64-efi/moddep.lst not found, grub2-mkimage will likely fail. Please install the grub2-efi-x64-modules package to fix this."
)
---------->8-----------
Output of "rear mkrescue" with this change:
WARNING: /usr/lib/grub/x86_64-efi/moddep.lst not found, grub2-mkimage will likely fail. Please install the grub2-efi-x64-modules package to fix this.
ERROR: Error occurred during grub2-mkimage of BOOTX64.efi
Aborting due to an error, check /var/log/rear/rear-localhost.log for details
rmetrich, jentrena, are you happy with this?
I'm ok with that. (In reply to Pavel Cahyna from comment #13) > rmetrich, jentrena, are you happy with this? Yes, thanks Pavel. ==========================
Verified in:
rear-2.00-6.el7.x86_64
PASS
==========================
* Tested on UEFI system.
* Patch was applied.
* Better warning message was used:
WARNING: /usr/lib/grub/x86_64-efi/moddep.lst not found, grub2-mkimage will likely fail. Please install the grub2-efi-x64-modules package to fix this.
See:
====
# cat /etc/rear/local.conf
OUTPUT=ISO
OUTPUT_URL=null
BACKUP=NETFS
BACKUP_URL=iso:///backup
ISO_MAX_SIZE=4095
# rear -v mkrescue
...
Copying kernel modules
Creating initramfs
WARNING: /usr/lib/grub/x86_64-efi/moddep.lst not found, grub2-mkimage will likely fail. Please install the grub2-efi-x64-modules package to fix this.
ERROR: Error occurred during grub2-mkimage of BOOTX64.efi
Aborting due to an error, check /var/log/rear/rear-hpe-tm200-01.log for details
Terminated
# yum install grub2-efi-x64-modules
# rear -v mkrescue
...
Copying kernel modules
Creating initramfs
'/tmp/rear.XB9xyNFtwSja50o/tmp/mnt/./EFI' -> '/tmp/rear.XB9xyNFtwSja50o/tmp/efi_virt/./EFI'
'/tmp/rear.XB9xyNFtwSja50o/tmp/mnt/./EFI/BOOT' -> '/tmp/rear.XB9xyNFtwSja50o/tmp/efi_virt/./EFI/BOOT'
'/tmp/rear.XB9xyNFtwSja50o/tmp/mnt/./EFI/BOOT/fonts' -> '/tmp/rear.XB9xyNFtwSja50o/tmp/efi_virt/./EFI/BOOT/fonts'
'/tmp/rear.XB9xyNFtwSja50o/tmp/mnt/./EFI/BOOT/fonts/unicode.pf2' -> '/tmp/rear.XB9xyNFtwSja50o/tmp/efi_virt/./EFI/BOOT/fonts/unicode.pf2'
'/tmp/rear.XB9xyNFtwSja50o/tmp/mnt/./EFI/BOOT/locale' -> '/tmp/rear.XB9xyNFtwSja50o/tmp/efi_virt/./EFI/BOOT/locale'
'/tmp/rear.XB9xyNFtwSja50o/tmp/mnt/./EFI/BOOT/BOOTX64.efi' -> '/tmp/rear.XB9xyNFtwSja50o/tmp/efi_virt/./EFI/BOOT/BOOTX64.efi'
'/tmp/rear.XB9xyNFtwSja50o/tmp/mnt/./EFI/BOOT/embedded_grub.cfg' -> '/tmp/rear.XB9xyNFtwSja50o/tmp/efi_virt/./EFI/BOOT/embedded_grub.cfg'
'/tmp/rear.XB9xyNFtwSja50o/tmp/mnt/./EFI/BOOT/grub.cfg' -> '/tmp/rear.XB9xyNFtwSja50o/tmp/efi_virt/./EFI/BOOT/grub.cfg'
Making ISO image
Wrote ISO image: /var/lib/rear/output/rear-hpe-tm200-01.iso (219M)
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://access.redhat.com/errata/RHBA-2018:1000 |