From 18a29c641c72b05d55a783743e6f02480f6e7903 Mon Sep 17 00:00:00 2001 From: "ctcaer@gmail.com" Date: Sat, 6 Jul 2019 22:18:32 +0300 Subject: [PATCH] [HOS] Easier kip patching update from release Kip patches will be loaded from patches.ini. If that's not found, then patches_template.ini will be used. --- bootloader/hos/pkg2.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bootloader/hos/pkg2.c b/bootloader/hos/pkg2.c index 4e514ee..2a70364 100644 --- a/bootloader/hos/pkg2.c +++ b/bootloader/hos/pkg2.c @@ -547,8 +547,15 @@ static kip1_id_t _kip_ids[] = static void parse_external_kip_patches() { u32 curr_kip_idx = 0; + char path[64]; + strcpy(path, "bootloader/patches.ini"); + + // If patches.ini not found, try to load from template. + if (f_stat(path, NULL)) + strcpy(path, "bootloader/patches_template.ini"); + LIST_INIT(ini_kip_sections); - if (ini_patch_parse(&ini_kip_sections, "bootloader/patches.ini")) + if (ini_patch_parse(&ini_kip_sections, path)) { // Parse patchsets and glue them together. LIST_FOREACH_ENTRY(ini_kip_sec_t, ini_psec, &ini_kip_sections, link) @@ -1031,7 +1038,7 @@ const char* pkg2_patch_kips(link_t *info, char* patchNames) emu_cfg.fs_ver = currKipIdx; if (currKipIdx) emu_cfg.fs_ver--; - if (currKipIdx > 19) + if (currKipIdx > 17) emu_cfg.fs_ver -= 2; gfx_printf("Injecting emuMMC. FS ver: %d\n", emu_cfg.fs_ver);