diff --git a/subsys/fs/shell.c b/subsys/fs/shell.c index 5ef7b16d4fc78..75a87ba62cf3c 100644 --- a/subsys/fs/shell.c +++ b/subsys/fs/shell.c @@ -17,9 +17,6 @@ #include #include -#define STORAGE_PARTITION storage_partition -#define STORAGE_PARTITION_ID FIXED_PARTITION_ID(STORAGE_PARTITION) - #ifdef CONFIG_FILE_SYSTEM_SHELL_MOUNT_COMMAND /* FAT */ #ifdef CONFIG_FAT_FILESYSTEM_ELM @@ -65,6 +62,15 @@ static struct fs_mount_t littlefs_mnt = { #else #include +#define STORAGE_PARTIION_NODE_ID DT_PHANDLE(DT_INST(0, zephyr_fstab_littlefs), partition) + +#if DT_FIXED_PARTITION_EXISTS(STORAGE_PARTIION_NODE_ID) +#define STORAGE_PARTITION_ID DT_FIXED_PARTITION_ID(STORAGE_PARTIION_NODE_ID) +#else +#define STORAGE_PARTITION storage_partition +#define STORAGE_PARTITION_ID FIXED_PARTITION_ID(STORAGE_PARTITION) +#endif + FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(lfs_data); static struct fs_mount_t littlefs_mnt = { .type = FS_LITTLEFS,