[HOS] Normalize new pkg2 identification

This commit is contained in:
ctcaer@gmail.com 2019-04-23 03:41:07 +03:00
parent 6aa1bdd1c6
commit 7c877c5bce
3 changed files with 5 additions and 6 deletions

View file

@ -488,8 +488,6 @@ int hos_launch(ini_sec_t *cfg)
gfx_printf("Loaded warmboot and secmon\n");
// Read package2.
if (!strcmp(ctxt.pkg1_id->id, "20190314172056"))
ctxt.new_pkg2 = true;
u8 *bootConfigBuf = _read_emmc_pkg2(&ctxt);
if (!bootConfigBuf)
return 0;
@ -505,7 +503,7 @@ int hos_launch(ini_sec_t *cfg)
}
LIST_INIT(kip1_info);
pkg2_parse_kips(&kip1_info, pkg2_hdr);
pkg2_parse_kips(&kip1_info, pkg2_hdr, &ctxt.new_pkg2);
gfx_printf("Parsed ini1\n");

View file

@ -639,14 +639,15 @@ static u32 _pkg2_calc_kip1_size(pkg2_kip1_t *kip1)
return size;
}
void pkg2_parse_kips(link_t *info, pkg2_hdr_t *pkg2)
void pkg2_parse_kips(link_t *info, pkg2_hdr_t *pkg2, bool *new_pkg2)
{
u8 *ptr;
// Check for new pkg2
// Check for new pkg2 type.
if (!pkg2->sec_size[PKG2_SEC_INI1])
{
u32 kernel_ini1_off = *(u32 *)(pkg2->data + PKG2_NEWKERN_INI1_START);
ptr = pkg2->data + kernel_ini1_off;
*new_pkg2 = true;
}
else
ptr = pkg2->data + pkg2->sec_size[PKG2_SEC_KERNEL];

View file

@ -139,7 +139,7 @@ typedef struct _kip1_id_t
kip1_patchset_t* patchset;
} kip1_id_t;
void pkg2_parse_kips(link_t *info, pkg2_hdr_t *pkg2);
void pkg2_parse_kips(link_t *info, pkg2_hdr_t *pkg2, bool *new_pkg2);
int pkg2_has_kip(link_t *info, u64 tid);
void pkg2_replace_kip(link_t *info, u64 tid, pkg2_kip1_t *kip1);
void pkg2_add_kip(link_t *info, pkg2_kip1_t *kip1);