.. | .. |
---|
368 | 368 | if (gpt_pte[i - 1].ending_lba <= (dev_desc->lba - 0x22)) |
---|
369 | 369 | return; |
---|
370 | 370 | /* The last partition size need align to 4KB, here align to 32KB. */ |
---|
371 | | - gpt_pte[i - 1].ending_lba = dev_desc->lba - 0x40; |
---|
| 371 | + gpt_pte[i - 1].ending_lba = dev_desc->lba - 0x41; |
---|
372 | 372 | calc_crc32 = efi_crc32((const unsigned char *)gpt_pte, |
---|
373 | 373 | le32_to_cpu(gpt_head->num_partition_entries) * |
---|
374 | 374 | le32_to_cpu(gpt_head->sizeof_partition_entry)); |
---|
.. | .. |
---|
963 | 963 | dev_desc->blksz); |
---|
964 | 964 | |
---|
965 | 965 | if ((le64_to_cpu(gpt_h->alternate_lba) + 1) |
---|
966 | | - != cpu_to_le64(dev_desc->lba)) { |
---|
| 966 | + != cpu_to_le64(dev_desc->lba) && |
---|
| 967 | + le64_to_cpu(gpt_h->last_usable_lba) != FACTORY_UNKNOWN_LBA) { |
---|
967 | 968 | printf("%s: failed checking '%s'\n", __func__, |
---|
968 | 969 | "invalid GPT Disk Size"); |
---|
969 | 970 | return -1; |
---|