Skip to content

Commit 048b3e6

Browse files
yf13xiaoxiang781216
authored andcommitted
examples/module: add hostfs support
This allows loading the kernel module from a hostfs file system. Signed-off-by: Yanfeng Liu <[email protected]>
1 parent 077c346 commit 048b3e6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

examples/module/main/Kconfig

+8
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ config EXAMPLES_MODULE_BINDIR
115115
The full, absolute path to the location for the binaries can be
116116
located in a pre-mounted external file system.
117117

118+
config EXAMPLES_MODULE_FSDATA
119+
string "Additional data passed to mount"
120+
default ""
121+
depends on EXAMPLES_MODULE_FSMOUNT
122+
---help---
123+
Additional data needed by mount. For example, when hostfs
124+
is used, this can be "fs=../apps/bin"
125+
118126
config EXAMPLES_MODULE_LIBC
119127
bool "Link with LIBC"
120128
default n

examples/module/main/module_main.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ int main(int argc, FAR char *argv[])
253253
CONFIG_EXAMPLES_MODULE_FSTYPE, MOUNTPT);
254254

255255
ret = mount(CONFIG_EXAMPLES_MODULE_DEVPATH, MOUNTPT,
256-
CONFIG_EXAMPLES_MODULE_FSTYPE, MS_RDONLY, NULL);
256+
CONFIG_EXAMPLES_MODULE_FSTYPE, MS_RDONLY,
257+
CONFIG_EXAMPLES_MODULE_FSDATA);
257258
if (ret < 0)
258259
{
259260
printf("ERROR: mount(%s, %s, %s) failed: %d\n",

0 commit comments

Comments
 (0)