1# Copyright (c) 2016 Intel Corporation
2# Copyright (c) 2020 Nordic Semiconductor (ASA)
3# SPDX-License-Identifier: Apache-2.0
4
5menu "File Systems"
6
7config FILE_SYSTEM_LIB_LINK
8	bool "Link file system libraries into build"
9	help
10	  Link in the underlying file system libraries. This can be
11	  enabled without CONFIG_FILE_SYSTEM to enable applications
12	  to work directly with the underlying file system libraries.
13	  This can be useful to avoid linking in the entire filesystem
14	  implementation via `struct fs_file_system_t` if only a subset
15	  is used.
16
17config FILE_SYSTEM
18	bool "File system support"
19	select FILE_SYSTEM_LIB_LINK
20	help
21	  Enables support for file system.
22
23if FILE_SYSTEM
24
25config FILE_SYSTEM_MAX_TYPES
26	int "Maximum number of distinct file system types allowed"
27	default 2
28	help
29	  Zephyr provides several file system types including FatFS and
30	  LittleFS, but it is possible to define additional ones and
31	  register them.  A slot is required for each type.
32
33config FILE_SYSTEM_MAX_FILE_NAME
34	int "Optional override for maximum file name length"
35	default -1
36	help
37	  Specify the maximum file name allowed across all enabled file
38	  system types.  Zero or a negative value selects the maximum
39	  file name length for enabled in-tree file systems.  This
40	  default may be inappropriate when registering an out-of-tree
41	  file system.  Selecting a value less than the actual length
42	  supported by a file system may result in memory access
43	  violations.
44
45config FILE_SYSTEM_INIT_PRIORITY
46	int "File system initialization priority"
47	default 99
48	help
49	  Specify the initialization priority for file systems. In case
50	  automount is enabled, the initialization should be done after
51	  the underlying storage device is initialized.
52
53config FILE_SYSTEM_SHELL
54	bool "File system shell"
55	depends on SHELL
56	help
57	  This shell provides basic browsing of the contents of the
58	  file system.
59
60if FILE_SYSTEM_SHELL
61
62config FILE_SYSTEM_SHELL_MOUNT_COMMAND
63	bool "File system shell mount command"
64	depends on FAT_FILESYSTEM_ELM || FILE_SYSTEM_LITTLEFS
65	depends on HEAP_MEM_POOL_SIZE > 0
66	default y
67	help
68	  Enable file system shell command for mounting file systems. This
69	  requires the heap to be present.
70
71config FILE_SYSTEM_SHELL_TEST_COMMANDS
72	bool "File system shell read/write/erase test commands"
73	select CBPRINTF_FP_SUPPORT
74	help
75	  Enable additional file system shell commands for performing
76	  read/write/erase tests with speed output.
77
78config FILE_SYSTEM_SHELL_BUFFER_SIZE
79	hex "File system shell buffer size"
80	depends on FILE_SYSTEM_SHELL_TEST_COMMANDS
81	default 0x100
82	range 0x20 0x1000000
83	help
84	  Size of the buffer used for file system commands, will determine the
85	  maximum size that can be used with a read/write test. Note that this
86	  is used on the stack.
87
88config FILE_SYSTEM_SHELL_LS_SIZE
89	bool "File system shell ls command to also list size"
90	default y
91	help
92	  While listing files in the file system shell, also list the size of
93	  each file.
94
95endif # FILE_SYSTEM_SHELL
96
97config FILE_SYSTEM_MKFS
98	bool "Allow to format file system"
99	help
100	  Enables function fs_mkfs that can be used to format a storage device.
101
102config FILE_SYSTEM_GC
103	bool "Allow explicit garbage collector call"
104	help
105	  Enables function fs_gc that can be used to proactively run garbage collector.
106
107config FUSE_FS_ACCESS
108	bool "FUSE based access to file system partitions"
109	depends on ARCH_POSIX
110	select NATIVE_USE_NSI_ERRNO
111	help
112	  Expose file system partitions to the host system through FUSE.
113
114choice FUSE_LIBRARY_VERSION
115	prompt "Host FUSE library version"
116	depends on FUSE_FS_ACCESS
117	default FUSE_LIBRARY_V2
118
119config FUSE_LIBRARY_V2
120	bool "Use libfuse(2)"
121	help
122	  Use v2 of the host FUSE library.
123
124config FUSE_LIBRARY_V3
125	bool "Use libfuse3"
126	help
127	  Use the host fuse3 library. This may not be available in older distributions.
128
129endchoice
130
131endif # FILE_SYSTEM
132
133if FILE_SYSTEM_LIB_LINK
134
135config APP_LINK_WITH_FS
136	bool "Link 'app' with FS"
137	default y
138	help
139	  Add FS header files to the 'app' include path. It may be
140	  disabled if the include paths for FS are causing aliasing
141	  issues for 'app'.
142
143# Logging defined here as modules/fs/littlefs/lfs.c expects CONFIG_FS_LOG_LEVEL
144module = FS
145module-str = fs
146source "subsys/logging/Kconfig.template.log_config"
147
148rsource "Kconfig.fatfs"
149rsource "Kconfig.littlefs"
150rsource "ext2/Kconfig"
151rsource "fuse_client/Kconfig"
152rsource "virtiofs/Kconfig"
153
154endif # FILE_SYSTEM_LIB_LINK
155
156rsource "fcb/Kconfig"
157rsource "nvs/Kconfig"
158rsource "zms/Kconfig"
159
160endmenu
161