Skip to content
Open
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
TARGET = lfs

ifndef OS
OS := $(shell uname -s)
endif

ifndef CC
CC = cc
endif

ifndef AR
AR = ar
endif

ifndef SIZE
SIZE = size
endif

SRC += $(wildcard *.c littlefs/*.c)
OBJ := $(SRC:.c=.o)
Expand All @@ -28,6 +38,10 @@ override CFLAGS += -DLFS_MULTIVERSION
# enable migrate support in littlefs
override CFLAGS += -DLFS_MIGRATE

ifdef DEFAULT_LFS_BLOCK_SIZE
override CFLAGS += -DDEFAULT_LFS_BLOCK_SIZE=$(DEFAULT_LFS_BLOCK_SIZE)
endif

override LFLAGS += -lfuse

ifeq ($(OS), FreeBSD)
Expand Down
7 changes: 7 additions & 0 deletions lfs_fuse_bd.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ int lfs_fuse_bd_create(struct lfs_config *cfg, const char *path) {
}
cfg->context = (void*)(intptr_t)fd;

// use sector size from build override
#ifdef DEFAULT_LFS_BLOCK_SIZE
if (!cfg->block_size) {
cfg->block_size = DEFAULT_LFS_BLOCK_SIZE;
}
#endif

// get sector size
if (!cfg->block_size) {
long ssize;
Expand Down