Adding -N volume name to ubi utils

Artem Bityutskiy dedekind at infradead.org
Tue Dec 2 03:56:02 EST 2008


Hi,

On Mon, 2008-11-24 at 17:07 +0000, Richard Titmuss wrote:
> I am trying to modify the ubi tools in mtd_utils to allow the ubi volume 
> name to be specified on the command line, the relevant commands are 
> ubinfo, ubirmvol and ubiupdatevol. The idea is that you could use any of 
> the following command arguments to specify a ubi volume:
> 
>    ubirmvol /dev/ubi0 -N rootfs    # ubi device node and volume name
>    ubirmvol /dev/ubi0 -n 1    # ubi device node and volume id

Looks OK.

>    ubirmvol /dev/ubi0_1    # ubi volume node

Probably also fine.

> Other than consistency the main feature this adds is support for using 
> -N to specify the volume by name to all the commands.

Right.

> The problem is these commands need different information to work:
> - ubinfo loads information from the /sys file system, it's easy to 
> support for all the above command arguments.

Yes.

> - ubirmvol needs a ubi device node and a volume id, how can this work if 
> a volume node is specified?

sysfs contains all the information. Character device gives you
major:minor. UBI _devices_ always have minor=0. So you can distinguish
between UBI volume/device chdev nodes. And you may look into all

/sys/class/ubi/ubiX/ubiX_Y/dev

and find the volume. Then you have all the information.

> - ubiupdatevol needs a ubi volume node, how can this work if a device 
> node is specified?

Similarly. Add corresponding scanning functions to libubi
(mtd-utils/ubi-utils/new-utils/src/libubi.c).

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)




More information about the linux-mtd mailing list