From: Clayton Craft Date: Thu, 30 Apr 2026 03:32:19 +0000 (-0700) Subject: bootctl: remove fallback EFI Boot#### variable on uninstall X-Git-Tag: v261-rc1~24^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F41650%2Fhead;p=thirdparty%2Fsystemd.git bootctl: remove fallback EFI Boot#### variable on uninstall 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. --- diff --git a/src/bootctl/bootctl-install.c b/src/bootctl/bootctl-install.c index b3f8be936b3..b609d8f227c 100644 --- a/src/bootctl/bootctl-install.c +++ b/src/bootctl/bootctl-install.c @@ -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) {