Initial import: ESP32 ZiFi32 firmware with SMB2/3 VFS bridge
Based on https://github.com/tslabs/zx-evo/tree/master/pentevo/esp32, extended with an SMB2/3 server that exposes the ZX Evolution's real SD card as a network share (browse/download/upload/delete), plus assorted stability and protocol-correctness fixes in vfs_bridge.cpp and the vendored libsmb2 - see firmware/README.md for the detailed changelog and current status. Also adds: - firmware/: ready-to-flash compiled binaries + flashing instructions - hardware/: adapter board connection diagram, PCB photo, and Gerber files - src/third_party/libsmb2: vendored from sahlberg/libsmb2 (LGPL-2.1, see its own COPYING/LICENCE files), de-submoduled to a plain snapshot with local patches applied directly Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
# Modern ESP-IDF (idf_component_register) wrapper around the vendored
|
||||
# libsmb2 checkout at E:\esp32\src\third_party\libsmb2 (upstream
|
||||
# sahlberg/libsmb2, LGPL-2.1). Vendored outside components/ deliberately:
|
||||
# ESP-IDF auto-scans every immediate subdirectory of components/ as a
|
||||
# candidate component, and libsmb2's own CMakeLists.txt predates
|
||||
# idf_component_register (calls add_definitions() at the top level, which
|
||||
# ESP-IDF 6.1's two-pass component requirement scan rejects with
|
||||
# "add_definitions command is not scriptable") — so it must never be
|
||||
# auto-discovered directly. Source list and compile definitions below are
|
||||
# copied from the upstream lib/CMakeLists.txt ESP_PLATFORM branch, minus
|
||||
# aes_apple.c/krb5-wrapper.c (excluded there too for this platform).
|
||||
|
||||
set(LIBSMB2_DIR "${CMAKE_CURRENT_LIST_DIR}/../../third_party/libsmb2")
|
||||
set(LIBSMB2_LIB_DIR "${LIBSMB2_DIR}/lib")
|
||||
|
||||
set(LIBSMB2_SOURCES
|
||||
aes.c
|
||||
aes_reference.c
|
||||
aes128ccm.c
|
||||
alloc.c
|
||||
asn1-ber.c
|
||||
compat.c
|
||||
libsmb2-dcerpc.c
|
||||
libsmb2-dcerpc-srvsvc.c
|
||||
errors.c
|
||||
hmac.c
|
||||
hmac-md5.c
|
||||
init.c
|
||||
libsmb2.c
|
||||
md4c.c
|
||||
md5.c
|
||||
ntlmssp.c
|
||||
pdu.c
|
||||
sha1.c
|
||||
sha224-256.c
|
||||
sha384-512.c
|
||||
smb2-cmd-close.c
|
||||
smb2-cmd-create.c
|
||||
smb2-cmd-echo.c
|
||||
smb2-cmd-error.c
|
||||
smb2-cmd-flush.c
|
||||
smb2-cmd-ioctl.c
|
||||
smb2-cmd-lock.c
|
||||
smb2-cmd-logoff.c
|
||||
smb2-cmd-negotiate.c
|
||||
smb2-cmd-notify-change.c
|
||||
smb2-cmd-oplock-break.c
|
||||
smb2-cmd-query-directory.c
|
||||
smb2-cmd-query-info.c
|
||||
smb2-cmd-read.c
|
||||
smb2-cmd-session-setup.c
|
||||
smb2-cmd-set-info.c
|
||||
smb2-cmd-tree-connect.c
|
||||
smb2-cmd-tree-disconnect.c
|
||||
smb2-cmd-write.c
|
||||
smb2-data-file-info.c
|
||||
smb2-data-filesystem-info.c
|
||||
smb2-data-security-descriptor.c
|
||||
smb2-data-reparse-point.c
|
||||
smb2-share-enum.c
|
||||
smb3-seal.c
|
||||
smb2-signing.c
|
||||
socket.c
|
||||
spnego-wrapper.c
|
||||
sync.c
|
||||
timestamps.c
|
||||
unicode.c
|
||||
usha.c
|
||||
)
|
||||
|
||||
list(TRANSFORM LIBSMB2_SOURCES PREPEND "${LIBSMB2_LIB_DIR}/")
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${LIBSMB2_SOURCES}
|
||||
INCLUDE_DIRS
|
||||
"${LIBSMB2_DIR}/include"
|
||||
"${LIBSMB2_DIR}/include/smb2"
|
||||
"${LIBSMB2_DIR}/include/esp"
|
||||
PRIV_INCLUDE_DIRS
|
||||
"${LIBSMB2_LIB_DIR}"
|
||||
REQUIRES
|
||||
lwip
|
||||
mbedtls
|
||||
sock_utils
|
||||
)
|
||||
|
||||
target_compile_definitions(${COMPONENT_LIB} PRIVATE
|
||||
HAVE_CONFIG_H
|
||||
NEED_READV
|
||||
NEED_WRITEV
|
||||
NEED_GETLOGIN_R
|
||||
NEED_RANDOM
|
||||
NEED_SRANDOM
|
||||
"_U_=__attribute__((unused))"
|
||||
)
|
||||
|
||||
# Vendored upstream code, built as-is: relax -Werror for warning classes that
|
||||
# are harmless in practice (e.g. a tautological unsigned comparison in
|
||||
# libsmb2.c) rather than patching third-party sources to satisfy this
|
||||
# project's stricter default warning flags.
|
||||
target_compile_options(${COMPONENT_LIB} PRIVATE
|
||||
-Wno-error=type-limits
|
||||
)
|
||||
@@ -0,0 +1,8 @@
|
||||
## IDF Component Manager Manifest File
|
||||
dependencies:
|
||||
idf:
|
||||
version: '>=4.1.0'
|
||||
# gethostname() is not provided by ESP-IDF's libc; libsmb2's server accept
|
||||
# path (smb2_serve_port) calls it directly. sock_utils supplies a minimal
|
||||
# implementation.
|
||||
espressif/sock_utils: "*"
|
||||
Reference in New Issue
Block a user