mirror of
https://github.com/LumaTeam/Luma3DS.git
synced 2026-02-22 01:44:38 +00:00
Fix #2034
This commit is contained in:
parent
6c324e0ed0
commit
41dd8bd226
@ -81,31 +81,10 @@ bool remountCtrNandPartition(bool switchMainDir)
|
|||||||
static bool nandInitialized = false;
|
static bool nandInitialized = false;
|
||||||
int res = FR_OK;
|
int res = FR_OK;
|
||||||
|
|
||||||
#if 0
|
|
||||||
Unfortunately the sdmmc driver is really flaky and returns TMIO_STAT_CMD_RESPEND as error.
|
|
||||||
(after timing out)
|
|
||||||
TODO: fix all this tech debt... one day, maybe?
|
|
||||||
|
|
||||||
if (nandInitialized)
|
|
||||||
{
|
|
||||||
res = f_unmount("nand:");
|
|
||||||
if (res != FR_OK)
|
|
||||||
{
|
|
||||||
error("f_unmount returned %d", res);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
nandInitialized = false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!nandInitialized)
|
if (!nandInitialized)
|
||||||
{
|
{
|
||||||
res = f_mount(&nandFs, "nand:", 1);
|
res = f_mount(&nandFs, "nand:", 1);
|
||||||
nandInitialized = res == FR_OK;
|
nandInitialized = res == FR_OK;
|
||||||
if (res != FR_OK)
|
|
||||||
{
|
|
||||||
error("f_mount returned %d", res);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nandInitialized && switchMainDir)
|
if (nandInitialized && switchMainDir)
|
||||||
@ -497,30 +476,10 @@ static bool backupEssentialFiles(void)
|
|||||||
|
|
||||||
bool doLumaUpgradeProcess(void)
|
bool doLumaUpgradeProcess(void)
|
||||||
{
|
{
|
||||||
FirmwareSource oldCtrNandLocation = ctrNandLocation;
|
bool ok = true, ok2 = true;
|
||||||
bool ok = true, ok2 = true, ok3 = true;
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
Unfortunately the sdmmc driver is really flaky and returns TMIO_STAT_CMD_RESPEND as error.
|
|
||||||
(after timing out)
|
|
||||||
TODO: fix all this tech debt... one day, maybe?
|
|
||||||
|
|
||||||
// Ensure SysNAND CTRNAND is mounted
|
|
||||||
if (isSdMode)
|
|
||||||
{
|
|
||||||
ctrNandLocation = FIRMWARE_SYSNAND;
|
|
||||||
if (!remountCtrNandPartition(false))
|
|
||||||
{
|
|
||||||
error("failed to mount");
|
|
||||||
ctrNandLocation = oldCtrNandLocation;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
(void)oldCtrNandLocation;
|
|
||||||
// Ensure CTRNAND is mounted
|
// Ensure CTRNAND is mounted
|
||||||
remountCtrNandPartition(false);
|
remountCtrNandPartition(false);
|
||||||
#endif
|
|
||||||
|
|
||||||
// Try to boot.firm to CTRNAND, when applicable
|
// Try to boot.firm to CTRNAND, when applicable
|
||||||
#ifndef BUILD_FOR_EXPLOIT_DEV
|
#ifndef BUILD_FOR_EXPLOIT_DEV
|
||||||
@ -535,17 +494,5 @@ bool doLumaUpgradeProcess(void)
|
|||||||
fileDelete("sdmc:/luma/config.bin");
|
fileDelete("sdmc:/luma/config.bin");
|
||||||
fileDelete("nand:/rw/luma/config.bin");
|
fileDelete("nand:/rw/luma/config.bin");
|
||||||
|
|
||||||
#if 0
|
return ok && ok2;
|
||||||
if (isSdMode)
|
|
||||||
{
|
|
||||||
ctrNandLocation = oldCtrNandLocation;
|
|
||||||
ok3 = remountCtrNandPartition(false);
|
|
||||||
if (!ok3)
|
|
||||||
error("failed to unmount");
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
(void)ok3;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ok && ok2 && ok3;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user