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 2096447 - boot loader entry naming is off when attempting to delete
Summary: boot loader entry naming is off when attempting to delete
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: boom-boot
Version: 9.1
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Bryn M. Reeves
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-13 20:49 UTC by Corey Marthaler
Modified: 2022-11-15 11:43 UTC (History)
5 users (show)

Fixed In Version: boom-boot-1.4-4.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 10:36:23 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github snapshotmanager boom issues 10 0 None open Do not attempt to delete read-only boot entries 2022-06-14 09:42:20 UTC
Red Hat Issue Tracker RHELPLAN-125159 0 None None None 2022-06-13 20:51:45 UTC
Red Hat Product Errata RHBA-2022:8205 0 None None None 2022-11-15 10:36:26 UTC

Description Corey Marthaler 2022-06-13 20:49:20 UTC
Description of problem:

# what actually exists:
/boot/loader/entries/619c4d9f1efa4cf7bd76f149f12138a0-5.14.0-108.el9.x86_64.conf

# what boom is looking for:
/boot/loader/entries/619c4d9f1efa4cf7bd76f149f12138a0-7fce1e5-5.14.0-108.el9.x86_64.conf


# Before upgrade
boom-boot-1.3-3.el9    BUILT: Mon Aug  9 02:52:24 PM CDT 2021

[root@hayes-02 tmp]# boom list
WARNING - Options for BootEntry(boot_id=ffae4a1) do not match OsProfile: marking read-only
WARNING - Options for BootEntry(boot_id=11c1362) do not match OsProfile: marking read-only
BootID  Version                  Name                     RootDevice


# After upgrade
boom-boot-1.4-3.el9    BUILT: Tue May 24 12:25:26 PM CDT 2022                                                                                              

[root@hayes-02 tmp]# boom list
BootID  Version                  Name                     RootDevice
[root@hayes-02 tmp]# boom list
BootID  Version                  Name                     RootDevice

[root@hayes-02 tmp]# boom profile create --from-host --uname-pattern Linux
Created profile with os_id 9a774ee:
  OS ID: "9a774eea9ec42cbb3b7c9598b18d9617242729ec",
  Name: "Red Hat Enterprise Linux", Short name: "rhel",
  Version: "9.1 (Plow)", Version ID: "9.1",
  Kernel pattern: "/vmlinuz-%{version}", Initramfs pattern: "/initramfs-%{version}.img",
  Root options (LVM2): "rd.lvm.lv=%{lvm_root_lv}",
  Root options (BTRFS): "rootflags=%{btrfs_subvolume}",
  Options: "root=%{root_device} ro %{root_opts}",
  Title: "%{os_name} %{os_version_id} (%{version})",
  Optional keys: "", UTS release pattern: "Linux"

[root@hayes-02 tmp]# boom list
BootID  Version                  Name                     RootDevice

[root@hayes-02 tmp]# boom profile create --from-host
Created profile with os_id 9a774ee:
  OS ID: "9a774eea9ec42cbb3b7c9598b18d9617242729ec",
  Name: "Red Hat Enterprise Linux", Short name: "rhel",
  Version: "9.1 (Plow)", Version ID: "9.1",
  Kernel pattern: "/vmlinuz-%{version}", Initramfs pattern: "/initramfs-%{version}.img",
  Root options (LVM2): "rd.lvm.lv=%{lvm_root_lv}",
  Root options (BTRFS): "rootflags=%{btrfs_subvolume}",
  Options: "root=%{root_device} ro %{root_opts}",
  Title: "%{os_name} %{os_version_id} (%{version})",
  Optional keys: "", UTS release pattern: "el9"

[root@hayes-02 tmp]# boom profile list
OsID    Name                     OsVersion 
9a774ee Red Hat Enterprise Linux 9.1 (Plow)

[root@hayes-02 tmp]# boom list
BootID  Version                  Name                     RootDevice                               
7fce1e5 5.14.0-108.el9.x86_64    Red Hat Enterprise Linux UUID=d73af7c8-50e8-4a9d-a6b0-d5b156257c4f

[root@hayes-02 tmp]# boom delete 7fce1e5
Entry does not exist: /boot/loader/entries/619c4d9f1efa4cf7bd76f149f12138a0-7fce1e5-5.14.0-108.el9.x86_64.conf

[root@hayes-02 tmp]# cat /boot/loader/entries/619c4d9f1efa4cf7bd76f149f12138a0-7fce1e5-5.14.0-108.el9.x86_64.conf
cat: /boot/loader/entries/619c4d9f1efa4cf7bd76f149f12138a0-7fce1e5-5.14.0-108.el9.x86_64.conf: No such file or directory

[root@hayes-02 tmp]# cat /boot/loader/entries/619c4d9f1efa4cf7bd76f149f12138a0-
619c4d9f1efa4cf7bd76f149f12138a0-0-rescue.conf               619c4d9f1efa4cf7bd76f149f12138a0-5.14.0-108.el9.x86_64.conf

