2cbdff5
From 8c3c5af7d22366bcebd48817190b22ddbb119f9d Mon Sep 17 00:00:00 2001
7a2a318
From: Peter Robinson <pbrobinson@gmail.com>
7a2a318
Date: Fri, 6 Mar 2015 10:32:40 +0000
2cbdff5
Subject: [PATCH 05/14] add back adding console= to the bootargs if not
425d5f0
 present.
425d5f0
7a2a318
A better soloution is needed, not upstreamable
425d5f0
---
425d5f0
 common/cmd_pxe.c | 20 ++++++++++++++++++--
425d5f0
 1 file changed, 18 insertions(+), 2 deletions(-)
425d5f0
425d5f0
diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
425d5f0
index 7e32c95..4f3c15d 100644
425d5f0
--- a/common/cmd_pxe.c
425d5f0
+++ b/common/cmd_pxe.c
425d5f0
@@ -673,18 +673,34 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
425d5f0
 	if ((label->ipappend & 0x3) || label->append) {
425d5f0
 		char bootargs[CONFIG_SYS_CBSIZE] = "";
425d5f0
 		char finalbootargs[CONFIG_SYS_CBSIZE];
425d5f0
+		char console[30] = "";
425d5f0
+		/* check for a console line in the boot args passed in from the
425d5f0
+		 * config file. If there is no console line and the enviornment
425d5f0
+		 * has a console variable add it to the bootargs
425d5f0
+		 */
425d5f0
+		if ( !strstr(label->append, "console=") ) {
425d5f0
+		      printf("no console= \n");
425d5f0
+		        if (getenv("console")) {
425d5f0
+		                sprintf(console, " console=%s",
425d5f0
+		                        getenv("console"));
425d5f0
+		        }
425d5f0
+		}
425d5f0
 
425d5f0
 		if (strlen(label->append ?: "") +
425d5f0
-		    strlen(ip_str) + strlen(mac_str) + 1 > sizeof(bootargs)) {
425d5f0
-			printf("bootarg overflow %zd+%zd+%zd+1 > %zd\n",
425d5f0
+		    strlen(ip_str) + strlen(mac_str) + strlen(console) +
425d5f0
+		    1 > sizeof(bootargs)) {
425d5f0
+			printf("bootarg overflow %zd+%zd+%zd+%zd+1 > %zd\n",
425d5f0
 			       strlen(label->append ?: ""),
425d5f0
 			       strlen(ip_str), strlen(mac_str),
425d5f0
+			       strlen(console),
425d5f0
 			       sizeof(bootargs));
425d5f0
 			return 1;
425d5f0
 		}
425d5f0
 
425d5f0
 		if (label->append)
425d5f0
 			strcpy(bootargs, label->append);
425d5f0
+		if (strlen(console) > 0)
425d5f0
+			strcat(bootargs, console);
425d5f0
 		strcat(bootargs, ip_str);
425d5f0
 		strcat(bootargs, mac_str);
425d5f0
 
425d5f0
-- 
2cbdff5
2.3.2
425d5f0