]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: make sure "unlink" properly tracks "extra" files
authorLennart Poettering <lennart@amutable.com>
Fri, 20 Mar 2026 16:33:07 +0000 (17:33 +0100)
committerLennart Poettering <lennart@amutable.com>
Fri, 1 May 2026 05:10:31 +0000 (07:10 +0200)
src/bootctl/bootctl-unlink.c

index 80e74926c6c7601e7441c4d0cdb77d3defdc90f2..6e8e5c4bb170389bbcc720a99b7e0d6c9046b2ef 100644 (file)
@@ -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);