From: Zbigniew Jędrzejewski-Szmek Date: Wed, 7 Mar 2018 09:41:44 +0000 (+0100) Subject: Merge pull request #8086 from hdante/sdboot-setmode-v2 X-Git-Tag: v239~575 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48af1eb6ee46a7d4b94bad70e9b5cdba3b005964;p=thirdparty%2Fsystemd.git Merge pull request #8086 from hdante/sdboot-setmode-v2 --- 48af1eb6ee46a7d4b94bad70e9b5cdba3b005964 diff --cc src/boot/efi/boot.c index 68b3e79155d,107e2451fca..2e613f58e8f --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@@ -68,9 -68,9 +68,11 @@@ typedef struct 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) { @@@ -1012,24 -1020,28 +1026,44 @@@ static VOID config_defaults_load_from_f 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; + } + } } diff --cc src/shared/bootspec.c index 1c9ef400191,c0214b333e3..7bb66f3d879 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@@ -195,19 -185,19 +195,21 @@@ int boot_loader_read_conf(const char *p 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) diff --cc src/shared/bootspec.h index fe875454b1d,820688289a5..12accc6c443 --- a/src/shared/bootspec.h +++ b/src/shared/bootspec.h @@@ -40,8 -40,7 +40,9 @@@ typedef struct BootConfig char *default_pattern; char *timeout; char *editor; + char *auto_entries; + char *auto_firmware; + char *console_mode; char *entry_oneshot; char *entry_default;