Set default firmSource for CTRNAND mounting in crypto.c, move CTRNAND mounting for SD mode to firm.c

This commit is contained in:
Aurora Wright 2017-09-22 18:05:03 +02:00
parent f46773ba64
commit ac73a96ce2
3 changed files with 3 additions and 4 deletions

View File

@ -327,7 +327,7 @@ __attribute__((aligned(4))) static u8 nandCtr[AES_BLOCK_SIZE];
static u8 nandSlot;
static u32 fatStart = 0;
FirmwareSource firmSource;
FirmwareSource firmSource = FIRMWARE_SYSNAND;
__attribute__((aligned(4))) static const u8 key1s[2][AES_BLOCK_SIZE] = {
{0x07, 0x29, 0x44, 0x38, 0xF8, 0xC9, 0x75, 0x93, 0xAA, 0x0E, 0x4A, 0xB4, 0xAE, 0x84, 0xC1, 0xD8},

View File

@ -152,6 +152,8 @@ static inline u32 loadFirmFromStorage(FirmwareType firmType)
u32 loadNintendoFirm(FirmwareType *firmType, FirmwareSource nandType, bool loadFromStorage, bool isSafeMode)
{
if(isSdMode && !mountFs(false, false)) error("Failed to mount CTRNAND.");
//Load FIRM from CTRNAND
u32 firmVersion = firmRead(firm, (u32)*firmType);

View File

@ -112,7 +112,6 @@ void main(int argc, char **argv, u32 magicWord)
}
else if(memcmp(launchedPath, u"nand", 8) == 0)
{
firmSource = FIRMWARE_SYSNAND;
if(!mountFs(false, true)) error("Failed to mount CTRNAND.");
isSdMode = false;
}
@ -321,8 +320,6 @@ boot:
writeConfig(false);
}
if(isSdMode && !mountFs(false, false)) error("Failed to mount CTRNAND.");
bool loadFromStorage = CONFIG(LOADEXTFIRMSANDMODULES);
u32 firmVersion = loadNintendoFirm(&firmType, firmSource, loadFromStorage, isSafeMode);