From: Seung-Woo Kim Date: Wed, 2 Aug 2017 10:09:53 +0000 (+0900) Subject: cmd: nfsdown: add image file name as optional argument X-Git-Tag: submit/tizen/20170808.230223~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9817f4a0e8bcf2c6d38814c0c203a210fc704b54;p=platform%2Fkernel%2Fu-boot.git cmd: nfsdown: add image file name as optional argument The nfsdown command takes too much time because it tries to get all possible image files. Add image file name as optional argument. With the optional argument, nfsdown command will get only the file and it reduces time consumption for case of flashing one file. Change-Id: If2995d128c219d100074153ba00be3f4dc5ee1e6 Signed-off-by: Seung-Woo Kim --- diff --git a/cmd/nfsdown.c b/cmd/nfsdown.c index f836520..ff57468 100644 --- a/cmd/nfsdown.c +++ b/cmd/nfsdown.c @@ -337,6 +337,7 @@ int do_nfs_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) char *tmp, *buf; char *line; char src_path[LEN_BUF]; + const char *file_name = NULL; int size; int ret; @@ -353,6 +354,10 @@ int do_nfs_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) case 2: nfs_path = argv[1]; break; + case 3: + nfs_path = argv[1]; + file_name = argv[2]; + break; default: return CMD_RET_USAGE; } @@ -400,6 +405,9 @@ int do_nfs_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } list_for_each_entry(info, &img_info_list, list) { + if (file_name && strcmp(file_name, info->name)) + continue; + snprintf(src_path, LEN_BUF, "%s/%s", nfs_path, info->name); if (info->layout == FS_FAT) @@ -445,7 +453,7 @@ error_end: U_BOOT_CMD(nfsdown, CONFIG_SYS_MAXARGS, 1, do_nfs_down, "TIZEN \"nfs\" downloader", - "[:]\n" + "[:] [image file name]\n" " - device firmware upgrade via nfs for Tizen\n" " fusing images from : to MMC.\n" " - required to set env for ipaddr, serverip, gatewayip,\n"