summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbowgotsai <bowgotsai@chromium.org>2013-10-03 08:45:57 (GMT)
committerBowgo Tsai <bowgotsai@chromium.org>2014-01-22 07:01:08 (GMT)
commit97a3b27faa38c0ea452c69d73089e3a591a0b114 (patch)
treef1b84521c8d56a6466df82c5f007b1eb192ff93e
parentad070911e0c0da4f2b40e94021dffd824b2f7fcb (diff)
downloaddepthcharge-firmware-leon-4389.61.B.tar.gz
depthcharge-firmware-leon-4389.61.B.tar.xz
CHERRY-PICK: netboot: Adding tftpserverip into kernel command linefirmware-leon-4389.61.B
This is to support dymanica mini-omaha server address assignment. Netboot firmware passes tftpserverip to kernel to obtain a config file containing mini-omaha server address from tftp server. BUG=chrome-os-partner:22180 TEST=Netboot on falco and factory install shim can get tftpserverip via /proc/cmdline BRANCH=firmware-falco_peppy-4389.B Original-Change-Id: Ic4edd57f619549d504da7e870102c9dafca2d3ad Reviewed-on: https://chromium-review.googlesource.com/171538 Tested-by: Bowgo Tsai <bowgotsai@chromium.org> Reviewed-by: Gabe Black <gabeblack@chromium.org> Commit-Queue: Bowgo Tsai <bowgotsai@chromium.org> (cherry picked from commit edd45fe93b19b4d285fcc990997fb131348a84c6) Change-Id: I1240da17d0724d088f8c03ff14805634f14fc8da Reviewed-on: https://chromium-review.googlesource.com/183400 Commit-Queue: Bowgo Tsai <bowgotsai@chromium.org> Reviewed-by: Gabe Black <gabeblack@chromium.org> Tested-by: Bowgo Tsai <bowgotsai@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.