From 8bda9077c79c8dc61ba35a769cec7287ab7ca0ef Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Wed, 8 May 2024 18:43:52 +0100 Subject: [PATCH 11/11] Revert "boom.cache: ignore foreign boot entries when reference counting" This reverts commit f9704eea7b973863ea5a2bf6ad13cd37abce64f6. The reason for ignoring foreign boot entries when determining reference counts no longer exists (a spurious warning when creating entries with --backup). This commit causes problems if a boom-managed boot entry is modified outside of boom's control (e.g. by kdumctl/grubby appending a modified crashkernel argument): since boom sees the entry as foreign the images used by it end up with a reference count of zero and are automatically removed. Revert the above commit to prevent this behaviour. Signed-off-by: Bryn M. Reeves --- boom/cache.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/boom/cache.py b/boom/cache.py index f4a5391..d84a244 100644 --- a/boom/cache.py +++ b/boom/cache.py @@ -572,10 +572,7 @@ class CacheEntry(object): """Return the current number of boot entries that reference this cache entry. """ - entries = find_entries(Selection(path=self.path)) - # Ignore foreign boot entries - entries = [entry for entry in entries if not entry.read_only] - return len(entries) + return len(find_entries(Selection(path=self.path))) #: The list of cached images for this CacheEntry sorted by increasing age images = [] -- 2.45.2