summaryrefslogtreecommitdiff
path: root/cmd/ubi.c
diff options
context:
space:
mode:
authorLadislav Michl <ladis@linux-mips.org>2017-01-19 10:45:35 (GMT)
committerHeiko Schocher <hs@denx.de>2017-01-26 06:00:25 (GMT)
commitf59f07ece5ec78a8fc2f0e06a80ff66029002629 (patch)
tree442b0257406e775a62ff1e74b96e8429645672a3 /cmd/ubi.c
parent79a34b71c943a80af5c6d9a2af736fbb37dcc14c (diff)
downloadu-boot-fsl-qoriq-f59f07ece5ec78a8fc2f0e06a80ff66029002629.tar.xz
cmd: ubi: allow '-' to specify maximum volume size
Currently maximum volume size can be specified only if no other arguments are used. Use '-' placeholder as volume size to allow maximum volume size to be specified together with volume id and type. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Diffstat (limited to 'cmd/ubi.c')
-rw-r--r--cmd/ubi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd/ubi.c b/cmd/ubi.c
index 7d0d7e7..efc43ff 100644
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -600,7 +600,8 @@ static int do_ubi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
/* E.g., create volume size */
if (argc == 4) {
- size = simple_strtoull(argv[3], NULL, 16);
+ if (argv[3][0] != '-')
+ size = simple_strtoull(argv[3], NULL, 16);
argc--;
}
/* Use maximum available size */
@@ -691,8 +692,9 @@ U_BOOT_CMD(
" - Display volume and ubi layout information\n"
"ubi check volumename"
" - check if volumename exists\n"
- "ubi create[vol] volume [size] [type] [id]"
- " - create volume name with size\n"
+ "ubi create[vol] volume [size] [type] [id]\n"
+ " - create volume name with size ('-' for maximum"
+ " available size)\n"
"ubi write[vol] address volume size"
" - Write volume from address with size\n"
"ubi write.part address volume size [fullsize]\n"