topaz: gpt-utils: Check for full partiton name instead of partial prefix

Check for full partition name instead of partial prefix to
avoid matching with wrong partitions

Based on: fa259f46c2

Change-Id: I49d8837dc3f407b2c2a944735a25779bb6afb1c6
Signed-off-by: chandu078 <chandudyavanapelli03@gmail.com>
This commit is contained in:
SGCMarkus
2022-10-24 20:34:48 +02:00
committed by boedhack99
parent 82e835adc1
commit f3a1d17d3a

View File

@@ -241,9 +241,9 @@ static int gpt_boot_chain_swap(const uint8_t *pentries_start,
uint8_t ptn_swap[PTN_ENTRY_SIZE];
//Skip the xbl, multiimgoem, multiimgqti partitions on UFS devices. That is handled
//seperately.
if (gpt_utils_is_ufs_device() && (!strncmp(ptn_swap_list[i],PTN_XBL,strlen(PTN_XBL))
|| !strncmp(ptn_swap_list[i],PTN_MULTIIMGOEM,strlen(PTN_MULTIIMGOEM))
|| !strncmp(ptn_swap_list[i],PTN_MULTIIMGQTI,strlen(PTN_MULTIIMGQTI))))
if (gpt_utils_is_ufs_device() && (!strncmp(ptn_swap_list[i],PTN_XBL,strlen(ptn_swap_list[i]))
|| !strncmp(ptn_swap_list[i],PTN_MULTIIMGOEM,strlen(ptn_swap_list[i]))
|| !strncmp(ptn_swap_list[i],PTN_MULTIIMGQTI,strlen(ptn_swap_list[i]))))
continue;
ptn_entry = gpt_pentry_seek(ptn_swap_list[i], pentries_start,
@@ -970,9 +970,9 @@ int prepare_boot_update(enum boot_update_stage stage)
//of being loaded based on well known GUID'S.
//We take care of switching the UFS boot LUN
//explicitly later on.
if (!strncmp(ptn_swap_list[i],PTN_XBL,strlen(PTN_XBL))
|| !strncmp(ptn_swap_list[i],PTN_MULTIIMGOEM,strlen(PTN_MULTIIMGOEM))
|| !strncmp(ptn_swap_list[i],PTN_MULTIIMGQTI,strlen(PTN_MULTIIMGQTI)))
if (!strncmp(ptn_swap_list[i],PTN_XBL,strlen(ptn_swap_list[i]))
|| !strncmp(ptn_swap_list[i],PTN_MULTIIMGOEM,strlen(ptn_swap_list[i]))
|| !strncmp(ptn_swap_list[i],PTN_MULTIIMGQTI,strlen(ptn_swap_list[i])))
continue;
snprintf(buf, sizeof(buf),
"%s/%sbak",