summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Gilmore <dennis@ausil.us>2014-04-23 15:54:57 -0500
committerDennis Gilmore <dennis@ausil.us>2014-04-25 17:08:07 -0500
commit7dace4fe678448c98ebb7beaa01ca64788ab02b4 (patch)
treea7e732240387a980c049cae420c3bbed615480c8
parent8ef41c6750f256383ea38ee7aa6d03924cdeeeb4 (diff)
downloadu-boot-7dace4fe678448c98ebb7beaa01ca64788ab02b4.tar.gz
u-boot-7dace4fe678448c98ebb7beaa01ca64788ab02b4.tar.xz
u-boot-7dace4fe678448c98ebb7beaa01ca64788ab02b4.zip
automatically add console= to bootline when not existing
if there is a console variable in the u-boot environment and not one on the append line from syslinux config add what is in the environment to the bootargs, allows us to not need to modify the config in a disk image
-rw-r--r--common/cmd_pxe.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
index 9c43e63da8..eb5f9c38f3 100644
--- a/common/cmd_pxe.c
+++ b/common/cmd_pxe.c
@@ -606,6 +606,7 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
char initrd_str[22];
char mac_str[29] = "";
char ip_str[68] = "";
+ char console[30] = "";
char *bootargs;
int bootm_argc = 3;
int len = 0;
@@ -665,8 +666,21 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
}
#endif
- if (label->append)
+ if (label->append) {
len += strlen(label->append);
+ /* 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"));
+ len += strlen(console);
+ }
+ }
+ }
if (len) {
bootargs = malloc(len + 1);
@@ -675,6 +689,8 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
bootargs[0] = '\0';
if (label->append)
strcpy(bootargs, label->append);
+ if (strlen(console) > 0)
+ strcat(bootargs, console);
strcat(bootargs, ip_str);
strcat(bootargs, mac_str);