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 1479002 - REAR "ERROR: Cannot find required programs: efibootmgr", after updating to 7.4.
Summary: REAR "ERROR: Cannot find required programs: efibootmgr", after updating to 7.4.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rear
Version: 7.4
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: rc
: ---
Assignee: Pavel Cahyna
QA Contact: Tereza Cerna
Petr Bokoc
URL:
Whiteboard:
: 1492190 (view as bug list)
Depends On:
Blocks: 1420851 1492561
TreeView+ depends on / blocked
 
Reported: 2017-08-07 16:56 UTC by Ryan Blakley
Modified: 2023-03-24 13:50 UTC (History)
13 users (show)

Fixed In Version: rear-2.00-3.el7
Doc Type: Bug Fix
Doc Text:
*ReaR* no longer requires "dosfsck" and "efibootmgr" on non-UEFI systems Previously, *ReaR* (Relax-and-Recover) incorrectly required the "dosfsck" and "efibootmgr" utilities installed on systems that do not use UEFI. As a consequence, if the utilities were missing, the "rear mkrescue" command failed with an error. This bug has been fixed, and *ReaR* now requires the mentioned utilities to be installed only on UEFI systems.
Clone Of:
: 1492561 (view as bug list)
Environment:
Last Closed: 2018-04-10 18:43:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3178651 0 None None None 2017-09-11 19:47:56 UTC
Red Hat Product Errata RHBA-2018:1000 0 None None None 2018-04-10 18:44:10 UTC

Description Ryan Blakley 2017-08-07 16:56:16 UTC
Description of problem: REAR "ERROR: Cannot find required programs: efibootmgr", after updating to 7.4. With 7.4 grub2-common is a new dependency that gets pulled in, which creates the /boot/efi/EFI/redhat directory on non-uefi installed machines.


Version-Release number of selected component (if applicable):
grub2-common-2.02-0.64.el7.noarch
rear-2.00-2.el7.x86_64


Steps to Reproduce:
** First way
1. Install 7.4 and run # rear -v mkbackup

** Second way if on 7.3 or below.
1. Yum update grub2* and rear, then run # rear -v mkbackup


Actual results:
# rear -d -v mkbackup
Relax-and-Recover 2.00 / Git
Using log file: /var/log/rear/rear-ryan-rhel7.log
ERROR: Cannot find required programs: efibootmgr
Aborting due to an error, check /var/log/rear/rear-ryan-rhel7.log for details
You should also rm -Rf /tmp/rear.3EZIbCfZn9geS4c
Terminated


Expected results:
Continue with the backup and not terminate.


Additional info: 
It looks like a similar issue has been reported upstream at https://github.com/rear/rear/issues/1239. But the fix for that issue doesn't work on 7.4, because it's only checking if the directory exist. It should be checking if /boot/efi is actually mounted. I did some testing, and the below change works correctly on non-uefi, and uefi based installs without any errors.

diff -up /usr/share/rear/prep/default/310_include_uefi_tools.sh.bak /usr/share/rear/prep/default/310_include_uefi_tools.sh
--- /usr/share/rear/prep/default/310_include_uefi_tools.sh.bak	2017-08-07 11:29:12.863665290 -0400
+++ /usr/share/rear/prep/default/310_include_uefi_tools.sh	2017-08-07 11:33:15.924439002 -0400
@@ -6,7 +6,7 @@ if grep -qw 'noefi' /proc/cmdline; then
 fi
 
 # next step, is checking /boot/efi directory (we need it)
-if [[ ! -d /boot/efi ]]; then
+if ! grep -q '/boot/efi' /proc/mounts; then
     return    # must be mounted
 fi

Comment 2 Blair Aitken 2017-08-15 13:50:27 UTC
Hello everyone,

I have 2 different customers that have confirmed that the suggested workaround by Ryan (under Additional info section) works in their environment.

Comment 3 Ryan Blakley 2017-08-15 23:33:46 UTC
The customer on 01903555 also confirmed the workaround I proposed fixed their issue, is there anyway we can get a fix pushed quicker. This bug breaks rear backups completely on non-uefi systems?

Comment 10 Pavel Cahyna 2017-09-11 09:54:56 UTC
Quick workaround without patching package files: install the dosfstools and efibootmgr packages.
yum install dosfstools efibootmgr

