.auto_entries = TRUE,
.auto_firmware = TRUE,
.random_seed_mode = RANDOM_SEED_WITH_SYSTEM_TOKEN,
+ .idx_default_efivar = -1,
};
err = file_read(root_dir, L"\\loader\\loader.conf", 0, 0, &content, NULL);
}
static VOID config_default_entry_select(Config *config) {
- _cleanup_freepool_ CHAR16 *entry_oneshot = NULL, *entry_default = NULL;
+ _cleanup_freepool_ CHAR16 *entry_default = NULL;
EFI_STATUS err;
INTN i;
* The EFI variable to specify a boot entry for the next, and only the
* next reboot. The variable is always cleared directly after it is read.
*/
- err = efivar_get(LOADER_GUID, L"LoaderEntryOneShot", &entry_oneshot);
+ err = efivar_get(LOADER_GUID, L"LoaderEntryOneShot", &config->entry_oneshot);
if (!EFI_ERROR(err)) {
-
- config->entry_oneshot = StrDuplicate(entry_oneshot);
efivar_set(LOADER_GUID, L"LoaderEntryOneShot", NULL, EFI_VARIABLE_NON_VOLATILE);
- i = config_entry_find(config, entry_oneshot);
+ i = config_entry_find(config, config->entry_oneshot);
if (i >= 0) {
config->idx_default = i;
return;
*/
err = efivar_get(LOADER_GUID, L"LoaderEntryDefault", &entry_default);
if (!EFI_ERROR(err)) {
-
i = config_entry_find(config, entry_default);
if (i >= 0) {
config->idx_default = i;
return;
}
}
- config->idx_default_efivar = -1;
if (config->entry_count == 0)
return;