]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: fix removing variables on uninstall
authorClayton Craft <clayton@craftyguy.net>
Thu, 30 Apr 2026 02:33:58 +0000 (19:33 -0700)
committerClayton Craft <clayton@craftyguy.net>
Thu, 21 May 2026 18:26:59 +0000 (11:26 -0700)
remove_variables looks up the EFI boot entry by matching both the path
and the partition UUID and it wasn't actually removing any entries
because verb_remove was passing SD_ID128_NULL, so the lookup never
matched and Boot#### entries were left behind on uninstall.

Fixes 38433a6

src/bootctl/bootctl-install.c

index 77d03e72b6c5cb2c9a0bbbed04a73b075d6882ed..535019e1e9f159b9c9706d5209399d7376b86096 100644 (file)
@@ -1859,7 +1859,6 @@ static int remove_loader_variables(void) {
 }
 
 int verb_remove(int argc, char *argv[], uintptr_t _data, void *userdata) {
-        sd_id128_t uuid = SD_ID128_NULL;
         int r;
 
         _cleanup_(install_context_done) InstallContext c = INSTALL_CONTEXT_NULL;
@@ -1927,7 +1926,7 @@ int verb_remove(int argc, char *argv[], uintptr_t _data, void *userdata) {
         }
 
         char *path = strjoina("/EFI/systemd/systemd-boot", get_efi_arch(), ".efi");
-        RET_GATHER(r, remove_variables(uuid, path, /* in_order= */ true));
+        RET_GATHER(r, remove_variables(c.esp_uuid, path, /* in_order= */ true));
         return RET_GATHER(r, remove_loader_variables());
 }