[PATCH 09/17] android: boot: boot image header v3, v4 do not support recovery DTBO

Safae Ouajih souajih at baylibre.com
Sat Nov 26 17:59:23 CET 2022


android_image_get_dtbo() is used to get recovery DTBO via abootimg cmd.
This is not supported in boot image header v3 and v4. Thus, we print an
error message when v1,v2 header version are not used.

Signed-off-by: Safae Ouajih <souajih at baylibre.com>
---
 boot/image-android.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/boot/image-android.c b/boot/image-android.c
index d6476904f35e..daf51a7e3b8b 100644
--- a/boot/image-android.c
+++ b/boot/image-android.c
@@ -315,8 +315,8 @@ bool android_image_get_dtbo(ulong hdr_addr, ulong *addr, u32 *size)
 		goto exit;
 	}
 
-	if (hdr->header_version < 1) {
-		printf("Error: header_version must be >= 1 to get dtbo\n");
+	if (hdr->header_version != 1 && hdr->header_version != 2) {
+		printf("Error: header version must be >= 1 and <= 2 to get dtbo\n");
 		ret = false;
 		goto exit;
 	}
-- 
2.25.1



More information about the U-Boot mailing list