CHAR16 *entry_default_pattern;
CHAR16 *entry_oneshot;
CHAR16 *options_edit;
- BOOLEAN no_editor;
+ BOOLEAN editor;
+ BOOLEAN auto_entries;
+ BOOLEAN auto_firmware;
} Config;
static VOID cursor_left(UINTN *cursor, UINTN *first) {
Print(L"OsIndicationsSupported: %d\n", (UINT64)*b);
FreePool(b);
}
- Print(L"\n");
+
+ Print(L"\n--- press key ---\n\n");
+ console_key_read(&key, TRUE);
Print(L"timeout: %d\n", config->timeout_sec);
if (config->timeout_sec_efivar >= 0)
Print(L"timeout (config): %d\n", config->timeout_sec_config);
if (config->entry_default_pattern)
Print(L"default pattern: '%s'\n", config->entry_default_pattern);
- Print(L"editor: %s\n", yes_no(!config->no_editor));
+ Print(L"editor: %s\n", yes_no(config->editor));
+ Print(L"auto-entries: %s\n", yes_no(config->auto_entries));
+ Print(L"auto-firmware: %s\n", yes_no(config->auto_firmware));
Print(L"\n");
Print(L"config entry count: %d\n", config->entry_count);
case KEYPRESS(0, 0, 'e'):
/* only the options of configured entries can be edited */
- if (config->no_editor || config->entries[idx_highlight]->type == LOADER_UNDEFINED)
+ if (!config->editor || config->entries[idx_highlight]->type == LOADER_UNDEFINED)
break;
uefi_call_wrapper(ST->ConOut->SetAttribute, 2, ST->ConOut, EFI_LIGHTGRAY|EFI_BACKGROUND_BLACK);
uefi_call_wrapper(ST->ConOut->SetCursorPosition, 3, ST->ConOut, 0, y_max-1);
if (EFI_ERROR(parse_boolean(value, &on)))
continue;
- config->no_editor = !on;
+ config->editor = on;
+ }
+
+ if (strcmpa((CHAR8 *)"auto-entries", key) == 0) {
+ BOOLEAN on;
+
+ if (EFI_ERROR(parse_boolean(value, &on)))
+ continue;
+ config->auto_entries = on;
+ }
+
+ if (strcmpa((CHAR8 *)"auto-firmware", key) == 0) {
+ BOOLEAN on;
+
+ if (EFI_ERROR(parse_boolean(value, &on)))
+ continue;
+ config->auto_firmware = on;
}
}
}
UINTN sec;
EFI_STATUS err;
+ config->editor = TRUE;
+ config->auto_entries = TRUE;
+ config->auto_firmware = TRUE;
+
err = file_read(root_dir, L"\\loader\\loader.conf", 0, 0, &content, NULL);
if (!EFI_ERROR(err))
config_defaults_load_from_file(config, content);
ConfigEntry *entry;
EFI_STATUS err;
+ if (!config->auto_entries)
+ return FALSE;
+
/* do not add an entry for ourselves */
if (loaded_image_path && StriCmp(loader, loaded_image_path) == 0)
return FALSE;
UINTN handle_count = 0;
EFI_HANDLE *handles = NULL;
+ if (!config->auto_entries)
+ return;
+
err = LibLocateHandle(ByProtocol, &FileSystemProtocol, NULL, &handle_count, &handles);
if (!EFI_ERROR(err)) {
UINTN i;
L"auto-efi-default", '\0', L"EFI Default Loader", L"\\EFI\\Boot\\boot" EFI_MACHINE_TYPE_NAME ".efi");
config_entry_add_osx(&config);
- if (efivar_get_raw(&global_guid, L"OsIndicationsSupported", &b, &size) == EFI_SUCCESS) {
+ if (config.auto_firmware && efivar_get_raw(&global_guid, L"OsIndicationsSupported", &b, &size) == EFI_SUCCESS) {
UINT64 osind = (UINT64)*b;
if (osind & EFI_OS_INDICATIONS_BOOT_TO_FW_UI)
free(config->default_pattern);
free(config->timeout);
free(config->editor);
+ free(config->auto_entries);
+ free(config->auto_firmware);
free(config->entry_oneshot);
free(config->entry_default);
r = free_and_strdup(&config->timeout, p);
else if (streq(buf, "editor"))
r = free_and_strdup(&config->editor, p);
+ else if (streq(buf, "auto-entries"))
+ r = free_and_strdup(&config->auto_entries, p);
+ else if (streq(buf, "auto-firmware"))
+ r = free_and_strdup(&config->auto_firmware, p);
else {
log_notice("%s:%u: Unknown line \"%s\"", path, line, buf);
continue;