Skip to content

Commit

Permalink
examples/module: add hostfs support
Browse files Browse the repository at this point in the history
This allows loading the kernel module from a hostfs file system.

Signed-off-by: Yanfeng Liu <[email protected]>
  • Loading branch information
yf13 authored and xiaoxiang781216 committed Jan 23, 2025
1 parent 077c346 commit 048b3e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions examples/module/main/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/module/main/module_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 048b3e6

Please sign in to comment.