From 6a9db93c239ff61412ba6629919b4411d836ae23 Mon Sep 17 00:00:00 2001 From: Ezequiel Garcia Date: Fri, 14 Mar 2014 11:25:24 -0300 Subject: 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 Signed-off-by: Artem Bityutskiy --- ubi-utils/libubi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ubi-utils/libubi.c') 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; -- cgit v1.2.3