Import devel/mklittlefs 3.0.0

Description:
A little fail-safe filesystem designed for microcontrollers.

This tool is specifically patched to work with Espressif ESP8266 line of
chips.

Power-loss resilience - littlefs is designed to handle random power
failures. All file operations have strong copy-on-write guarantees and
if power is lost the filesystem will fall back to the last known good
state.

Dynamic wear leveling - littlefs is designed with flash in mind, and
provides wear leveling over dynamic blocks. Additionally, littlefs can
detect bad blocks and work around them.

Bounded RAM/ROM - littlefs is designed to work with a small amount of
memory. RAM usage is strictly bounded, which means RAM consumption does
not change as the filesystem grows. The filesystem contains no unbounded
recursion and dynamic memory is limited to configurable buffers that can
be provided statically.

ok benoit@
This commit is contained in:
tracey 2021-10-14 13:40:52 +00:00
parent b82015a226
commit 83de8a9d9f
5 changed files with 95 additions and 0 deletions

39
devel/mklittlefs/Makefile Normal file
View File

@ -0,0 +1,39 @@
# $OpenBSD: Makefile,v 1.1.1.1 2021/10/14 13:40:52 tracey Exp $
COMMENT = tool to build and unpack littlefs images
GH_ACCOUNT = earlephilhower
GH_PROJECT = mklittlefs
GH_TAGNAME = 3.0.0
CATEGORIES = devel
LFS_V = 1863dc7883d82bd6ca79faa164b65341064d1c16
MASTER_SITES0 = https://github.com/littlefs-project/littlefs/archive/
DISTFILES = ${GH_PROJECT}-${GH_TAGNAME}${EXTRACT_SUFX}
DISTFILES += littlefs-${LFS_V}{${LFS_V}}${EXTRACT_SUFX}:0
# BSDv3 littlefs and MIT mklittlefs
PERMIT_PACKAGE = Yes
WANTLIB += ${COMPILER_LIBCXX} c m
# C++11
COMPILER = base-clang ports-gcc base-gcc
MAKE_FLAGS = CC="${CC}" CXX="${CXX}" \
VERSION=${GH_TAGNAME} \
LITTLEFS_VERSION=${LFS_V}
USE_GMAKE = Yes
NO_TEST = Yes
post-extract:
mv ${WRKDIR}/littlefs-${LFS_V}/* ${WRKSRC}/littlefs/
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/mklittlefs ${PREFIX}/bin
.include <bsd.port.mk>

View File

@ -0,0 +1,4 @@
SHA256 (littlefs-1863dc7883d82bd6ca79faa164b65341064d1c16.tar.gz) = W3le8jzMoCcVwgudqVChXEV9YDjc6owYE/Hc/ylTtmc=
SHA256 (mklittlefs-3.0.0.tar.gz) = mwOyp5S0RfhmVP7nZENY89xR0bp9Y8VBOY11rKHdV/g=
SIZE (littlefs-1863dc7883d82bd6ca79faa164b65341064d1c16.tar.gz) = 121976
SIZE (mklittlefs-3.0.0.tar.gz) = 40946

View File

@ -0,0 +1,34 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2021/10/14 13:40:52 tracey Exp $
Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -22,6 +22,9 @@ else
ifeq ($(UNAME_S),FreeBSD)
TARGET_OS := freebsd
endif
+ ifeq ($(UNAME_S),OpenBSD)
+ TARGET_OS := openbsd
+ endif
endif
endif # TARGET_OS
@@ -48,7 +51,6 @@ endif
STRIP ?= strip
-VERSION ?= $(shell git describe --always)
LITTLEFS_VERSION := $(shell git -C littlefs describe --tags || echo "unknown")
BUILD_CONFIG_NAME ?= -generic
@@ -75,8 +77,8 @@ override CPPFLAGS := \
-D LFS_NAME_MAX=32 \
$(CPPFLAGS)
-override CFLAGS := -std=gnu99 -Os -Wall $(TARGET_CFLAGS) $(CFLAGS)
-override CXXFLAGS := -std=gnu++11 -Os -Wall $(TARGET_CXXFLAGS) $(CXXFLAGS)
+override CFLAGS := -std=gnu99 -Wall $(TARGET_CFLAGS) $(CFLAGS)
+override CXXFLAGS := -std=gnu++11 -Wall $(TARGET_CXXFLAGS) $(CXXFLAGS)
override LDFLAGS := $(TARGET_LDFLAGS) $(LDFLAGS)
DIST_NAME := mklittlefs-$(VERSION)$(BUILD_CONFIG_NAME)-$(TARGET_OS)

View File

@ -0,0 +1,16 @@
A little fail-safe filesystem designed for microcontrollers.
This tool is specifically patched to work with Espressif ESP8266 line of chips.
Power-loss resilience - littlefs is designed to handle random power failures.
All file operations have strong copy-on-write guarantees and if power is lost
the filesystem will fall back to the last known good state.
Dynamic wear leveling - littlefs is designed with flash in mind, and provides
wear leveling over dynamic blocks. Additionally, littlefs can detect bad blocks
and work around them.
Bounded RAM/ROM - littlefs is designed to work with a small amount of memory.
RAM usage is strictly bounded, which means RAM consumption does not change as
the filesystem grows. The filesystem contains no unbounded recursion and dynamic
memory is limited to configurable buffers that can be provided statically.

View File

@ -0,0 +1,2 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2021/10/14 13:40:52 tracey Exp $
@bin bin/mklittlefs