From 91e08222389da159944d918bbe6eee7510da8872 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 10 Jan 2018 14:20:57 +0100 Subject: ubiformat: Add ubiformat write function The ubiformat C API expects an image file as argument. With upcoming Android fastboot sparse image support we can no longer provide a complete image anymore. With this patch we can write an image in multiple chunks after we've formatted a MTD device with ubiformat. ubiformat_write will skip the EC header in both the MTD device we write to and also the image we read from, so we can flash an image on a MTD device containing EC headers already. Signed-off-by: Sascha Hauer --- include/ubiformat.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/ubiformat.h') diff --git a/include/ubiformat.h b/include/ubiformat.h index b195fd8392..8305a853c7 100644 --- a/include/ubiformat.h +++ b/include/ubiformat.h @@ -20,4 +20,7 @@ struct ubiformat_args { int ubiformat(struct mtd_info *mtd, struct ubiformat_args *args); +int ubiformat_write(struct mtd_info *mtd, const void *buf, size_t count, + loff_t offset); + #endif /* __UBIFORMAT_H */ -- cgit v1.2.3