From f3d1525337ebf135ce0cc99cc2f18b3e77472443 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 11 Apr 2012 09:25:24 +0200 Subject: [PATCH] filetype: add Android boot image support Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Sascha Hauer --- common/filetype.c | 3 +++ include/filetype.h | 1 + 2 files changed, 4 insertions(+) diff --git a/common/filetype.c b/common/filetype.c index 40faff3ad..b784bffe4 100644 --- a/common/filetype.c +++ b/common/filetype.c @@ -37,6 +37,7 @@ static const char *filetype_str[] = { [filetype_gzip] = "gzip compressed", [filetype_bzip2] = "bzip2 compressed", [filetype_oftree] = "open firmware flat device tree", + [filetype_aimage] = "Android boot image", }; const char *file_type_to_string(enum filetype f) @@ -72,6 +73,8 @@ enum filetype file_detect_type(void *_buf) return filetype_bzip2; if (buf[0] == be32_to_cpu(0xd00dfeed)) return filetype_oftree; + if (strncmp(buf8, "ANDROID!", 8) == 0) + return filetype_aimage; return filetype_unknown; } diff --git a/include/filetype.h b/include/filetype.h index 88f31dfe3..d0b62265b 100644 --- a/include/filetype.h +++ b/include/filetype.h @@ -15,6 +15,7 @@ enum filetype { filetype_gzip, filetype_bzip2, filetype_oftree, + filetype_aimage, }; const char *file_type_to_string(enum filetype f);