[root@hayes-02 tmp]# cat /boot/loader/entries/619c4d9f1efa4cf7bd76f149f12138a0-5.14.0-108.el9.x86_64.conf 
title Red Hat Enterprise Linux (5.14.0-108.el9.x86_64) 9.1 (Plow)
version 5.14.0-108.el9.x86_64
linux /vmlinuz-5.14.0-108.el9.x86_64
initrd /initramfs-5.14.0-108.el9.x86_64.img
options root=UUID=d73af7c8-50e8-4a9d-a6b0-d5b156257c4f ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=UUID=3c68c590-75e5-4b61-a46b-ddf26ac26b71 console=ttyS0,115200n8 
grub_users $grub_users
grub_arg --unrestricted
grub_class rhel



# Same issue, another machine:
[root@hayes-03 entries]# boom list
BootID  Version                  Name                     RootDevice                               
29490c5 5.14.0-108.el9.x86_64    Red Hat Enterprise Linux UUID=fa22768c-ed17-40e5-abc5-f572a02c9dd1
[root@hayes-03 entries]# boom delete 29490c5
Entry does not exist: /boot/loader/entries/28fc0d05bf6b460d888965a23ddf1e53-29490c5-5.14.0-108.el9.x86_64.conf


[root@hayes-03 entries]# cat /boot/loader/entries/28fc0d05bf6b460d888965a23ddf1e53-29490c5-5.14.0-108.el9.x86_64.conf
cat: /boot/loader/entries/28fc0d05bf6b460d888965a23ddf1e53-29490c5-5.14.0-108.el9.x86_64.conf: No such file or directory

[root@hayes-03 entries]# cat /boot/loader/entries/28fc0d05bf6b460d888965a23ddf1e53-5.14.0-108.el9.x86_64.conf 
title Red Hat Enterprise Linux (5.14.0-108.el9.x86_64) 9.1 (Plow)
version 5.14.0-108.el9.x86_64
linux /vmlinuz-5.14.0-108.el9.x86_64
initrd /initramfs-5.14.0-108.el9.x86_64.img
options root=UUID=fa22768c-ed17-40e5-abc5-f572a02c9dd1 ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=UUID=5006da32-a076-4111-a314-9fcbe37a0038 console=ttyS0,115200n8 
grub_users $grub_users
grub_arg --unrestricted
grub_class rhel


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Bryn M. Reeves 2022-06-14 09:36:58 UTC
This is happening because this is a system provided entry - i.e. the boot entries that are automatically installed with a kernel update, and that boot the "normal" system instance. Boom treats these entries as read-only and should refuse to remove them, however the error message here is misleading and unhelpful and we should fix it.

In previous versions boom ignored the system entries entirely (some of them do not entirely conform to the requirements of BLS). We now attempt to display them but we do not permit modifying or removing them using boom - the user should manage these entries with e.g. grubby/kernel-install.

In the file system you can distinguish these because the naming pattern is different. Boom entries include the abbreviated boot_id in the file name, so:

  619c4d9f1efa4cf7bd76f149f12138a0-5.14.0-108.el9.x86_64.conf

Is a system provided boot entry and:

  619c4d9f1efa4cf7bd76f149f12138a0-7fce1e5-5.14.0-108.el9.x86_64.conf

Would be an equivalent boom boot entry with the same boot parameters.

The expected results should be something like this:

[root@hayes-02 tmp]# boom delete 7fce1e5
Cannot delete read-only system boot entry: /boot/loader/entries/619c4d9f1efa4cf7bd76f149f12138a0-5.14.0-108.el9.x86_64.conf

