[U-Boot] [PATCH 2/2] disk: part_efi: Omit size on verify for partitions without size

Julian Scheel julian at jusst.de
Wed Jul 27 15:17:51 CEST 2016


If a partition was specified to fill the available space using size "-" a
verification is not possible as there is no sane reference value to compare
against. In this case simply skip the check to avoid printing a meaningless
error.

Signed-off-by: Julian Scheel <julian at jusst.de>
---
 disk/part_efi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/disk/part_efi.c b/disk/part_efi.c
index 0af1e92..bb23c2a 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -654,7 +654,8 @@ int gpt_verify_partitions(struct blk_desc *dev_desc,
 		      (unsigned long long)gpt_part_size,
 		      (unsigned long long)partitions[i].size);
 
-		if (le64_to_cpu(gpt_part_size) != partitions[i].size) {
+		if (partitions[i].size &&
+				le64_to_cpu(gpt_part_size) != partitions[i].size) {
 			error("Partition %s size: %llu does not match %llu!\n",
 			      efi_str, (unsigned long long)gpt_part_size,
 			      (unsigned long long)partitions[i].size);
-- 
2.9.0



More information about the U-Boot mailing list