hc
2023-11-06 9df731a176aab8e03b984b681b1bea01ccff6644
u-boot/disk/part_efi.c
....@@ -368,7 +368,7 @@
368368 if (gpt_pte[i - 1].ending_lba <= (dev_desc->lba - 0x22))
369369 return;
370370 /* 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;
372372 calc_crc32 = efi_crc32((const unsigned char *)gpt_pte,
373373 le32_to_cpu(gpt_head->num_partition_entries) *
374374 le32_to_cpu(gpt_head->sizeof_partition_entry));
....@@ -963,7 +963,8 @@
963963 dev_desc->blksz);
964964
965965 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) {
967968 printf("%s: failed checking '%s'\n", __func__,
968969 "invalid GPT Disk Size");
969970 return -1;