Comment 30 Jeff Bastian 2017-09-15 19:23:52 UTC
*** Bug 1492190 has been marked as a duplicate of this bug. ***

Comment 31 Jeff Bastian 2017-09-15 19:24:08 UTC
(In reply to Ryan Blakley from comment #0)
>  # next step, is checking /boot/efi directory (we need it)
> -if [[ ! -d /boot/efi ]]; then
> +if ! grep -q '/boot/efi' /proc/mounts; then
>      return    # must be mounted
>  fi


I would suggest checking for the /sys/firmware/efi directory instead.  This is created by the kernel only on systems with actual UEFI firmware.

Even a non-UEFI system could mount a filesystem at /boot/efi so this is not a very reliable test.  (I don't know _why_ someone would mount something here on a non-UEFI system, but I've seen weirder things. :-))

Comment 32 Ryan Blakley 2017-09-15 19:47:02 UTC
(In reply to Jeff Bastian from comment #31)
> (In reply to Ryan Blakley from comment #0)
> >  # next step, is checking /boot/efi directory (we need it)
> > -if [[ ! -d /boot/efi ]]; then
> > +if ! grep -q '/boot/efi' /proc/mounts; then
> >      return    # must be mounted
> >  fi
> 
> 
> I would suggest checking for the /sys/firmware/efi directory instead.  This
> is created by the kernel only on systems with actual UEFI firmware.
> 
> Even a non-UEFI system could mount a filesystem at /boot/efi so this is not
> a very reliable test.  (I don't know _why_ someone would mount something
> here on a non-UEFI system, but I've seen weirder things. :-))

The latest fix no longer depends on the mount. My point for checking if it was mounted was due to the fact that rear depends on the efi files to be under /boot/efi. So if we only check if the directory exist, then the efi files may not be there if /boot/efi wasn't mounted. But again the upstream fixes rearrange the prep files to properly, and more cleanly fix this issue.

Comment 35 Tereza Cerna 2018-01-08 10:03:06 UTC
===================
Verified in:
   rear-2.00-4.el7
   non-UEFI machine
PASS
===================

# cat /etc/rear/local.conf
OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL=nfs://localhost/mnt/rear/

# rear -v mkbackup
Relax-and-Recover 2.00 / Git
Using log file: /var/log/rear/rear-ibm-p8-kvm-06-guest-07.log
Using backup archive 'backup.tar.gz'
mkdir: created directory '/var/lib/rear/output'
Creating disk layout
Creating root filesystem layout
Copying logfile /var/log/rear/rear-ibm-p8-kvm-06-guest-07.log into initramfs as '/tmp/rear-ibm-p8-kvm-06-guest-07-partial-2018-01-08T03:22:36-0500.log'
Copying files and directories
Copying binaries and libraries
Copying kernel modules
Creating initramfs
Making ISO image
Wrote ISO Image /var/lib/rear/output/rear-ibm-p8-kvm-06-guest-07.iso (80M)
Copying resulting files to nfs location
Saving /var/log/rear/rear-ibm-p8-kvm-06-guest-07.log as rear-ibm-p8-kvm-06-guest-07.log to nfs location
Creating tar archive '/tmp/rear.GhQPqVERRYvBgLZ/outputfs/ibm-p8-kvm-06-guest-07/backup.tar.gz'
Preparing archive operationOK
Archived 1822 MiB in 248 seconds [avg 7524 KiB/sec]

See output: 
http://lab-02.rhts.eng.bos.redhat.com/beaker/logs/tasks/66224+/66224272/TESTOUT.log

===================
Reproduced in:
   rear-2.00-2.el7
   non-UEFI machine
FAIL
===================

# cat /etc/rear/local.conf
OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL=nfs://localhost/mnt/rear/

# rear -v mkbackup
Relax-and-Recover 2.00 / Git
Using log file: /var/log/rear/rear-sheep-41.log
Using backup archive 'backup.tar.gz'
ERROR: Cannot find required programs: dosfsck efibootmgr
Aborting due to an error, check /var/log/rear/rear-sheep-41.log for details

Comment 38 errata-xmlrpc 2018-04-10 18:43:20 UTC
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


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