summaryrefslogtreecommitdiff
path: root/fs/fs.c
diff options
context:
space:
mode:
authorNiel Fourie <lusus@denx.de>2020-03-24 16:17:04 +0100
committerTom Rini <trini@konsulko.com>2020-07-07 15:36:59 -0400
commit2280fa56a00a63bbabc2076330367ec2863a474b (patch)
tree73e2b27ac85de642194f505371fa493169b65281 /fs/fs.c
parent0ffdfbd1d0eca769878913d15f232c9219cf2aa1 (diff)
cmd: fs: Add command to list supported fs types
Added command "fstypes" to list supported/included filesystems. Signed-off-by: Niel Fourie <lusus@denx.de> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Limit to sandbox] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'fs/fs.c')
-rw-r--r--fs/fs.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/fs.c b/fs/fs.c
index ad4caaeb1e..8f8938c3c6 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -903,3 +903,23 @@ int do_ln(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[],
return 0;
}
+
+int do_fs_types(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
+{
+ struct fstype_info *drv = fstypes;
+ const int n_ents = ARRAY_SIZE(fstypes);
+ struct fstype_info *entry;
+ int i = 0;
+
+ puts("Supported filesystems");
+ for (entry = drv; entry != drv + n_ents; entry++) {
+ if (entry->fstype != FS_TYPE_ANY) {
+ printf("%c %s", i ? ',' : ':', entry->name);
+ i++;
+ }
+ }
+ if (!i)
+ puts(": <none>");
+ puts("\n");
+ return CMD_RET_SUCCESS;
+}