From: Joshua Watt <jpewhacker@gmail.com>
Date: Mon, 3 Jul 2023 13:39:56 +0000 (-0500)
Subject: cmd: mbr: Force DOS driver to be used for verify
X-Git-Tag: v2025.01-rc5-pxa1908~937^2~2
X-Git-Url: http://git.dujemihanovic.xyz/img/html/static/login.html?a=commitdiff_plain;h=55a424437226f9ef50c3e829dafa6b494377d018;p=u-boot.git

cmd: mbr: Force DOS driver to be used for verify

Forces the DOS partition type driver to be used when verifying the MBR.
This is particularly useful when using a hybrid MBR & GPT layout as
otherwise MBR verification would mostly likely fail since the GPT
partitions will be returned, even if the MBR is actually valid.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

diff --git a/cmd/mbr.c b/cmd/mbr.c
index c269833eb8..ec99b66283 100644
--- a/cmd/mbr.c
+++ b/cmd/mbr.c
@@ -244,7 +244,7 @@ static int do_verify_mbr(struct blk_desc *dev, const char *str)
 	for (i = 0; i < count; i++) {
 		struct disk_partition p;
 
-		if (part_get_info(dev, i + 1, &p))
+		if (part_get_info_by_type(dev, i + 1, PART_TYPE_DOS, &p))
 			goto fail;
 
 		if ((partitions[i].size && p.size != partitions[i].size) ||