From 8f6c5ff618c0f057df41a6c1af1196a0aabeae27 Mon Sep 17 00:00:00 2001 From: ITotalJustice <47043333+ITotalJustice@users.noreply.github.com> Date: Tue, 27 May 2025 21:47:06 +0100 Subject: [PATCH] enable hdd mounting over ftp, bump ftpsrv commit, disable ftpsrv gc mount, reduce ftpsrv memory usage in half --- sphaira/CMakeLists.txt | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/sphaira/CMakeLists.txt b/sphaira/CMakeLists.txt index 90e9c08..17fafa2 100644 --- a/sphaira/CMakeLists.txt +++ b/sphaira/CMakeLists.txt @@ -155,7 +155,7 @@ set(FETCHCONTENT_QUIET FALSE) FetchContent_Declare(ftpsrv GIT_REPOSITORY https://github.com/ITotalJustice/ftpsrv.git # GIT_TAG 1.2.2 - GIT_TAG f8a30fd + GIT_TAG e4b4548 SOURCE_SUBDIR NONE ) @@ -258,20 +258,20 @@ set(FTPSRV_LIB_BUILD TRUE) set(FTPSRV_LIB_SOCK_UNISTD TRUE) set(FTPSRV_LIB_VFS_CUSTOM ${ftpsrv_SOURCE_DIR}/src/platform/nx/vfs_nx.h) set(FTPSRV_LIB_PATH_SIZE 0x301) -set(FTPSRV_LIB_SESSIONS 32) +set(FTPSRV_LIB_SESSIONS 16) set(FTPSRV_LIB_BUF_SIZE 1024*64) -# workaround until a64 container has latest libnx release. -if (NOT DEFINED USE_VFS_GC) - set(USE_VFS_GC TRUE) -endif() - set(FTPSRV_LIB_CUSTOM_DEFINES USE_VFS_SAVE=$ USE_VFS_STORAGE=$ - USE_VFS_GC=$ - USE_VFS_USBHSFS=$ + # disabled as it may conflict with the gamecard menu. + USE_VFS_GC=$ + USE_VFS_USBHSFS=$ VFS_NX_BUFFER_IO=$ + # let sphaira handle init / closing of the hdd. + USE_VFS_USBHSFS_INIT=$ + # disable romfs mounting as otherwise we cannot write / modify sphaira.nro + USE_VFS_ROMFS=$ ) add_subdirectory(${ftpsrv_SOURCE_DIR} binary_dir) @@ -283,18 +283,14 @@ add_library(ftpsrv_helper ${ftpsrv_SOURCE_DIR}/src/platform/nx/vfs/vfs_nx_fs.c ${ftpsrv_SOURCE_DIR}/src/platform/nx/vfs/vfs_nx_save.c ${ftpsrv_SOURCE_DIR}/src/platform/nx/vfs/vfs_nx_storage.c + ${ftpsrv_SOURCE_DIR}/src/platform/nx/vfs/vfs_nx_stdio.c + ${ftpsrv_SOURCE_DIR}/src/platform/nx/vfs/vfs_nx_hdd.c ${ftpsrv_SOURCE_DIR}/src/platform/nx/utils.c ) -target_link_libraries(ftpsrv_helper PUBLIC ftpsrv) +target_link_libraries(ftpsrv_helper PUBLIC ftpsrv libusbhsfs) target_include_directories(ftpsrv_helper PUBLIC ${ftpsrv_SOURCE_DIR}/src/platform) -if (USE_VFS_GC) - target_sources(ftpsrv_helper PRIVATE - ${ftpsrv_SOURCE_DIR}/src/platform/nx/vfs/vfs_nx_gc.c - ) -endif() - add_library(stb INTERFACE) target_include_directories(stb INTERFACE ${stb_SOURCE_DIR}) @@ -326,7 +322,7 @@ target_link_libraries(sphaira PRIVATE nanovg stb yyjson - libusbhsfs + # libusbhsfs ${minizip_lib} ZLIB::ZLIB