1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/vfs: add vfs_default pseudo-module

This commit is contained in:
Benjamin Valentin 2022-02-11 16:41:11 +01:00
parent 25882133f8
commit 92d9d5676a
4 changed files with 41 additions and 4 deletions

View File

@ -30,8 +30,6 @@ USEMODULE += mtd
# Use VFS
USEMODULE += vfs
# the example demonstrates manual file system mounting, disable auto-mount
DISABLE_MODULE += vfs_auto_mount
# Use a file system
# USEMODULE += littlefs

View File

@ -217,8 +217,39 @@ PSEUDOMODULES += suit_transport_%
PSEUDOMODULES += suit_storage_%
PSEUDOMODULES += sys_bus_%
PSEUDOMODULES += vdd_lc_filter_%
## @defgroup pseudomodule_vfs_auto_format vfs_auto_format
## @brief Format mount points at startup unless they can be mounted
##
## When this module is active, mount points configured through the @ref
## pseudomodule_vfs_auto_mount module that can not be mounted at startup are
## formatted and, if that operation is successful, attempted to mount again.
##
## Beware that this may be a harmful procedure in case a bug that corrupts a
## filesystem coincides with a bug that sends the device into a reboot loop.
PSEUDOMODULES += vfs_auto_format
## @defgroup pseudomodule_vfs_auto_mount vfs_auto_mount
## @brief Mount file systems at startup
##
## When this module is active, mount points specified through
## @ref VFS_AUTO_MOUNT are mounted at their designated mount points at startup.
## These mount points can be specified by the application, or are provided by
## some boards if the @ref pseudomodule_vfs_default module is active.
PSEUDOMODULES += vfs_auto_mount
## @defgroup pseudomodule_vfs_default vfs_default
## @brief Enable default assignments of a board's devices to VFS mount points
##
## When this module is active, boards with additional flash storage will
## automatically mount (and possibly format, if @ref
## pseudomodule_vfs_auto_format is enabled) their flash devices with a file
## system that is common for that board (or at least common for this board
## within RIOT).
##
## Boards will generally mount to `/nvm` unless they have several storage
## backends.
PSEUDOMODULES += vfs_default
PSEUDOMODULES += wakaama_objects_%
PSEUDOMODULES += wifi_enterprise
PSEUDOMODULES += xtimer_on_ztimer

View File

@ -498,12 +498,16 @@ ifneq (,$(filter devfs,$(USEMODULE)))
USEMODULE += vfs
endif
ifneq (,$(filter vfs_default,$(USEMODULE)))
USEMODULE += vfs
DEFAULT_MODULE += vfs_auto_mount
endif
ifneq (,$(filter vfs,$(USEMODULE)))
USEMODULE += posix_headers
ifeq (native, $(BOARD))
USEMODULE += native_vfs
endif
DEFAULT_MODULE += vfs_auto_mount
endif
ifneq (,$(filter sock_async_event,$(USEMODULE)))

View File

@ -10,10 +10,14 @@ config MODULE_VFS
depends on TEST_KCONFIG
select MODULE_POSIX_HEADERS
config MODULE_VFS_DEFAULT
bool "Use default (board specific) file systems and mount points"
depends on MODULE_VFS
imply MODULE_VFS_AUTO_MOUNT
config MODULE_VFS_AUTO_MOUNT
bool "Automatically mount configured file systems"
depends on MODULE_VFS
default y
config MODULE_VFS_AUTO_FORMAT
bool "Automatically format configured file systems if mount fails"