]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: remove fallback EFI Boot#### variable on uninstall 41650/head
authorClayton Craft <clayton@craftyguy.net>
Thu, 30 Apr 2026 03:32:19 +0000 (20:32 -0700)
committerClayton Craft <clayton@craftyguy.net>
Thu, 21 May 2026 18:30:46 +0000 (11:30 -0700)
This cleans up the fallback Boot#### entry that was registered on
install. The logic cleaning up variables was moved from verb_remove into
a new remove_variables function, which mirrors the install side.

src/bootctl/bootctl-install.c

index b3f8be936b305786df7d37639c4e147442490343..b609d8f227cd483566fb5272e7859213e8bfc35e 100644 (file)
@@ -1964,6 +1964,18 @@ static int remove_loader_variables(void) {
         return r;
 }
 
+static int remove_variables(sd_id128_t uuid) {
+        int r = 0;
+
+        const char *path = strjoina("/EFI/systemd/systemd-boot", get_efi_arch(), ".efi");
+        RET_GATHER(r, remove_boot_option(uuid, path, /* in_order= */ true));
+
+        const char *fallback_path = strjoina("/EFI/systemd/systemd-boot-fallback", get_efi_arch(), ".efi");
+        RET_GATHER(r, remove_boot_option(uuid, fallback_path, /* in_order= */ true));
+
+        return RET_GATHER(r, remove_loader_variables());
+}
+
 int verb_remove(int argc, char *argv[], uintptr_t _data, void *userdata) {
         int r;
 
@@ -2031,9 +2043,7 @@ int verb_remove(int argc, char *argv[], uintptr_t _data, void *userdata) {
                 return r;
         }
 
-        char *path = strjoina("/EFI/systemd/systemd-boot", get_efi_arch(), ".efi");
-        RET_GATHER(r, remove_boot_option(c.esp_uuid, path, /* in_order= */ true));
-        return RET_GATHER(r, remove_loader_variables());
+        return remove_variables(c.esp_uuid);
 }
 
 int verb_is_installed(int argc, char *argv[], uintptr_t _data, void *userdata) {