summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammed Habibulla <moch@chromium.org>2014-05-14 22:12:20 (GMT)
committerMohammed Habibulla <moch@chromium.org>2014-05-14 22:14:38 (GMT)
commita818ecda78c8ff06da69125672b82ca2113abaf4 (patch)
treec84e9433c09ef58007ea193675cac9abe8b4bf73
parent1d82e0d2cf7ce7a706fc6d65a11d87c05bc25f44 (diff)
downloaddepthcharge-firmware-wolf-4389.24.B.tar.gz
depthcharge-firmware-wolf-4389.24.B.tar.xz
Reapply "CHERRY-PICK: netboot: Adding tftpserverip into kernel command line"firmware-wolf-4389.24.B
BUG=chrome-os-partner:28636 TEST=none This reverts commit 1d82e0d2cf7ce7a706fc6d65a11d87c05bc25f44. Change-Id: I79c668e01356716eda758caeb7c59373f6b34d50 Reviewed-on: https://chromium-review.googlesource.com/199902 Reviewed-by: Mohammed Habibulla <moch@chromium.org> Commit-Queue: Mohammed Habibulla <moch@chromium.org> Tested-by: Mohammed Habibulla <moch@chromium.org>
-rw-r--r--src/netboot/main.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/netboot/main.c b/src/netboot/main.c
index 2e5b67c..799d0c6 100644
--- a/src/netboot/main.c
+++ b/src/netboot/main.c
@@ -217,7 +217,7 @@ int main(void)
printf("The bootfile was %d bytes long.\n", size);
- // Prepare the command line.
+ // Add user supplied parameters to the command line.
param = netboot_params_val(NetbootParamIdKernelArgs);
cmd_line[cmd_line_def_size - 1] = '\0';
if (param->data && param->size > 0) {
@@ -231,6 +231,18 @@ int main(void)
sizeof(cmd_line) - cmd_line_def_size);
}
}
+
+ // Add tftp server IP into command line.
+ static const char def_tftp_cmdline[] = " tftpserverip=xxx.xxx.xxx.xxx";
+ const int tftp_cmdline_def_size = sizeof(def_tftp_cmdline) - 1;
+ int cmd_line_size = strlen(cmd_line);
+ if (cmd_line_size + tftp_cmdline_def_size > sizeof(cmd_line)) {
+ printf("Out of space adding TFTP server IP to the command line.\n");
+ return 1;
+ }
+ sprintf(&cmd_line[cmd_line_size], " tftpserverip=%d.%d.%d.%d",
+ uip_ipaddr1(tftp_ip), uip_ipaddr2(tftp_ip),
+ uip_ipaddr3(tftp_ip), uip_ipaddr4(tftp_ip));
printf("The command line is %s.\n", cmd_line);
// Boot.