Initial position of each itarator is whole disk, so this actually
matches.
Signed-off-by: Michal Soltys <soltys@ziu.info>
pi_del(&boot_part);
continue;
}
- /* Check for a matching GPT disk guid */
- if (!memcmp(&boot_part->gpt.disk_guid, gpt_guid, sizeof(*gpt_guid))) {
- goto ok;
- }
- /* disk guid doesn't match, maybe partition guid will */
- while (!pi_next(boot_part)) {
+ /* Check for a matching GPT disk/partition guid */
+ do {
if (!memcmp(&boot_part->gpt.part_guid, gpt_guid, sizeof(*gpt_guid)))
goto ok;
- }
+ } while (!pi_next(boot_part));
}
drive = -1;
ok:
iter->gpt.ulast = gpth->lba_last_usable;
memcpy(&iter->gpt.disk_guid, &gpth->disk_guid, sizeof(struct guid));
+ memcpy(&iter->gpt.part_guid, &gpth->disk_guid, sizeof(struct guid));
iter->type = typegpt;
return 0;