Skip to contentSkip to conversation

filetype: add Binary PacKage BPK type

PATCH In review Jean-Christophe PLAGNIOL-VILLARD 2 participants 12 messages Sep 21, 2013 – Sep 24, 2013 VFS

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 filetype: add Binary PacKage BPK type

---
 common/filetype.c  | 3 +++
 include/filetype.h | 1 +
 2 files changed, 4 insertions(+)
common/filetype.c +3 -0
index 59ea25a..ef4452d 100644
@@ -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;
include/filetype.h +1 -0
index b83b9be..096fc79 100644
@@ -29,6 +29,7 @@ enum filetype {
 	filetype_ext,
 	filetype_gpt,
 	filetype_ubifs,
+	filetype_bpk,
 	filetype_max,
 };
 
Signature · 7 lines
1.8.4.rc3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH v2 2/2 fs: add BPKFS support

Simple update file format developped for Somfy, tools and library are available under LGPLv2 (https://www.gitorious.org/libbpk).

This format in the v1.0 allow you to store 6 types a binary stream for a unique hardware id:
- bootloader
- bootloader_version
- description.gz
- kernel
- rootfs
- firmware_version

and you can easly add more binary stream type.

The fs will display you in a directory per hw id

and if a binary stream type is unknown will be display as unknown_%08x

 # mount image.bpk /tmp
 # ls -l /tmp/hw_id_0/
-rwxrwxrwx         10 firmware_version
-rwxrwxrwx          8 firmware_version.crc
-rwxrwxrwx    1845968 kernel
-rwxrwxrwx          8 kernel.crc
-rwxrwxrwx    5062656 rootfs
-rwxrwxrwx          8 rootfs.crc
-rwxrwxrwx        248 bootloader
-rwxrwxrwx          8 bootloader.crc
-rwxrwxrwx     248925 description.gz
-rwxrwxrwx          8 description.gz.crc
-rwxrwxrwx          4 bootloader_version
-rwxrwxrwx          8 bootloader_version.crc
-rwxrwxrwx          4 unknown_1234567g
-rwxrwxrwx          8 unknown_1234567g.crc
---
 fs/Kconfig      |   6 +
 fs/Makefile     |   1 +
 fs/bpkfs.c      | 514 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/bpkfs.h |  68 ++++++++
 4 files changed, 589 insertions(+)
 create mode 100644 fs/bpkfs.c
 create mode 100644 include/bpkfs.h
fs/Kconfig +6 -0
index be4797f..17ecb74 100644
@@ -44,6 +44,12 @@ config FS_NFS
 source fs/fat/Kconfig
 source fs/ubifs/Kconfig
 
+config FS_BPKFS
+	bool
+	prompt "BPKFS support"
+	help
+	  
+
 config PARTITION_NEED_MTD
 	bool
 
fs/Makefile +1 -0
index bd02d94..cfef118 100644
@@ -9,3 +9,4 @@ obj-$(CONFIG_FS_UBIFS)	+= ubifs/
 obj-$(CONFIG_FS_TFTP)	+= tftp.o
 obj-$(CONFIG_FS_OMAP4_USBBOOT)	+= omap4_usbbootfs.o
 obj-$(CONFIG_FS_NFS)	+= nfs.o
+obj-$(CONFIG_FS_BPKFS)	+= bpkfs.o
fs/bpkfs.c new file +514 -0

514 lines not on this page · raw message

include/bpkfs.h new file +68 -0

68 lines not on this page · raw message

Signature · 7 lines
1.8.4.rc3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

Re: [PATCH 2/2 v2] fs: add BPKFS support

Some typos inside

Quoted 1 line · Jean-Christophe PLAGNIOL-VILLARD

Simple update file format developped for Somfy, tools and library are

s/developped/developed/

Quoted 2 lines

+/*
+ * Copyright (c) 2013 Jean-Chritstophe PLAGNIOL-VILLARD <[email protected]>

s/Jean-Chritstophe/Jean-Christophe/

Otherwise this looks good.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw
In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 12 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 common/filetype.c  | 3 +++
 include/filetype.h | 1 +
 2 files changed, 4 insertions(+)
common/filetype.c +0 -0
index 59ea25a..ef4452d 100644

common/filetype.c static const struct filetype_str filetype_str[] = { · line 54

Quoted 4 lines
common/filetype.c +1 -0
@@ -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" },

Can we have "Somfy Binary PacKage" here? As this file format is rather exoctic I want to make sure we still know what this is in a few years. Was the CamelCase 'PacKage' intended?

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#9 lore raw
Quoted 8 lines · Sascha Hauer
Quoted 7 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 common/filetype.c  | 3 +++
 include/filetype.h | 1 +
 2 files changed, 4 insertions(+)
Quoted 13 lines

common/filetype.c static const struct filetype_str filetype_str[] = { · line 54

Quoted 9 lines
common/filetype.c +1 -0
index 59ea25a..ef4452d 100644
@@ -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" },

Can we have "Somfy Binary PacKage" here? As this file format is rather exoctic I want to make sure we still know what this is in a few years. Was the CamelCase 'PacKage' intended?

We drop the Somfy to make it more generic and everyone can use it as everything is published

The CamelCase is historical we just kepp it

Best Regards,
J.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#3 lore raw

Re: [PATCH 2/2 v2] fs: add BPKFS support

In reply to Sascha Hauer
Quoted 11 lines · Sascha Hauer

Some typos inside

Quoted 1 line · Jean-Christophe PLAGNIOL-VILLARD

Simple update file format developped for Somfy, tools and library are

s/developped/developed/

Quoted 2 lines

+/*
+ * Copyright (c) 2013 Jean-Chritstophe PLAGNIOL-VILLARD <[email protected]>

s/Jean-Chritstophe/Jean-Christophe/

a tyPo in my own name :(

Quoted 2 lines

Otherwise this looks good.

for some times I was thinking to do the same on uimage

so we do not need to extract struff from it

Best Regards,
J.

Quoted 9 lines

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#4 lore raw

Re: [PATCH 2/2 v2] fs: add BPKFS support

Quoted 13 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 11 lines · Sascha Hauer

Some typos inside

Quoted 1 line · Jean-Christophe PLAGNIOL-VILLARD

Simple update file format developped for Somfy, tools and library are

s/developped/developed/

Quoted 2 lines

+/*
+ * Copyright (c) 2013 Jean-Chritstophe PLAGNIOL-VILLARD <[email protected]>

s/Jean-Chritstophe/Jean-Christophe/

Quoted 7 lines

a tyPo in my own name :(

Quoted 2 lines

Otherwise this looks good.

for some times I was thinking to do the same on uimage

so we do not need to extract struff from it

I have a patch that drops multifile uImage support. It really makes the bootm code more readable.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#10 lore raw
In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 22 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 8 lines · Sascha Hauer
Quoted 7 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 common/filetype.c  | 3 +++
 include/filetype.h | 1 +
 2 files changed, 4 insertions(+)
Quoted 13 lines

common/filetype.c static const struct filetype_str filetype_str[] = { · line 54

Quoted 9 lines
common/filetype.c +1 -0
index 59ea25a..ef4452d 100644
@@ -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" },

Can we have "Somfy Binary PacKage" here? As this file format is rather exoctic I want to make sure we still know what this is in a few years. Was the CamelCase 'PacKage' intended?

Quoted 2 lines

We drop the Somfy to make it more generic and everyone can use it as everything is published

In this case it might be useful to have some pointers *why* someone should use it. To me it looks like a custom cpio format. What's the advantage of using this instead of cpio or even uImage?

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

Re: [PATCH 2/2 v2] fs: add BPKFS support

In reply to Sascha Hauer
Quoted 16 lines · Sascha Hauer
Quoted 15 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 11 lines · Sascha Hauer

Some typos inside

Quoted 1 line · Jean-Christophe PLAGNIOL-VILLARD

Simple update file format developped for Somfy, tools and library are

s/developped/developed/

Quoted 2 lines

+/*
+ * Copyright (c) 2013 Jean-Chritstophe PLAGNIOL-VILLARD <[email protected]>

s/Jean-Chritstophe/Jean-Christophe/

a tyPo in my own name :(

Quoted 1 line
Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Otherwise this looks good.

for some times I was thinking to do the same on uimage

so we do not need to extract struff from it

I have a patch that drops multifile uImage support. It really makes the bootm code more readable.

NO I does use it and in production board

we must have multifile uImage support

Best Regards,
J.

Quoted 8 lines

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#6 lore raw

Re: [PATCH 2/2 v2] fs: add BPKFS support

Quoted 21 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 20 lines · Sascha Hauer
Quoted 19 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 11 lines · Sascha Hauer

Some typos inside

Quoted 1 line · Jean-Christophe PLAGNIOL-VILLARD

Simple update file format developped for Somfy, tools and library are

s/developped/developed/

Quoted 2 lines

+/*
+ * Copyright (c) 2013 Jean-Chritstophe PLAGNIOL-VILLARD <[email protected]>

s/Jean-Chritstophe/Jean-Christophe/

a tyPo in my own name :(

Quoted 2 lines

Otherwise this looks good.

for some times I was thinking to do the same on uimage

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

so we do not need to extract struff from it

I have a patch that drops multifile uImage support. It really makes the bootm code more readable.

NO I does use it and in production board

we must have multifile uImage support

That was in response to "I was thinking to do the same on uimage" which I interpreted in the way that you thought about implementing uimage support as filesystem which would allow us to remove the multifile support from bootm without loosing the feature of handling multifile images.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#7 lore raw

Re: [PATCH 2/2 v2] fs: add BPKFS support

Quoted 29 lines · Sascha Hauer
Quoted 28 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 16 lines · Sascha Hauer
Quoted 15 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 11 lines · Sascha Hauer

Some typos inside

Quoted 1 line · Jean-Christophe PLAGNIOL-VILLARD

Simple update file format developped for Somfy, tools and library are

s/developped/developed/

Quoted 2 lines

+/*
+ * Copyright (c) 2013 Jean-Chritstophe PLAGNIOL-VILLARD <[email protected]>

s/Jean-Chritstophe/Jean-Christophe/

a tyPo in my own name :(

Quoted 1 line
Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Otherwise this looks good.

for some times I was thinking to do the same on uimage

so we do not need to extract struff from it

I have a patch that drops multifile uImage support. It really makes the bootm code more readable.

NO I does use it and in production board

Quoted 7 lines
Quoted 1 line

we must have multifile uImage support

That was in response to "I was thinking to do the same on uimage" which I interpreted in the way that you thought about implementing uimage support as filesystem which would allow us to remove the multifile support from bootm without loosing the feature of handling multifile images.

yes I was thinking of droping all the bootm uImage bla bla code and use an ioctl to get the metadata

and I do agree this will simplify the bootm code

Best Regards,
J.

Quoted 8 lines

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#11 lore raw
In reply to Sascha Hauer
Quoted 23 lines · Sascha Hauer
Quoted 22 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 21 lines · Sascha Hauer
Quoted 12 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 common/filetype.c  | 3 +++
 include/filetype.h | 1 +
 2 files changed, 4 insertions(+)
common/filetype.c +0 -0
index 59ea25a..ef4452d 100644

common/filetype.c static const struct filetype_str filetype_str[] = { · line 54

Quoted 4 lines
common/filetype.c +1 -0
@@ -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" },

Can we have "Somfy Binary PacKage" here? As this file format is rather exoctic I want to make sure we still know what this is in a few years. Was the CamelCase 'PacKage' intended?

Quoted 6 lines
Quoted 2 lines

We drop the Somfy to make it more generic and everyone can use it as everything is published

In this case it might be useful to have some pointers *why* someone should use it. To me it looks like a custom cpio format. What's the advantage of using this instead of cpio or even uImage?

cpio does not handle > 4GiV image and does not have any crc checksum

the bpkfs provide a crc32 for the header and also one per binary stream

so if you does not care of some data you are not force to check them

uImage suffer the same issue as cpio only one crc

and it's a messup to known what it's inside. It just allow you to havea bunch on binary stream without knowning what is what

here with bpkfs you known exactly the binary stream type and for which hw to use it

flexibility & boot time as we boot from bpkfs directly

Best Regards,
J.

Quoted 8 lines

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox