mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/1] filetype: add Android boot image support
Date: Wed, 11 Apr 2012 09:25:24 +0200	[thread overview]
Message-ID: <1334129124-6903-1-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1334122954-19623-1-git-send-email-plagnioj@jcrosoft.com>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 common/filetype.c  |    3 +++
 include/filetype.h |    1 +
 2 files changed, 4 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;
 }
diff --git a/include/filetype.h b/include/filetype.h
index 88f31df..d0b6226 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);
-- 
1.7.9.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-04-11  7:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-11  5:42 [PATCH 1/1] arm: " Jean-Christophe PLAGNIOL-VILLARD
2012-04-11  6:13 ` Baruch Siach
2012-04-11  7:25 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-04-12 10:01   ` [PATCH 1/1] filetype: " Sascha Hauer
2012-04-12 10:01 ` [PATCH 1/1] arm: " Sascha Hauer
2012-04-12 11:29   ` Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1334129124-6903-1-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox