Browse Source

inittab: fallback when multiple "console=" is detected

Linux Kernel uses a console in the last "console=" parameter in bootargs
as /dev/console, so falllback to /dev/console or get_active_console()
when multiple "console=" parameter is found in bootargs, instead of
using the first console.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
INAGAKI Hiroshi 1 month ago
parent
commit
ca8c30208d
1 changed files with 2 additions and 1 deletions
  1. 2 1
      inittab.c

+ 2 - 1
inittab.c

@@ -192,7 +192,8 @@ static void askconsole(struct init_action *a)
 	 * is in the device tree
 	 */
 	tty = get_cmdline_val("console", line, sizeof(line));
-	if (tty == NULL) {
+	if (tty == NULL ||
+	    get_cmdline_val_offset("console", line, sizeof(line), 1)) {
 		if (dev_exist("console"))
 			tty = "console";
 		else