deinit filesystems before booting a firm payload

This commit is contained in:
aspargas2 2020-05-21 15:44:16 -04:00 committed by d0k3
parent 77b83bc89e
commit fd93df60c5
2 changed files with 4 additions and 0 deletions

View File

@ -106,6 +106,8 @@ u32 BootFirmHandler(const char* bootpath, bool verbose, bool delete) {
// boot the FIRM (if we got a proper fixpath) // boot the FIRM (if we got a proper fixpath)
if (*fixpath) { if (*fixpath) {
if (delete) PathDelete(bootpath); if (delete) PathDelete(bootpath);
DeinitExtFS();
DeinitSDCardFS();
PXI_DoCMD(PXI_SET_VMODE, (u32[]){1}, 1); PXI_DoCMD(PXI_SET_VMODE, (u32[]){1}, 1);
PXI_DoCMD(PXI_LEGACY_MODE, NULL, 0); PXI_DoCMD(PXI_LEGACY_MODE, NULL, 0);
BootFirm((FirmHeader*) firm, fixpath); BootFirm((FirmHeader*) firm, fixpath);

View File

@ -1417,6 +1417,8 @@ bool run_cmd(cmd_id id, u32 flags, char** argv, char* err_str) {
snprintf(fixpath, 256, "%s%s", (*argv[0] == '0') ? "sdmc" : "nand", argv[0] + 1); snprintf(fixpath, 256, "%s%s", (*argv[0] == '0') ? "sdmc" : "nand", argv[0] + 1);
else strncpy(fixpath, argv[0], 256); else strncpy(fixpath, argv[0], 256);
fixpath[255] = '\0'; fixpath[255] = '\0';
DeinitExtFS();
DeinitSDCardFS();
PXI_DoCMD(PXI_SET_VMODE, (u32[]){1}, 1); PXI_DoCMD(PXI_SET_VMODE, (u32[]){1}, 1);
PXI_DoCMD(PXI_LEGACY_MODE, NULL, 0); PXI_DoCMD(PXI_LEGACY_MODE, NULL, 0);
BootFirm((FirmHeader*)(void*)firm, fixpath); BootFirm((FirmHeader*)(void*)firm, fixpath);