[PATCH v2] ubi-utils: Add ubiblock tool

Ezequiel Garcia ezequiel.garcia at free-electrons.com
Sat Apr 5 13:33:48 PDT 2014


Hello Artem, Richard:

On Mar 14, Ezequiel Garcia wrote:
> 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
> 

After using this for something else than silly tests, I've found this
usage is actually a bit braindead :-)

The user will probably want to create a block device based on the volume's
name or ID, and not just the node path. In particular, using the name is
probably the most useful case, given the atomic ubi volume rename feature.

Therefore, I'd like to see this fixed, but I'm not entirely sure what's the
best approach. Here are my ideas so far to identify a volume:

  * Follow the convention of ubirmvol:

    ubiblock --create /dev/ubi0_0 (like we have now)
    ubiblock --create <UBI device node file name>
	     [-n <volume id>] [--vol_id=<volume id>]
             [-N <volume name>] [--name=<volume name>]

  * Implement something matching the mount command usage. For example,

    ubiblock --create /dev/ubi0_0 (like we have now)
    ubiblock --create ubi0:name
    ubiblock --create ubi0_0

  * All of them?

To be honest, I don't have any preference.
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com



More information about the linux-mtd mailing list