mirror of
https://github.com/AuroraWright/SafeA9LHInstaller.git
synced 2025-06-26 21:52:47 +00:00
Added checks for successful mounting of SD/CTRNAND
This commit is contained in:
parent
51c1e5567a
commit
09435c282b
@ -10,14 +10,12 @@ static FATFS fs;
|
|||||||
|
|
||||||
u32 mountSD(void)
|
u32 mountSD(void)
|
||||||
{
|
{
|
||||||
if(f_mount(&fs, "0:", 1) != FR_OK) return 0;
|
return f_mount(&fs, "0:", 1) == FR_OK;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 mountCTRNAND(void)
|
u32 mountCTRNAND(void)
|
||||||
{
|
{
|
||||||
if(f_mount(&fs, "1:", 1) != FR_OK) return 0;
|
return f_mount(&fs, "1:", 1) == FR_OK;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 fileRead(void *dest, const char *path)
|
u32 fileRead(void *dest, const char *path)
|
||||||
|
@ -59,7 +59,8 @@ void main(void)
|
|||||||
|
|
||||||
static inline void installer(u32 a9lhBoot)
|
static inline void installer(u32 a9lhBoot)
|
||||||
{
|
{
|
||||||
mountSD();
|
if(!mountSD())
|
||||||
|
shutdown(1, "Error: failed to mount the SD card");
|
||||||
|
|
||||||
const char *path;
|
const char *path;
|
||||||
u32 updatea9lh = 0;
|
u32 updatea9lh = 0;
|
||||||
@ -192,7 +193,8 @@ static inline void uninstaller(void)
|
|||||||
}
|
}
|
||||||
else memset32((void *)SECTOR_OFFSET, 0, 0x200);
|
else memset32((void *)SECTOR_OFFSET, 0, 0x200);
|
||||||
|
|
||||||
mountCTRNAND();
|
if(!mountCTRNAND())
|
||||||
|
shutdown(1, "Error: failed to mount CTRNAND");
|
||||||
|
|
||||||
switch(firmRead((void *)FIRM0_OFFSET))
|
switch(firmRead((void *)FIRM0_OFFSET))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user