From 1f6a2e4bf03654f6dc40f314b02a2c53443c46d7 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 4 Sep 2022 18:35:38 +0200 Subject: [PATCH] Fix module loading when modules unmount the sd card --- source/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/main.cpp b/source/main.cpp index 30f3478..2ebdd8c 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -186,6 +187,14 @@ int main(int argc, char **argv) { continue; } + // Some module may unmount the sd card on exit. + FSAInit(); + auto client = FSAAddClient(nullptr); + if (client) { + FSAMount(client, "/dev/sdcard01", "/vol/external01", static_cast(0), nullptr, 0); + FSADelClient(client); + } + uint32_t destination_address_end = ((uint32_t) gModuleData) & 0xFFFF0000; memset((void *) gModuleData, 0, sizeof(module_information_t)); DEBUG_FUNCTION_LINE("Trying to run %s.", setupModules.GetFilepath(i), destination_address_end, ((uint32_t) gModuleData) - MEMORY_REGION_START);