Commit 1ba28ca6 authored by Guillaume Tucker's avatar Guillaume Tucker Committed by Ricardo Cañuelo Navarro
Browse files

cli: tftpboot: add optional ramdisk argument



Add an optional argument to provide the name of a ramdisk file to
download separately from the kernel image.  When provided, it on to
the netboot() function.

BRANCH=none
BUG=b:154536870
TEST=tftpboot with extra ramdisk argument
Signed-off-by: Guillaume Tucker's avatarGuillaume Tucker <guillaume.tucker@collabora.com>
Change-Id: Ib3382a019cdef3c75fcd826cafb734eb82c85933
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/depthcharge/+/2288613


Commit-Queue: Guenter Roeck <groeck@chromium.org>
Tested-by: default avatarGuenter Roeck <groeck@chromium.org>
Reviewed-by: default avatarGuenter Roeck <groeck@chromium.org>
Reviewed-by: default avatarJulius Werner <jwerner@chromium.org>
parent 60101093
...@@ -33,15 +33,17 @@ int do_tftpboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ...@@ -33,15 +33,17 @@ int do_tftpboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
char *address; char *address;
char *bootfile; char *bootfile;
char *argsfile; char *argsfile;
char *ramdiskfile;
uip_ipaddr_t tftp_ip; uip_ipaddr_t tftp_ip;
uip_ipaddr_t *tftp_ip_arg; uip_ipaddr_t *tftp_ip_arg;
if (argc != 4) if (argc < 4)
return CMD_RET_USAGE; return CMD_RET_USAGE;
address = argv[1]; address = argv[1];
bootfile = (!strcmp(argv[2], DHCP)) ? NULL : argv[2]; bootfile = (!strcmp(argv[2], DHCP)) ? NULL : argv[2];
argsfile = argv[3]; argsfile = argv[3];
ramdiskfile = (argc == 5) ? argv[4] : NULL;
if (!strcmp(address, DHCP)) { if (!strcmp(address, DHCP)) {
tftp_ip_arg = NULL; tftp_ip_arg = NULL;
...@@ -52,7 +54,7 @@ int do_tftpboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ...@@ -52,7 +54,7 @@ int do_tftpboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
tftp_ip_arg = &tftp_ip; tftp_ip_arg = &tftp_ip;
} }
netboot(tftp_ip_arg, bootfile, argsfile, NULL, NULL); netboot(tftp_ip_arg, bootfile, argsfile, NULL, ramdiskfile);
/* netboot() only returns if it failed */ /* netboot() only returns if it failed */
...@@ -60,9 +62,9 @@ int do_tftpboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ...@@ -60,9 +62,9 @@ int do_tftpboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
} }
U_BOOT_CMD( U_BOOT_CMD(
tftpboot, 4, 1, tftpboot, 5, 1,
"boot image via network using TFTP protocol", "boot image via network using TFTP protocol",
"[host IP addr] [boot file] [args file]\n" "[host IP addr] [boot file] [args file] [ramdisk file]\n"
"\n" "\n"
"The IP address and boot file can take the \"dhcp\" special value\n" "The IP address and boot file can take the \"dhcp\" special value\n"
"to send DHCP requests rather than using static values." "to send DHCP requests rather than using static values."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment