From cf6598193aed5de8855eaf70c1994f2bc437255a Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 11 Jun 2014 12:47:26 -0600 Subject: fs: implement size/fatsize/ext4size These commands may be used to determine the size of a file without actually reading the whole file content into memory. This may be used to determine if the file will fit into the memory buffer that will contain it. In particular, the DFU code will use it for this purpose in the next commit. Signed-off-by: Stephen Warren --- common/cmd_fs.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'common/cmd_fs.c') diff --git a/common/cmd_fs.c b/common/cmd_fs.c index 78590d2ef0..6754340786 100644 --- a/common/cmd_fs.c +++ b/common/cmd_fs.c @@ -20,6 +20,19 @@ #include #include +static int do_size_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + return do_size(cmdtp, flag, argc, argv, FS_TYPE_ANY); +} + +U_BOOT_CMD( + size, 4, 0, do_size_wrapper, + "determine a file's size", + " \n" + " - Find file 'filename' from 'dev' on 'interface'\n" + " and determine its size." +); + static int do_load_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { -- cgit v1.2.1