Comment 2 Bryn M. Reeves 2022-06-14 12:03:46 UTC
I have modified the message slightly (since there's no way for us to reliably distinguish a system provided entry from a corrupt/edited entry if the user modifies the files directly) but the fix is very straightforward:

commit 609fc6a15bd2dda54f311b09204c57e7d05f7b73 (HEAD -> main)
Author: Bryn M. Reeves <bmr>
Date:   Tue Jun 14 07:54:29 2022 -0400

    boom.bootloader: do not allow deletion of read-only boot entries
    
    Signed-off-by: Bryn M. Reeves <bmr>

diff --git a/boom/bootloader.py b/boom/bootloader.py
index bbf7fd5..e5e8d25 100644
--- a/boom/bootloader.py
+++ b/boom/bootloader.py
@@ -2445,6 +2445,10 @@ class BootEntry(object):
             :raises: ``OsError`` if an error occurs removing the file or
                      ``ValueError`` if the entry does not exist.
         """
+        if self.read_only:
+            raise ValueError("Cannot delete read-only boot "
+                                 "entry: %s" % self._last_path)
+
         if not path_exists(self._entry_path):
             raise ValueError("Entry does not exist: %s" % self._entry_path)
         try:

This now gives the expected behaviour if a user attempts to delete one of these entries.

To list the read-only status of entries add -o+readonly:

  # boom list -o+readonly
  BootID  Version                                 Name                     RootDevice            ReadOnly 
  f6f8df5 4.18.0-348.el8.x86_64                   Red Hat Enterprise Linux /dev/mapper/rhel-root yes      
  a8b2309 4.18.0-383.el8.x86_64+debug             Red Hat Enterprise Linux /dev/mapper/rhel-root yes      
  2b1e650 4.18.0-372.9.1.el8.x86_64               Red Hat Enterprise Linux /dev/mapper/rhel-root yes      
  0e99265 4.18.0-372.9.1.el8.x86_64               Red Hat Enterprise Linux /dev/rhel/root-snap   no       
  87122d0 5.14.0-70.13.1.el9_0.x86_64             Red Hat Enterprise Linux /dev/rhel/root-snap   yes      
  3cf1c0f 5.14.0-70.13.1.el9_0.x86_64+debug-debug Red Hat Enterprise Linux /dev/rhel/root-snap   yes      
  903029c 4.18.0-372.9.1.el8.x86_64               Red Hat Enterprise Linux /dev/rhel/root        no       
  3b7bb70 5.14.0-70.13.1.el9_0.x86_64             Red Hat Enterprise Linux /dev/rhel/root        no       
  c691c87 5.14.0-70.13.1.el9_0.x86_64             Red Hat Enterprise Linux                       yes      

  # boom delete f6f8df5
  Cannot delete read-only boot entry: /boot/loader/entries/68f613d8774e41e792fad28212cfedae-4.18.0-348.el8.x86_64.conf

  # boom delete c691c87
  Cannot delete read-only boot entry: /boot/loader/entries/68f613d8774e41e792fad28212cfedae-6d6dd70-5.14.0-70.13.1.el9_0.x86_64.conf

I have this committed locally and passing the unit tests. I'll work on the fix for bug 2096368 this afternoon and get these pushed out.

Comment 4 Corey Marthaler 2022-07-19 18:39:00 UTC
Marking verified in the latest rpms. The "Cannot delete read-only boot entry" mentioned in comment #1 and comment #2 now exists.

boom-boot-1.4-4.el9    BUILT: Thu Jul 14 01:20:05 AM CDT 2022


[root@hayes-03 ~]# boom list
BootID  Version                  Name                     RootDevice

[root@hayes-03 ~]# boom profile create --from-host --uname-pattern Linux
Created profile with os_id 9a774ee:
  OS ID: "9a774eea9ec42cbb3b7c9598b18d9617242729ec",
  Name: "Red Hat Enterprise Linux", Short name: "rhel",
  Version: "9.1 (Plow)", Version ID: "9.1",
  Kernel pattern: "/vmlinuz-%{version}", Initramfs pattern: "/initramfs-%{version}.img",
  Root options (LVM2): "rd.lvm.lv=%{lvm_root_lv}",
  Root options (BTRFS): "rootflags=%{btrfs_subvolume}",
  Options: "root=%{root_device} ro %{root_opts}",
  Title: "%{os_name} %{os_version_id} (%{version})",
  Optional keys: "grub_users grub_arg grub_class id", UTS release pattern: "Linux"

[root@hayes-03 ~]# boom profile create --from-host
Created profile with os_id 9a774ee:
  OS ID: "9a774eea9ec42cbb3b7c9598b18d9617242729ec",
  Name: "Red Hat Enterprise Linux", Short name: "rhel",
  Version: "9.1 (Plow)", Version ID: "9.1",
  Kernel pattern: "/vmlinuz-%{version}", Initramfs pattern: "/initramfs-%{version}.img",
  Root options (LVM2): "rd.lvm.lv=%{lvm_root_lv}",
  Root options (BTRFS): "rootflags=%{btrfs_subvolume}",
  Options: "root=%{root_device} ro %{root_opts}",
  Title: "%{os_name} %{os_version_id} (%{version})",
  Optional keys: "grub_users grub_arg grub_class id", UTS release pattern: "el9"

[root@hayes-03 ~]# boom profile list
OsID    Name                     OsVersion 
9a774ee Red Hat Enterprise Linux 9.1 (Plow)

[root@hayes-03 ~]# boom list
BootID  Version                  Name                     RootDevice                               
a3aeb39 5.14.0-130.el9.x86_64    Red Hat Enterprise Linux UUID=4bfae9ab-f743-4c01-8afe-f9b0f40cb7fd

[root@hayes-03 ~]# boom delete a3aeb39
Cannot delete read-only boot entry: /boot/loader/entries/9f332573baf345bb861d8a5f9ca00752-5.14.0-130.el9.x86_64.conf

[root@hayes-03 ~]# cat /boot/loader/entries/9f332573baf345bb861d8a5f9ca00752-5.14.0-130.el9.x86_64.conf
title Red Hat Enterprise Linux (5.14.0-130.el9.x86_64) 9.1 (Plow)
version 5.14.0-130.el9.x86_64
linux /vmlinuz-5.14.0-130.el9.x86_64
initrd /initramfs-5.14.0-130.el9.x86_64.img $tuned_initrd
options root=UUID=4bfae9ab-f743-4c01-8afe-f9b0f40cb7fd ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=UUID=c815e233-1085-457a-b5de-6eb64c1ac837 console=ttyS0,115200n8 
grub_users $grub_users
grub_arg --unrestricted
grub_class rhel

Comment 8 errata-xmlrpc 2022-11-15 10:36:23 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 (boom-boot 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-2022:8205


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