This is an automated email from the ASF dual-hosted git repository.

kasjer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit c7b3066d78cf68282b53225f38e701934a4e0165
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Sat Jun 21 22:17:29 2025 +0200

    fs/fs: Add mount cli command
    
    This adds command to show mounted file systems
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 fs/fs/src/fs_cli.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/fs/fs/src/fs_cli.c b/fs/fs/src/fs_cli.c
index 10412d2bc..45a8d5e82 100644
--- a/fs/fs/src/fs_cli.c
+++ b/fs/fs/src/fs_cli.c
@@ -28,6 +28,7 @@
 #include <console/console.h>
 
 #include "fs/fs.h"
+#include "fs/fs_if.h"
 
 static void
 fs_ls_file(const char *name, struct fs_file *file)
@@ -160,6 +161,22 @@ out:
     return 0;
 }
 
+extern struct mount_point mount_points[];
+
+static int
+fs_mount_cmd(int argc, char **argv)
+{
+    console_printf("mount points:\n");
+    for (int i = 0; i < MYNEWT_VAL_FS_MAX_MOUNT_POINTS; ++i) {
+        if (mount_points[i].fs) {
+            console_printf("%s %s\n", mount_points[i].mount_point,
+                           mount_points[i].fs->name);
+        }
+    }
+
+    return 0;
+}
+
 static int
 fs_cat_cmd(int argc, char **argv)
 {
@@ -225,5 +242,6 @@ MAKE_SHELL_CMD(rm, fs_rm_cmd, NULL)
 MAKE_SHELL_CMD(mkdir, fs_mkdir_cmd, NULL)
 MAKE_SHELL_CMD(mv, fs_mv_cmd, NULL)
 MAKE_SHELL_CMD(cat, fs_cat_cmd, NULL)
+MAKE_SHELL_CMD(mount, fs_mount_cmd, NULL)
 
 #endif /* MYNEWT_VAL(FS_CLI) */

Reply via email to