Bug 7466 - ubiupdatevol -t (truncate) parameter now incorrectly requires a value in BBx1.22.x
Summary: ubiupdatevol -t (truncate) parameter now incorrectly requires a value in BBx1...
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.22.x
Hardware: PC Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-25 10:25 UTC by Phil
Modified: 2014-09-25 20:11 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
potential patch to fix the issue? (665 bytes, application/octet-stream)
2014-09-25 13:35 UTC, Phil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Phil 2014-09-25 10:25:15 UTC
When Using BusyBox v1.22.1 ubiupdatevol truncate option now seems to require a size parameter.

~ # busybox ubiupdatevol /dev/ubi0_6 -t <THIS SHOULD WORK OK>
ubiupdatevol: option requires an argument -- 't'
BusyBox v1.22.1 (2014-09-25 02:24:52 BST) multi-call binary.

Usage: ubiupdatevol UBI_DEVICE [-t | [-s SIZE] IMG_FILE]

Update UBI volume

        -t      Truncate to zero size
        -s SIZE Size in bytes to resize to

~ #


This operation works OK in previous busybox (BusyBox v1.20.2)


For reference the full mtd-utils(1.5.1) ubiupdatevol specifically gives the -t option as an example without a size.

ubiupdatevol version 1.5.1 - a tool to write data to UBI volumes.

Usage: ubiupdatevol <UBI volume node file name> [-t] [-s <size>] [-h] [-V] [--truncate]
                        [--size=<size>] [--help] [--version] <image file>

Example 1: ubiupdatevol /dev/ubi0_1 fs.img - write file "fs.img" to UBI volume /dev/ubi0_1
Example 2: ubiupdatevol /dev/ubi0_1 -t - wipe out UBI volume /dev/ubi0_1

-t, --truncate             truncate volume (wipe it out)
-s, --size=<bytes>         bytes to read from input
    --skip=<bytes>         leading bytes to skip from input
-h, --help                 print help message
-V, --version              print program version
~ #


Thanks
Comment 1 Phil 2014-09-25 13:35:29 UTC
Created attachment 5684 [details]
potential patch to fix the issue?

I'm not so sure what I'm doing but the attached patch seems to fix the issue for me at least. 

Hopefully an experienced maintainer can take a look
Comment 2 Denys Vlasenko 2014-09-25 20:11:07 UTC
Fixed in git. Thanks!