]> git.ozlabs.org Git - petitboot/commitdiff
util/hooks: Don't update DT when ttyS* console active v1.4.2
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Fri, 10 Mar 2017 05:44:33 +0000 (16:44 +1100)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Fri, 17 Mar 2017 00:34:15 +0000 (11:34 +1100)
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

index 66e7a77b63bddb21ed800448f88c6d267e1b294a..e161d8794c1ad96d696ea99802274fb12107958a 100644 (file)
@@ -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);
        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 {
                fprintf(stderr, "TTY recognised: %s\n", boot_console);
                stdout_path = get_vga_path(ctx);
        } else {