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/include/libubi.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'ubi-utils/include/libubi.h') diff --git a/ubi-utils/include/libubi.h b/ubi-utils/include/libubi.h index 47f40e2..4d6a7ee 100644 --- a/ubi-utils/include/libubi.h +++ b/ubi-utils/include/libubi.h @@ -399,6 +399,22 @@ int ubi_get_vol_info1(libubi_t desc, int dev_num, int vol_id, int ubi_get_vol_info1_nm(libubi_t desc, int dev_num, const char *name, struct ubi_vol_info *info); +/** + * ubi_vol_block_create - create a block device on top of an UBI volume. + * @fd: volume character device file descriptor + * + * Returns %0 in case of success and %-1 in case of failure. + */ +int ubi_vol_block_create(int fd); + +/** + * ubi_vol_block_remove - remove a block device from an UBI volume. + * @fd: volume character device file descriptor + * + * Returns %0 in case of success and %-1 in case of failure. + */ +int ubi_vol_block_remove(int fd); + /** * ubi_update_start - start UBI volume update. * @desc: UBI library descriptor -- cgit v1.2.3