diff --git a/Dockerfile b/Dockerfile index 8d21833..55dd085 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ FROM wiiuenv/devkitppc:20221228 COPY --from=wiiuenv/libmocha:20220919 /artifacts $DEVKITPRO +COPY --from=wiiuenv/librpxloader:20220903 /artifacts $DEVKITPRO WORKDIR /project diff --git a/Makefile b/Makefile index 1533826..823a926 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,7 @@ CXXFLAGS += -DDEBUG -DVERBOSE_DEBUG -g CFLAGS += -DDEBUG -DVERBOSE_DEBUG -g endif -LIBS :=-lcurl -lmbedtls -lmbedx509 -lmbedcrypto -lz -lmocha -lwut +LIBS :=-lcurl -lmbedtls -lmbedx509 -lmbedcrypto -lz -lmocha -lrpxloader -lwut #------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level diff --git a/source/UpdaterStateCopyDownloadedFiles.cpp b/source/UpdaterStateCopyDownloadedFiles.cpp index 9820f9f..183812b 100644 --- a/source/UpdaterStateCopyDownloadedFiles.cpp +++ b/source/UpdaterStateCopyDownloadedFiles.cpp @@ -96,6 +96,7 @@ bool RenameCurrentToOld(const std::vector &filesTo // rename file to ".temp.old" DEBUG_FUNCTION_LINE("Rename %s to %s", pathOnSDCard.c_str(), pathOnSDCardOld.c_str()); if (rename(pathOnSDCard.c_str(), pathOnSDCardOld.c_str()) < 0) { + DEBUG_FUNCTION_LINE_ERR("Failed to rename %s to %s", pathOnSDCard.c_str(), pathOnSDCardOld.c_str()); allSuccessful = false; break; } diff --git a/source/main.cpp b/source/main.cpp index 4bc46c4..a3fc5d2 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -59,6 +60,16 @@ int main() { DEBUG_FUNCTION_LINE_ERR("Mocha_InitLibrary() failed %d", mochaInitResult); } + RPXLoaderStatus resRPX; + if ((resRPX = RPXLoader_InitLibrary()) == RPX_LOADER_RESULT_SUCCESS) { + if ((resRPX = RPXLoader_UnmountCurrentRunningBundle()) != RPX_LOADER_RESULT_SUCCESS) { + DEBUG_FUNCTION_LINE_ERR("RPXLoader_UnmountCurrentRunningBundle failed: %d, %s", resRPX, RPXLoader_GetStatusStr(resRPX)); + } + RPXLoader_DeInitLibrary(); + } else { + DEBUG_FUNCTION_LINE_ERR("RPXLoader_InitLibrary failed %d %s", resRPX, RPXLoader_GetStatusStr(resRPX)); + } + uint32_t isAPDEnabled; IMIsAPDEnabled(&isAPDEnabled);