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_ext4.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'common/cmd_ext4.c') diff --git a/common/cmd_ext4.c b/common/cmd_ext4.c index 68b047ba6a..6d75dd2b89 100644 --- a/common/cmd_ext4.c +++ b/common/cmd_ext4.c @@ -42,6 +42,12 @@ #include #endif +int do_ext4_size(cmd_tbl_t *cmdtp, int flag, int argc, + char *const argv[]) +{ + return do_size(cmdtp, flag, argc, argv, FS_TYPE_EXT); +} + int do_ext4_load(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) { @@ -113,6 +119,14 @@ U_BOOT_CMD(ext4write, 6, 1, do_ext4_write, #endif +U_BOOT_CMD( + ext4size, 4, 0, do_ext4_size, + "determine a file's size", + " \n" + " - Find file 'filename' from 'dev' on 'interface'\n" + " and determine its size." +); + U_BOOT_CMD(ext4ls, 4, 1, do_ext4_ls, "list files in a directory (default /)", " [directory]\n" -- cgit v1.2.3