Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions subsys/fs/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down