summaryrefslogtreecommitdiffstats
path: root/common/filetype.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-04-11 09:25:24 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-04-12 11:54:35 +0200
commitf3d1525337ebf135ce0cc99cc2f18b3e77472443 (patch)
treec1e298a38910ab0f43d1f371acc18d9556c69a99 /common/filetype.c
parent6c727af2c27d84f26a04a8075890f575ebf91814 (diff)
downloadbarebox-f3d1525337ebf135ce0cc99cc2f18b3e77472443.tar.gz
filetype: add Android boot image support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/filetype.c')
-rw-r--r--common/filetype.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/filetype.c b/common/filetype.c
index 40faff3..b784bff 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;
}