uboot-tools/0005-add-back-adding-console-to-the-bootargs-if-not-prese.patch
Peter Robinson 7a2a3182c9 - Update to 2015.04 rc3
- Enable AllWinner: OLinuXino-Lime2 Mele_M3
- Enable i.MX6: novena hummingboard
- Enable TI: Beagle-X15
2015-03-06 13:05:47 +00:00

56 lines
1.8 KiB
Diff

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