From febf226992f301da2262c42b7fdf1b5523b6ec00 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Thu, 5 Dec 2019 08:50:59 -0600 Subject: [PATCH] boards/sim/sim/sim/src/sim_bringup.c: Auto mount binfs to /bin if CONFIG_FS_BINFS. --- boards/sim/sim/sim/README.txt | 14 ++++---------- boards/sim/sim/sim/src/sim_bringup.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/boards/sim/sim/sim/README.txt b/boards/sim/sim/sim/README.txt index c32ef860bd..31091845a8 100644 --- a/boards/sim/sim/sim/README.txt +++ b/boards/sim/sim/sim/README.txt @@ -634,16 +634,8 @@ nsh can be made visible in the file system. Because of that, the build in applications do not work as other examples. - For example trying to execute the hello builtin application will - fail: + The binfs filesystem will be mounted at /bin when the system starts up. - nsh> hello - nsh: hello: command not found - nsh> - - Unless you first mount the BINFS file system: - - nsh> mount -t binfs /bin nsh> ls /bin /bin: hello @@ -1216,7 +1208,9 @@ ustream To use the test: - nsh> mount -t binfs /bin nsh> server & nsh> client + Note that the binfs file system is mounted at /bin when the system + starts up. + diff --git a/boards/sim/sim/sim/src/sim_bringup.c b/boards/sim/sim/sim/src/sim_bringup.c index 645edaa95f..e09b7a6ee0 100644 --- a/boards/sim/sim/sim/src/sim_bringup.c +++ b/boards/sim/sim/sim/src/sim_bringup.c @@ -103,6 +103,16 @@ int sim_bringup(void) #endif int ret; +#ifdef CONFIG_FS_BINFS + /* Mount the binfs file system */ + + ret = mount(NULL, "/bin", "binfs", 0, NULL); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to mount binfs at /bin: %d\n", ret); + } +#endif + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */