Skip to content

Commit

Permalink
board/native: make mount point configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed May 7, 2024
1 parent 0f01fc3 commit 5673a88
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
12 changes: 6 additions & 6 deletions boards/native/board_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,27 @@ MTD_XFA_ADD(mtd0_dev.base, 0);

/* littlefs support */
#if defined(MODULE_LITTLEFS)
VFS_AUTO_MOUNT(littlefs, VFS_MTD(mtd0_dev), VFS_DEFAULT_NVM(0), 0);
VFS_AUTO_MOUNT(littlefs, VFS_MTD(mtd0_dev), CONFIG_NATIVE_MOUNTPOINT, 0);

/* littlefs2 support */
#elif defined(MODULE_LITTLEFS2)
VFS_AUTO_MOUNT(littlefs2, VFS_MTD(mtd0_dev), VFS_DEFAULT_NVM(0), 0);
VFS_AUTO_MOUNT(littlefs2, VFS_MTD(mtd0_dev), CONFIG_NATIVE_MOUNTPOINT, 0);

/* spiffs support */
#elif defined(MODULE_SPIFFS)
VFS_AUTO_MOUNT(spiffs, VFS_MTD(mtd0_dev), VFS_DEFAULT_NVM(0), 0);
VFS_AUTO_MOUNT(spiffs, VFS_MTD(mtd0_dev), CONFIG_NATIVE_MOUNTPOINT, 0);

/* FAT support */
#elif defined(MODULE_FATFS_VFS)
VFS_AUTO_MOUNT(fatfs, VFS_MTD(mtd0_dev), VFS_DEFAULT_NVM(0), 0);
VFS_AUTO_MOUNT(fatfs, VFS_MTD(mtd0_dev), CONFIG_NATIVE_MOUNTPOINT, 0);

/* ext2/3/4 support */
#elif defined(MODULE_LWEXT4)
VFS_AUTO_MOUNT(lwext4, VFS_MTD(mtd0_dev), VFS_DEFAULT_NVM(0), 0);
VFS_AUTO_MOUNT(lwext4, VFS_MTD(mtd0_dev), CONFIG_NATIVE_MOUNTPOINT, 0);

/* host fs pass-through */
#elif defined(MODULE_FS_NATIVE)
VFS_AUTO_MOUNT(native, { .hostpath = FS_NATIVE_DIR }, VFS_DEFAULT_NVM(0), 0);
VFS_AUTO_MOUNT(native, { .hostpath = FS_NATIVE_DIR }, CONFIG_NATIVE_MOUNTPOINT, 0);

#endif
#endif /* MODULE_VFS_DEFAULT */
7 changes: 7 additions & 0 deletions boards/native/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ void _native_LED_RED_TOGGLE(void);
#endif
/** @} */

/**
* @brief The mountpoint at which the native fs gets mounted
*/
#ifndef CONFIG_NATIVE_MOUNTPOINT
#define CONFIG_NATIVE_MOUNTPOINT VFS_DEFAULT_NVM(0)
#endif

#if defined(MODULE_SPIFFS) || DOXYGEN
/**
* @name SPIFFS default configuration
Expand Down

0 comments on commit 5673a88

Please sign in to comment.