[PATCH 3/4] commands: ubi: Add ubiupdatevol command

Teresa Remmet t.remmet at phytec.de
Thu Jun 23 07:00:47 PDT 2016


Hello Sascha,

Am Donnerstag, den 23.06.2016, 08:43 +0200 schrieb Sascha Hauer:
> On Wed, Jun 22, 2016 at 11:02:40AM +0200, Teresa Remmet wrote:
> > Add ubiupdatevol command. This is to update static
> > and dynamic volumes.
> > 
> > Signed-off-by: Teresa Remmet <t.remmet at phytec.de>
> > ---
> >  commands/ubi.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 52 insertions(+)
> > 
> > diff --git a/commands/ubi.c b/commands/ubi.c
> > index f4ff5e7..e727776 100644
> > --- a/commands/ubi.c
> > +++ b/commands/ubi.c
> > @@ -5,12 +5,64 @@
> >  #include <ioctl.h>
> >  #include <errno.h>
> >  #include <getopt.h>
> > +#include <libfile.h>
> >  #include <linux/mtd/mtd.h>
> >  #include <linux/kernel.h>
> > +#include <linux/stat.h>
> >  #include <linux/mtd/mtd-abi.h>
> >  #include <mtd/ubi-user.h>
> >  #include <mtd/ubi-media.h>
> >  
> > +static int do_ubiupdatevol(int argc, char *argv[])
> > +{
> > +	int fd_vol, ret;
> > +	uint64_t size = 0;
> > +	void *buf;
> > +
> > +	if (argc - optind < 2)
> > +		return COMMAND_ERROR_USAGE;
> > +
> > +	buf = read_file(argv[optind+1], (size_t *) &size);
> > +	if (!buf) {
> > +		perror("read");
> > +		return 1;
> > +	}
> 
> This limits us to files that fit into memory. Is it worth it to
> read/write in a loop?

I'll change it to a loop.

Teresa

> 
> Sascha
> 





More information about the barebox mailing list