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 1639168

Summary: grub2-efi and shim packages should be protected in yum
Product: Red Hat Enterprise Linux 7 Reporter: Marko Myllynen <myllynen>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED WONTFIX QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: awilliam, javierm, jhlavac, jkonecny, pjones, rharwood
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-15 07:43:31 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 Marko Myllynen 2018-10-15 08:18:10 UTC
Description of problem:
When installing RHEL 7.5 on UEFI system Anaconda correctly adds grub2-efi and shim packages as part of the installation package set (e.g., grub2-efi-x64 and shim-x64 on an x86_64 laptop).

These packages are not protected in yum (under /etc/yum/protected.d) so a simple administrator action or a script or playbook could remove these packages, rendering the system completely unbootable so that even GRUB menu is never reached (as /boot/efi/EFI/redhat/shimx64.efi would be missing).

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

How reproducible:
Always

Steps to Reproduce:
1. Install RHEL 7.5 on UEFI system
2. Reboot
3. yum remove grub2-efi-x64 shim-x64

Actual results:
Critical packages for system to even show GRUB menu are allowed to be removed.

Expected results:
Critical packages are protected from removal (at least on Yum level, preferable also with rpm dependencies so that "rpm -e ..." would fail as well).

Comment 2 Marko Myllynen 2018-10-19 07:41:43 UTC
Corresponding Fedora BZ:

https://bugzilla.redhat.com/show_bug.cgi?id=1640920

Comment 3 Jiri Konecny 2018-10-19 08:29:52 UTC
This is more question related to bootloader.

Could the bootloader developers please take a look on this issue?

Comment 4 Alberto Ruiz 2019-08-05 09:08:44 UTC
I agree in principle that this should be fixed, however, I want to fully understand the implications here. Would this just affect systems where the package was installed in the first place? I wonder if this would affect a kickstart for a cloud or VM image or a system that doesn't use EFI to boot like legacy. Are we protecting grub2 already?

Comment 5 Jiri Konecny 2019-08-15 08:37:07 UTC
Anaconda should be able to differentiate between image install (how the images are created VM, Cloud...) and installation to the bare metal. So we make these changes only to the bare metal. Also I think we should be able decide this based on the information that this is a EFI installation.

Is that enough Alberto?

Comment 6 Adam Williamson 2019-08-15 15:09:21 UTC
Before steaming ahead with a complicated approach involving logic in anaconda, can we check that there really are any problems with the simple approach of just sticking /etc/yum/protected.d/ files in grub2-efi and shim packages? Because that seems like it would be an awful lot less fragile if it turns out to work...

Comment 9 RHEL Program Management 2021-02-15 07:43:31 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.