1
0
Fork 0
mirror of https://github.com/CTCaer/hekate.git synced 2024-11-26 11:42:09 +00:00

chainloader: Only unmount if trying to update

This will speed up boot times for some sd cards up to 500ms when running update.bin is not needed (old or same version).
This commit is contained in:
Kostas Missos 2019-12-07 02:40:56 +02:00
parent 0b45a5a11a
commit edc2b12f0f

View file

@ -270,8 +270,6 @@ int launch_payload(char *path, bool update)
if (!update) if (!update)
gfx_clear_grey(0x1B); gfx_clear_grey(0x1B);
gfx_con_setpos(0, 0); gfx_con_setpos(0, 0);
if (!path)
return 1;
if (sd_mount()) if (sd_mount())
{ {
@ -279,9 +277,8 @@ int launch_payload(char *path, bool update)
if (f_open(&fp, path, FA_READ)) if (f_open(&fp, path, FA_READ))
{ {
EPRINTFARGS("Payload file is missing!\n(%s)", path); EPRINTFARGS("Payload file is missing!\n(%s)", path);
sd_unmount();
return 1; goto out;
} }
// Read and copy the payload to our chosen address // Read and copy the payload to our chosen address
@ -296,15 +293,14 @@ int launch_payload(char *path, bool update)
if (f_read(&fp, buf, size, NULL)) if (f_read(&fp, buf, size, NULL))
{ {
f_close(&fp); f_close(&fp);
sd_unmount();
return 1; goto out;
} }
f_close(&fp); f_close(&fp);
if (update && is_ipl_updated(buf)) if (update && is_ipl_updated(buf))
return 1; goto out;
sd_unmount(); sd_unmount();
@ -339,6 +335,10 @@ int launch_payload(char *path, bool update)
} }
} }
out:
if (!update)
sd_unmount();
return 1; return 1;
} }