[PATCH]: add ubiupdatevol applet (version 2)

Baruch Siach baruch at tkos.co.il
Tue Apr 26 01:57:34 UTC 2011


Hi Denys,

On Tue, Apr 26, 2011 at 03:39:19AM +0200, Denys Vlasenko wrote:
> On Monday 04 April 2011 00:58, Reuben Dowle wrote:
> > This patch adds the ubiupdatevol applet (from mtd-utils) to busybox. Incorporates changes as suggested by Baruch Siach.
> > 
> > This version of ubiupdatevol makes some assumptions about the naming of ubi device nodes, to avoid the complexity of scanning and probing devices nodes as libubi does in the full version of ubiupdatevol.
> > 
> > Signed-off-by: Reuben Dowle <reuben.dowle at navico.com>
> 
> 
> 
> >  		xioctl(fd, UBI_IOCRSVOL, &req);
> > +	} else
> > +	if (do_update) {
> > +		struct stat st;
> > +		int ubinum, volnum;
> > +		char buf[40];
> > +		int sysfs_fd;
> > +		int input_fd;
> > +		int leb_size;
> > +		ssize_t len;
> > +		long long bytes;
> > +		char *input_data;
> > +
> > +		if (opts & OPTION_t)
> > +		{
> > +			// truncate the volume by starting an update for size 0
> > +			bytes = 0;
> > +			xioctl(fd, UBI_IOCVOLUP, &bytes);
> > +		}
> > +		else
> > +		{
> > +			// Make assumption that device not is in normal format. Removes need for scanning sysfs tree as full libubi does
> > +			if (sscanf(ubi_ctrl, "/dev/ubi%d_%d", &ubinum, &volnum) != 2)
> > +				bb_error_msg_and_die("%s volume node not in correct format", "UBI");
> > +
> > +			snprintf(buf, sizeof(buf), "/sys/class/ubi/ubi%d_%d/usable_eb_size", ubinum, volnum);
> > +			sysfs_fd = xopen(buf, O_RDONLY);
> > +			bb_error_msg_and_die("%s sysfs not accessible", "UBI");
> 
> This bb_error_msg_and_die call seems to be out of place.

Reuben has sent version 3 of this patch, which fixes this problem. See 
http://lists.busybox.net/pipermail/busybox/2011-April/075386.html.

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -


More information about the busybox mailing list