[2/2] util/hooks: Don't update DT when ttyS* console active
diff mbox

Message ID 20170316041952.26883-2-sam@mendozajonas.com
State Accepted
Headers show

Commit Message

Samuel Mendoza-Jonas March 16, 2017, 4:19 a.m. UTC
Update 30-dtb-updates to not accidentally treat ttyS* consoles as tty*
and update linux,stdout-path with the VGA console details.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
---
 utils/hooks/30-dtb-updates.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch
diff mbox

diff --git a/utils/hooks/30-dtb-updates.c b/utils/hooks/30-dtb-updates.c
index 66e7a77..e161d87 100644
--- a/utils/hooks/30-dtb-updates.c
+++ b/utils/hooks/30-dtb-updates.c
@@ -515,7 +515,10 @@  static int set_stdout(struct offb_ctx *ctx)
 	if (strncmp(boot_console, "/dev/", strlen("/dev/")) != 0) {
 		/* We already have the full path */
 		stdout_path = talloc_strdup(ctx, boot_console);
-	} else if (strstr(boot_console, "tty") != NULL) {
+		/* Check for a tty* console but don't accidentally catch
+		 * ttyS* consoles */
+	} else if (strstr(boot_console, "tty") != NULL &&
+			strstr(boot_console, "ttyS") == NULL) {
 		fprintf(stderr, "TTY recognised: %s\n", boot_console);
 		stdout_path = get_vga_path(ctx);
 	} else {