mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Teresa Remmet <t.remmet@phytec.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 3/4] commands: ubi: Add ubiupdatevol command
Date: Thu, 23 Jun 2016 08:43:32 +0200	[thread overview]
Message-ID: <20160623064332.GI4750@pengutronix.de> (raw)
In-Reply-To: <1466586161-14532-3-git-send-email-t.remmet@phytec.de>

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@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?

Sascha

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2016-06-23  6:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22  9:02 [PATCH 1/4] commands: ubimkvol: Add option for static volumes Teresa Remmet
2016-06-22  9:02 ` [PATCH 2/4] mtd: UBI: Add support for updating " Teresa Remmet
2016-06-23  6:36   ` Sascha Hauer
2016-06-23 12:11     ` Teresa Remmet
2016-06-22  9:02 ` [PATCH 3/4] commands: ubi: Add ubiupdatevol command Teresa Remmet
2016-06-23  6:43   ` Sascha Hauer [this message]
2016-06-23 14:00     ` Teresa Remmet
2016-06-22  9:02 ` [PATCH 4/4] ARM: am335x_defconfig: Enable ubi fastmap and ubifs Teresa Remmet

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=20160623064332.GI4750@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=t.remmet@phytec.de \
    /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