From e7ab31b4d1c90ffe41e29b60731742c3cdeed1bd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 20 Mar 2026 17:33:07 +0100 Subject: [PATCH] bootctl: make sure "unlink" properly tracks "extra" files --- src/bootctl/bootctl-unlink.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bootctl/bootctl-unlink.c b/src/bootctl/bootctl-unlink.c index 80e74926c6c..6e8e5c4bb17 100644 --- a/src/bootctl/bootctl-unlink.c +++ b/src/bootctl/bootctl-unlink.c @@ -146,6 +146,12 @@ static int boot_entry_ref_files( return r; } + FOREACH_ARRAY(x, e->local_extras.items, e->local_extras.n_items) { + r = ref_file(known_files, x->location, increment); + if (r < 0) + return r; + } + return 0; } @@ -294,6 +300,8 @@ int boot_entry_unlink( (void) unref_unlink_file(&known_files, root, root_fd, e->device_tree, dry_run); STRV_FOREACH(s, e->device_tree_overlay) (void) unref_unlink_file(&known_files, root, root_fd, *s, dry_run); + FOREACH_ARRAY(x, e->local_extras.items, e->local_extras.n_items) + (void) unref_unlink_file(&known_files, root, root_fd, x->location, dry_run); if (dry_run) log_info("Would remove \"%s\"", e->path);