summaryrefslogtreecommitdiffstats
path: root/include/ubiformat.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-01-29 20:47:26 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-02-09 10:08:58 +0100
commit6f3ff5e61c3ff92356345604415dd682b817bf76 (patch)
treeada1080770116bf729c2e8c12c3e0ee70ebe5429 /include/ubiformat.h
parent359966df3721803a1e0873c98182e7280029b068 (diff)
downloadbarebox-6f3ff5e61c3ff92356345604415dd682b817bf76.tar.gz
barebox-6f3ff5e61c3ff92356345604415dd682b817bf76.tar.xz
ubiformat: Allow to ubiformat with a buffer given
So far ubiformat can only handle files. Make it possible to pass a buffer into ubiformat. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/ubiformat.h')
-rw-r--r--include/ubiformat.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/ubiformat.h b/include/ubiformat.h
index 8305a853c7..8a7a16ac18 100644
--- a/include/ubiformat.h
+++ b/include/ubiformat.h
@@ -15,7 +15,14 @@ struct ubiformat_args {
int ubi_ver;
uint32_t image_seq;
long long ec;
+
+ /*
+ * Either set image if you have a file or set image_buf / image_size
+ * if you have a buffer.
+ */
const char *image;
+ const void *image_buf;
+ loff_t image_size;
};
int ubiformat(struct mtd_info *mtd, struct ubiformat_args *args);