From 6588be675f34436cfef7d41e630e47fda995fa14 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Mon, 24 Apr 2023 13:14:23 +0100
Subject: [PATCH] don't force console mode in grub

the deleted patch (in this commit) was written to fix an
issue theoretically; it hasn't been fully tested, and some
people have reported strange issues since this patch was
merged - there is no proof that this patch causes them, but
removing this patch is the correct thing to do regardless
---
 ...orce-terminal_output-to-console-mode.patch | 34 -------------------
 util/e6400-flash-unlock/e6400_flash_unlock.c  |  5 ++-
 2 files changed, 2 insertions(+), 37 deletions(-)
 delete mode 100644 resources/grub/patches/0004-force-terminal_output-to-console-mode.patch

diff --git a/resources/grub/patches/0004-force-terminal_output-to-console-mode.patch b/resources/grub/patches/0004-force-terminal_output-to-console-mode.patch
deleted file mode 100644
index 1f72a43..0000000
--- a/resources/grub/patches/0004-force-terminal_output-to-console-mode.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 1969f8ff40ac1190a3a2e406d835f7abb098eb9e Mon Sep 17 00:00:00 2001
-From: Leah Rowe <leah@libreboot.org>
-Date: Sun, 5 Mar 2023 20:04:20 +0000
-Subject: [PATCH 1/1] force terminal_output to console mode
-
----
- grub-core/lib/legacy_parse.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/grub-core/lib/legacy_parse.c b/grub-core/lib/legacy_parse.c
-index fa0131a1e..5c2473130 100644
---- a/grub-core/lib/legacy_parse.c
-+++ b/grub-core/lib/legacy_parse.c
-@@ -579,6 +579,9 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix)
- 		}
- 	    }
- 
-+          console = 1; /* force console mode, for coreboot purposes, and
-+                          the old code below is disabled by commenting */
-+/*
- 	  if (grub_memcmp (ptr, "console", sizeof ("console") - 1) == 0)
- 	    console = 1;
- 
-@@ -588,6 +591,7 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix)
- 	    hercules = 1;
- 	  if (grub_memcmp (ptr, "graphics", sizeof ("graphics") - 1) == 0)
- 	    graphics = 1;
-+*/
- 	  while (*ptr && !grub_isspace (*ptr))
- 	    ptr++;
- 	  while (*ptr && grub_isspace (*ptr))
--- 
-2.39.2
-
diff --git a/util/e6400-flash-unlock/e6400_flash_unlock.c b/util/e6400-flash-unlock/e6400_flash_unlock.c
index 88ba2e9..0bffef6 100644
--- a/util/e6400-flash-unlock/e6400_flash_unlock.c
+++ b/util/e6400-flash-unlock/e6400_flash_unlock.c
@@ -63,9 +63,7 @@ volatile uint8_t *rcba_mmio;
 int
 main(int argc, char *argv[])
 {
-	int devmemfd;
-	(void)argc;
-	(void)argv;
+	int devmemfd; (void)argc; (void)argv;
 
 	if ((ioperm(EC_INDEX, 2, 1) == -1) || (ioperm(SMI_EN_REG, 4, 1) == -1))
 		err(errno, "Could not access IO ports");
@@ -92,6 +90,7 @@ main(int argc, char *argv[])
 		set_gbl_smi_en(1);
 		printf("SMIs enabled, you can now shutdown the system.\n");
 	}
+
 	return errno;
 }
 
-- 
GitLab