CHAR16 *entry_default_pattern;
CHAR16 *entry_oneshot;
CHAR16 *options_edit;
- BOOLEAN no_editor;
+ BOOLEAN editor;
+ BOOLEAN auto_entries;
+ BOOLEAN auto_firmware;
+ UINTN console_mode;
+ enum console_mode_change_type console_mode_change;
} Config;
static VOID cursor_left(UINTN *cursor, UINTN *first) {
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;
}
+
+ if (strcmpa((CHAR8 *)"console-mode", key) == 0) {
+ CHAR16 *s;
+
+ if (strcmpa((CHAR8 *)"auto", value) == 0)
+ config->console_mode_change = CONSOLE_MODE_AUTO;
+ else if (strcmpa((CHAR8 *)"max", value) == 0)
+ config->console_mode_change = CONSOLE_MODE_MAX;
+ else if (strcmpa((CHAR8 *)"keep", value) == 0)
+ config->console_mode_change = CONSOLE_MODE_KEEP;
+ else {
+ s = stra_to_str(value);
+ config->console_mode = Atoi(s);
+ config->console_mode_change = CONSOLE_MODE_SET;
+ FreePool(s);
+ }
+
+ continue;
+ }
+
}
}
log_warning("%s:%u: Bad syntax", path, line);
continue;
}
- *p = '\0';
- p = strstrip(p + 1);
- if (streq(buf, "default"))
+ if (streq(field, "default"))
r = free_and_strdup(&config->default_pattern, p);
- else if (streq(buf, "timeout"))
+ else if (streq(field, "timeout"))
r = free_and_strdup(&config->timeout, p);
- else if (streq(buf, "editor"))
+ else if (streq(field, "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 if (streq(buf, "console-mode"))
+ r = free_and_strdup(&config->console_mode, p);
else {
- log_notice("%s:%u: Unknown line \"%s\"", path, line, buf);
+ log_notice("%s:%u: Unknown line \"%s\"", path, line, field);
continue;
}
if (r < 0)