]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #8086 from hdante/sdboot-setmode-v2
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 7 Mar 2018 09:41:44 +0000 (10:41 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 7 Mar 2018 09:41:44 +0000 (10:41 +0100)
1  2 
src/boot/bootctl.c
src/boot/efi/boot.c
src/shared/bootspec.c
src/shared/bootspec.h

Simple merge
index 68b3e79155d2f9c92be53916e7d43c9051c5c3e8,107e2451fca8f07af6c33b0d033cdfe5b7c07627..2e613f58e8faf34513ed8454035845cb3ab9852b
@@@ -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;
+                 }
          }
  }
  
index 1c9ef4001919d5ef11bc5c0571e5248813007989,c0214b333e307168d551a708008ee3178c9ebfa7..7bb66f3d879a9c85807a0d65700ed5bbbf7459a2
@@@ -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)
index fe875454b1db7baa3f1d36b12c43aedd3694cf0d,820688289a57b3fe5217a0844316d01f1f576c8c..12accc6c44302c67f9915af2f0cfb03df204f8e9
@@@ -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;