X-Git-Url: http://git.openwrt.org/?p=project%2Fprocd.git;a=blobdiff_plain;f=inittab.c;fp=inittab.c;h=2c2270cf68d367bcb882e0467d2bfd2456111daa;hp=45118f4f1eaf05867e98040562131dc7df8e233e;hb=2cfc26f8456a4d5ba3836c914a742f3d00bad781;hpb=945d0d79cbef1f0dd9958f409548d48ce783d933 diff --git a/inittab.c b/inittab.c index 45118f4..2c2270c 100644 --- a/inittab.c +++ b/inittab.c @@ -183,7 +183,15 @@ static void askconsole(struct init_action *a) char line[256], *tty, *split; int i; + /* First, try console= on the kernel command line, + * then fallback to /sys/class/tty/console/active, + * which should work when linux,stdout-path (or equivalent) + * is in the device tree + */ tty = get_cmdline_val("console", line, sizeof(line)); + if (tty == NULL) { + tty = get_active_console(line, sizeof(line)); + } if (tty != NULL) { split = strchr(tty, ','); if (split != NULL)