summaryrefslogtreecommitdiff
path: root/ubi-utils/new-utils/src/common.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-02-20 18:00:42 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-02-20 19:21:31 +0200
commit56868f374f5ba88e766690236a41af36a1e51949 (patch)
tree666d134a8e43effbb5cf7418cd6f14d502efacc4 /ubi-utils/new-utils/src/common.c
parent6ef3fc52bcffd73520da5ecc3cb94d5cc16bdfc0 (diff)
ubi-tools: sanify old and new tools a bit
This commit adds compatible options to new ubimkvol, ubirmvol, and ubiupdatevol and deletes corresponding old utilities. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils/new-utils/src/common.c')
-rw-r--r--ubi-utils/new-utils/src/common.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/ubi-utils/new-utils/src/common.c b/ubi-utils/new-utils/src/common.c
index fec640d..50859dc 100644
--- a/ubi-utils/new-utils/src/common.c
+++ b/ubi-utils/new-utils/src/common.c
@@ -52,6 +52,24 @@ static int get_multiplier(const char *str)
if (!strcmp(str, "GiB"))
return 1024 * 1024 * 1024;
+ /* Handle deprecated stuff */
+ if (!strcmp(str, "KB") || !strcmp(str, "Kib") || !strcmp(str, "kib") ||
+ !strcmp(str, "kiB")) {
+ fprintf(stderr, "Warning: use \"KiB\" instead of \"%s\" to "
+ "specify Kilobytes - support will be removed\n", str);
+ return 1024;
+ }
+ if (!strcmp(str, "MB") || !strcmp(str, "Mib") || !strcmp(str, "mb")) {
+ fprintf(stderr, "Warning: use \"MiB\" instead of \"%s\", "
+ "this support will be removed\n", str);
+ return 1024*1024;
+ }
+ if (!strcmp(str, "GB") || !strcmp(str, "Gib") || !strcmp(str, "gb")) {
+ fprintf(stderr, "Warning: use \"GiB\" instead of \"%s\", "
+ "this support will be removed\n", str);
+ return 1024*1024*1024;
+ }
+
return -1;
}