mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
examples/module: add hostfs support
This allows loading the kernel module from a hostfs file system. Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
This commit is contained in:
parent
077c3461db
commit
048b3e6f7b
2 changed files with 10 additions and 1 deletions
|
|
@ -115,6 +115,14 @@ config EXAMPLES_MODULE_BINDIR
|
|||
The full, absolute path to the location for the binaries can be
|
||||
located in a pre-mounted external file system.
|
||||
|
||||
config EXAMPLES_MODULE_FSDATA
|
||||
string "Additional data passed to mount"
|
||||
default ""
|
||||
depends on EXAMPLES_MODULE_FSMOUNT
|
||||
---help---
|
||||
Additional data needed by mount. For example, when hostfs
|
||||
is used, this can be "fs=../apps/bin"
|
||||
|
||||
config EXAMPLES_MODULE_LIBC
|
||||
bool "Link with LIBC"
|
||||
default n
|
||||
|
|
|
|||
|
|
@ -253,7 +253,8 @@ int main(int argc, FAR char *argv[])
|
|||
CONFIG_EXAMPLES_MODULE_FSTYPE, MOUNTPT);
|
||||
|
||||
ret = mount(CONFIG_EXAMPLES_MODULE_DEVPATH, MOUNTPT,
|
||||
CONFIG_EXAMPLES_MODULE_FSTYPE, MS_RDONLY, NULL);
|
||||
CONFIG_EXAMPLES_MODULE_FSTYPE, MS_RDONLY,
|
||||
CONFIG_EXAMPLES_MODULE_FSDATA);
|
||||
if (ret < 0)
|
||||
{
|
||||
printf("ERROR: mount(%s, %s, %s) failed: %d\n",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue