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
Cc: Fargier Sylvain <sylvain.fargier@somfy.com>
Subject: [PATCH 1/2 v2] filetype: add Binary PacKage BPK type
Date: Sat, 21 Sep 2013 16:54:15 +0200	[thread overview]
Message-ID: <1379775256-29471-1-git-send-email-plagnioj@jcrosoft.com> (raw)

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Fargier Sylvain <sylvain.fargier@somfy.com>
---
 common/filetype.c  | 3 +++
 include/filetype.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/common/filetype.c b/common/filetype.c
index 59ea25a..ef4452d 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -51,6 +51,7 @@ static const struct filetype_str filetype_str[] = {
 	[filetype_png] = { "PNG image", "png" },
 	[filetype_ext] = { "ext filesystem", "ext" },
 	[filetype_gpt] = { "GUID Partition Table", "gpt" },
+	[filetype_bpk] = { "Binary PacKage", "bpk" },
 };
 
 const char *file_type_to_string(enum filetype f)
@@ -221,6 +222,8 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
 		return filetype_png;
 	if (is_barebox_mips_head(_buf))
 		return filetype_mips_barebox;
+	if (buf[0] == be32_to_cpu(0x534F4659))
+		return filetype_bpk;
 
 	if (bufsize < 64)
 		return filetype_unknown;
diff --git a/include/filetype.h b/include/filetype.h
index b83b9be..096fc79 100644
--- a/include/filetype.h
+++ b/include/filetype.h
@@ -29,6 +29,7 @@ enum filetype {
 	filetype_ext,
 	filetype_gpt,
 	filetype_ubifs,
+	filetype_bpk,
 	filetype_max,
 };
 
-- 
1.8.4.rc3


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

             reply	other threads:[~2013-09-21 15:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-21 14:54 Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-09-21 14:54 ` [PATCH 2/2 v2] fs: add BPKFS support Jean-Christophe PLAGNIOL-VILLARD
2013-09-24  7:32   ` Sascha Hauer
2013-09-24  9:24     ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-24  9:33       ` Sascha Hauer
2013-09-24 12:44         ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-24 15:28           ` Sascha Hauer
2013-09-24 16:30             ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-24  7:34 ` [PATCH 1/2 v2] filetype: add Binary PacKage BPK type Sascha Hauer
2013-09-24  9:23   ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-24  9:37     ` Sascha Hauer
2013-09-24 16:38       ` 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=1379775256-29471-1-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    --cc=sylvain.fargier@somfy.com \
    /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