fs: shell: Fix FS shell using fixed storage_partition name instead of DT

Fix FS shell using fixed 'storage_partition' nodelabel instead of
accessing the DT defined partition from the zephyr,fstab,littlefs
node partition property.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
This commit is contained in:
Joakim Andersson 2025-07-14 15:31:51 +02:00 committed by Anas Nashif
parent e1eaa0e39e
commit 0fde156b9c

View File

@ -17,9 +17,6 @@
#include <inttypes.h>
#include <limits.h>
#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 <zephyr/storage/flash_map.h>
#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,