(void) efivar_unset(MAKE_GUID_PTR(LOADER), u"LoaderEntryLastBooted", EFI_VARIABLE_NON_VOLATILE);
}
+static EFI_STATUS call_secure_boot_enroll(const BootEntry *entry, EFI_FILE *root_dir, EFI_HANDLE parent_image) {
+ assert(entry);
+
+ return secure_boot_enroll_at(root_dir, entry->path, /* force= */ true);
+}
+
static EFI_STATUS secure_boot_discover_keys(Config *config, EFI_FILE *root_dir) {
EFI_STATUS err;
_cleanup_file_close_ EFI_FILE *keys_basedir = NULL;
.type = LOADER_SECURE_BOOT_KEYS,
.tries_done = -1,
.tries_left = -1,
+ .call = call_secure_boot_enroll,
};
config_add_entry(config, entry);
return EFI_SUCCESS;
}
- /* if auto enrollment is activated, we try to load keys for the given entry. */
- if (entry->type == LOADER_SECURE_BOOT_KEYS) {
- err = secure_boot_enroll_at(root_dir, entry->path, /*force=*/ true);
- if (err != EFI_SUCCESS)
- return err;
- continue;
- }
-
(void) boot_entry_bump_counters(entry);
save_selected_entry(&config, entry);