Fixes for RHEL-36337

Resolves: RHEL-52866
This commit is contained in:
Bryn M. Reeves 2024-08-05 15:15:41 +01:00
parent 7ae0cc2709
commit 0ee6d0123d
2 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,38 @@
From df56b037a0d4af7f9a9ee15d86f61e82679948f9 Mon Sep 17 00:00:00 2001
From: "Bryn M. Reeves" <bmr@redhat.com>
Date: Tue, 14 May 2024 10:46:07 -0400
Subject: [PATCH] boom.bootloader: repair boom entries with mismatched boot_id
When loading a boom boot entry from a file name that does not match the
boot_id re-write the entry so that it can be manipulated by future
invocations of the boom command.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
---
boom/bootloader.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/boom/bootloader.py b/boom/bootloader.py
index feb669a..095a522 100644
--- a/boom/bootloader.py
+++ b/boom/bootloader.py
@@ -1494,7 +1494,7 @@ class BootEntry(object):
if self.disp_boot_id != match.group(2):
_log_info("Entry file name does not match boot_id: %s" %
entry_basename)
- self.read_only = True
+ self.update_entry(force=True)
self._last_path = entry_file
self._unwritten = False
@@ -2380,6 +2380,7 @@ class BootEntry(object):
# Cache old entry path
to_unlink = self._last_path
self.write_entry(force=force, expand=expand)
+ _log_info("Rewrote entry %s as %s", self.disp_boot_id, self._entry_path)
if self._entry_path != to_unlink:
try:
unlink(to_unlink)
--
2.45.2

View File

@ -21,6 +21,7 @@ Patch7: 0007-boom-drop-Grub2-integration-scripts-and-defaults-fil.patch
Patch8: 0008-boom.command-add-new-os-release-values-to-Red-Hat-op.patch Patch8: 0008-boom.command-add-new-os-release-values-to-Red-Hat-op.patch
Patch9: 0009-boom-remove-BOOM_ENTRY_OPTIONS-hack-from-BootEntry._.patch Patch9: 0009-boom-remove-BOOM_ENTRY_OPTIONS-hack-from-BootEntry._.patch
Patch10: 0010-Revert-boom.cache-ignore-foreign-boot-entries-when-r.patch Patch10: 0010-Revert-boom.cache-ignore-foreign-boot-entries-when-r.patch
Patch11: 0011-boom.bootloader-repair-boom-entries-with-mismatched-.patch
BuildArch: noarch BuildArch: noarch
@ -95,6 +96,7 @@ This package provides configuration files for boom.
%patch8 -p1 %patch8 -p1
%patch9 -p1 %patch9 -p1
%patch10 -p1 %patch10 -p1
%patch11 -p1
%build %build
%if 0%{?sphinx_docs} %if 0%{?sphinx_docs}
@ -161,7 +163,8 @@ rm doc/conf.py
%changelog %changelog
* Tue Jul 30 2024 Bryn M. Reeves <bmr@redhat.com> 1.3-3 * Mon Aug 05 2024 Bryn M. Reeves <bmr@redhat.com> 1.3-3
- boom.bootloader: repair boom entries with mismatched boot_id
- Revert "boom.cache: ignore foreign boot entries when reference counting" - Revert "boom.cache: ignore foreign boot entries when reference counting"
- dist: Drop boom-grub2 package from boom.spec - dist: Drop boom-grub2 package from boom.spec
- boom: remove BOOM_ENTRY_OPTIONS hack from BootEntry.__from_data() - boom: remove BOOM_ENTRY_OPTIONS hack from BootEntry.__from_data()