From 60d9782e522a03b6bb538cfe33315f3072eb079f Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 11 Feb 2022 18:57:13 +0100 Subject: [PATCH] boards/native: default to using littlefs2 on virtual flash --- boards/native/Makefile.dep | 6 ++++++ boards/native/board_init.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/boards/native/Makefile.dep b/boards/native/Makefile.dep index 911661afef..e181c4d931 100644 --- a/boards/native/Makefile.dep +++ b/boards/native/Makefile.dep @@ -14,4 +14,10 @@ ifneq (,$(filter periph_can,$(FEATURES_USED))) endif endif +# default to using littlefs2 on the virtual flash +ifneq (,$(filter vfs_default,$(USEMODULE))) + USEPKG += littlefs2 + USEMODULE += mtd +endif + USEMODULE += native_drivers diff --git a/boards/native/board_init.c b/boards/native/board_init.c index a10942f29d..a50e5f130c 100644 --- a/boards/native/board_init.c +++ b/boards/native/board_init.c @@ -49,25 +49,25 @@ mtd_dev_t *mtd0 = &mtd0_dev.base; #if defined(MODULE_LITTLEFS) #include "fs/littlefs_fs.h" -VFS_AUTO_MOUNT(littlefs, VFS_MTD(mtd0_dev), "/", 0); +VFS_AUTO_MOUNT(littlefs, VFS_MTD(mtd0_dev), "/nvm", 0); /* littlefs2 support */ #elif defined(MODULE_LITTLEFS2) #include "fs/littlefs2_fs.h" -VFS_AUTO_MOUNT(littlefs2, VFS_MTD(mtd0_dev), "/", 0); +VFS_AUTO_MOUNT(littlefs2, VFS_MTD(mtd0_dev), "/nvm", 0); /* spiffs support */ #elif defined(MODULE_SPIFFS) #include "fs/spiffs_fs.h" -VFS_AUTO_MOUNT(spiffs, VFS_MTD(mtd0_dev), "/", 0); +VFS_AUTO_MOUNT(spiffs, VFS_MTD(mtd0_dev), "/nvm", 0); /* FAT support */ #elif defined(MODULE_FATFS_VFS) #include "fs/fatfs.h" -VFS_AUTO_MOUNT(fatfs, VFS_MTD(mtd0_dev), "/", 0); +VFS_AUTO_MOUNT(fatfs, VFS_MTD(mtd0_dev), "/nvm", 0); #endif #endif /* MODULE_VFS */