boom-boot/0011-boom.bootloader-repair-boom-entries-with-mismatched-.patch
Bryn M. Reeves 0ee6d0123d Fixes for RHEL-36337
Resolves: RHEL-52866
2024-08-05 15:15:41 +01:00

39 lines
1.4 KiB
Diff

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