Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1832852

Summary: grub2-pc package is installed on EFI platforms as well
Product: Red Hat Enterprise Linux 8 Reporter: Renaud Métrich <rmetrich>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.2CC: hartsjc, jstodola, mhavrila, rvykydal
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: anaconda-33.16.3.1-2 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 03:23:24 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:

Description Renaud Métrich 2020-05-07 12:01:18 UTC
Description of problem:

grub2-pc is for legacy installations, but it's always installed, even on EFI systems.

This causes a broken symlink to be created, which may confuse customers:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# ls -l /etc/grub2.cfg /etc/../boot/grub2/grub.cfg
ls: cannot access '/etc/../boot/grub2/grub.cfg': No such file or directory
lrwxrwxrwx. 1 root root 22 Dec 19  2018 /etc/grub2.cfg -> ../boot/grub2/grub.cfg
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------


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

Anaconda RHEL8


How reproducible:

Always


Steps to Reproduce:
1. Install a UEFI system

Actual results:

"grub2-pc" package is installed


Expected results:

No "grub2-pc" package installed

Additional info:

This is due to the way the booloader python code works:
- GRUB2 class is used as base class, which leads to installing "grub2" and "grub2-tools" packages
- EFIGRUB class is derived from GRUB2, causing packages from base class to be installed at well:

/usr/lib64/python3.6/site-packages/pyanaconda/bootloader.py:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
1439 class GRUB2(GRUB):
 :
1461     # grub2 is a virtual provides that's provided by grub2-pc, grub2-ppc64le,
1462     # and all of the primary grub components that aren't grub2-efi-${EFIARCH}
1463     packages = ["grub2", "grub2-tools"]
 :

1892 class EFIGRUB(EFIBase, GRUB2):
 :
1921     @property
1922     def packages(self):
1923         if self._is_32bit_firmware:
1924             return self._packages32 + self._packages_common + \
1925                 super().packages
1926         return self._packages64 + self._packages_common + \
1927             super().packages
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

In the code excerpt above, we can see on line 1927 that "packages" attribute from base class ("GRUB2") are appended to the list of packages for EFI.

IMHO the super().packages should be removed and "grub2-tools" specified instead.

Comment 1 Jan Stodola 2020-05-07 12:21:12 UTC
This should be fixed by commit:
https://github.com/rhinstaller/anaconda/commit/8a8cc7a1a9bee434d07836e43ea9d43220752bab
This change will be included as part of anaconda rebase.

Comment 2 James Hartsock 2020-05-11 12:25:19 UTC
Jan, are you saying this should be closed duplicate to: Bug 1691319 ?

Comment 3 Jan Stodola 2020-05-11 14:56:29 UTC
Hi James, I want to keep this bug open in order to verify the problem is indeed resolved by anaconda rebase.

Comment 6 Marek Havrila 2020-07-15 09:19:12 UTC
Verified on RHEL-8.3.0-20200701.2 and anaconda-33.16.3.10-1.el8.x86_64

Comment 9 errata-xmlrpc 2020-11-04 03:23:24 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 (anaconda bug fix and enhancement update), 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-2020:4729