From 946f6b5c2e2ac5af79b87e10ef67cad5829f206f Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Sun, 12 Jan 2025 14:46:33 +1000 Subject: [PATCH] fs: allow enabling filesystems with `FILE_SYSTEM_LIB_LINK` Update the Kconfig configuration to allow enabling the underlying filesystems (e.g. exFAT), with only `FILE_SYSTEM_LIB_LINK` enabled. Signed-off-by: Jordan Yates --- subsys/fs/Kconfig | 31 ++++++++++++++++++------------- subsys/fs/Kconfig.fatfs | 2 +- subsys/fs/Kconfig.littlefs | 2 +- subsys/fs/ext2/CMakeLists.txt | 2 +- subsys/fs/ext2/Kconfig | 2 +- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/subsys/fs/Kconfig b/subsys/fs/Kconfig index ed3ead2f841..bf6933f13aa 100644 --- a/subsys/fs/Kconfig +++ b/subsys/fs/Kconfig @@ -22,18 +22,6 @@ config FILE_SYSTEM if FILE_SYSTEM -module = FS -module-str = fs -source "subsys/logging/Kconfig.template.log_config" - -config APP_LINK_WITH_FS - bool "Link 'app' with FS" - default y - help - Add FS header files to the 'app' include path. It may be - disabled if the include paths for FS are causing aliasing - issues for 'app'. - config FILE_SYSTEM_MAX_TYPES int "Maximum number of distinct file system types allowed" default 2 @@ -110,11 +98,28 @@ config FUSE_FS_ACCESS help Expose file system partitions to the host system through FUSE. +endif # FILE_SYSTEM + +if FILE_SYSTEM_LIB_LINK + +config APP_LINK_WITH_FS + bool "Link 'app' with FS" + default y + help + Add FS header files to the 'app' include path. It may be + disabled if the include paths for FS are causing aliasing + issues for 'app'. + +# Logging defined here as modules/fs/littlefs/lfs.c expects CONFIG_FS_LOG_LEVEL +module = FS +module-str = fs +source "subsys/logging/Kconfig.template.log_config" + rsource "Kconfig.fatfs" rsource "Kconfig.littlefs" rsource "ext2/Kconfig" -endif # FILE_SYSTEM +endif # FILE_SYSTEM_LIB_LINK rsource "fcb/Kconfig" rsource "nvs/Kconfig" diff --git a/subsys/fs/Kconfig.fatfs b/subsys/fs/Kconfig.fatfs index 59bf3f7aa2d..e91cd71c7dd 100644 --- a/subsys/fs/Kconfig.fatfs +++ b/subsys/fs/Kconfig.fatfs @@ -5,7 +5,7 @@ config FAT_FILESYSTEM_ELM bool "ELM FAT file system support" - depends on FILE_SYSTEM + depends on FILE_SYSTEM_LIB_LINK select DISK_ACCESS help Use the ELM FAT File system implementation. diff --git a/subsys/fs/Kconfig.littlefs b/subsys/fs/Kconfig.littlefs index 048e921f62b..b7e1c4bf8d4 100644 --- a/subsys/fs/Kconfig.littlefs +++ b/subsys/fs/Kconfig.littlefs @@ -5,7 +5,7 @@ config FILE_SYSTEM_LITTLEFS bool "LittleFS support" - depends on FILE_SYSTEM + depends on FILE_SYSTEM_LIB_LINK depends on ZEPHYR_LITTLEFS_MODULE help Enables LittleFS file system support. diff --git a/subsys/fs/ext2/CMakeLists.txt b/subsys/fs/ext2/CMakeLists.txt index e66c8895a4c..8bb69eb2e13 100644 --- a/subsys/fs/ext2/CMakeLists.txt +++ b/subsys/fs/ext2/CMakeLists.txt @@ -6,12 +6,12 @@ target_include_directories(EXT2 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) zephyr_library() zephyr_library_sources( - ext2_ops.c ext2_impl.c ext2_disk_access.c ext2_bitmap.c ext2_diskops.c ) +zephyr_library_sources_ifdef(CONFIG_FILE_SYSTEM ext2_ops.c) zephyr_library_sources_ifdef(CONFIG_FILE_SYSTEM_MKFS ext2_format.c) zephyr_library_link_libraries(EXT2) diff --git a/subsys/fs/ext2/Kconfig b/subsys/fs/ext2/Kconfig index a4f3f919a10..83ebd62f9a7 100644 --- a/subsys/fs/ext2/Kconfig +++ b/subsys/fs/ext2/Kconfig @@ -5,7 +5,7 @@ config FILE_SYSTEM_EXT2 bool "Ext2 file system support" - depends on FILE_SYSTEM + depends on FILE_SYSTEM_LIB_LINK help Enable Ext2 file system support.