diff options
author | Michal Soltys <soltys@ziu.info> | 2013-02-14 16:51:46 +0100 |
---|---|---|
committer | Michal Soltys <soltys@ziu.info> | 2013-02-14 16:53:05 +0100 |
commit | d7c0b9740859eb9051582a260755d8cc20e7c995 (patch) | |
tree | aa60080f757bddb9f1c50c244e9c9e993d464553 | |
parent | 845daa7e0945f11f8697c9d749148b92433342ed (diff) | |
download | syslinux-d7c0b9740859eb9051582a260755d8cc20e7c995.tar.gz syslinux-d7c0b9740859eb9051582a260755d8cc20e7c995.tar.xz syslinux-d7c0b9740859eb9051582a260755d8cc20e7c995.zip |
com32/chain: use disk_guid for part_guid for 0th partition
Initial position of each itarator is whole disk, so this actually
matches.
Signed-off-by: Michal Soltys <soltys@ziu.info>
-rw-r--r-- | com32/chain/chain.c | 10 | ||||
-rw-r--r-- | com32/chain/partiter.c | 1 |
2 files changed, 4 insertions, 7 deletions
diff --git a/com32/chain/chain.c b/com32/chain/chain.c index bb249555..85ec723c 100644 --- a/com32/chain/chain.c +++ b/com32/chain/chain.c @@ -110,15 +110,11 @@ static int find_by_guid(const struct guid *gpt_guid, 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: diff --git a/com32/chain/partiter.c b/com32/chain/partiter.c index c928f350..7f98ecb2 100644 --- a/com32/chain/partiter.c +++ b/com32/chain/partiter.c @@ -142,6 +142,7 @@ static int pi_gpt_ctor(struct part_iter *iter, 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; |