summaryrefslogtreecommitdiff
path: root/ubi-utils/libubi.c
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>2014-03-14 11:25:24 -0300
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2014-03-25 09:54:48 +0200
commit6a9db93c239ff61412ba6629919b4411d836ae23 (patch)
tree5aa80cf857d2429f1687b6f275fee626005958b7 /ubi-utils/libubi.c
parentdcea43eba91642939c82739387147da26d572758 (diff)
ubi-utils: Add ubiblock tool
With the addition of block device access to UBI volumes, we now add a simple userspace tool to access the new ioctls. Usage of this tool is as simple as it gets: $ ubiblock --create /dev/ubi0_0 will create a new block device /dev/ubiblock0_0, and $ ubiblock --remove /dev/ubi0_0 will remove the device. Artem: slightly changed the header comment. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'ubi-utils/libubi.c')
-rw-r--r--ubi-utils/libubi.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ubi-utils/libubi.c b/ubi-utils/libubi.c
index a7463e8..598191e 100644
--- a/ubi-utils/libubi.c
+++ b/ubi-utils/libubi.c
@@ -1109,6 +1109,16 @@ int ubi_rsvol(libubi_t desc, const char *node, int vol_id, long long bytes)
return ret;
}
+int ubi_vol_block_create(int fd)
+{
+ return ioctl(fd, UBI_IOCVOLCRBLK);
+}
+
+int ubi_vol_block_remove(int fd)
+{
+ return ioctl(fd, UBI_IOCVOLRMBLK);
+}
+
int ubi_update_start(libubi_t desc, int fd, long long bytes)
{
desc = desc;