From: Artem Bityutskiy <dedekind1@gmail.com>
To: hujianyang <hujianyang@huawei.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH 6/7] New utility ubidump
Date: Wed, 16 Jul 2014 14:37:24 +0300 [thread overview]
Message-ID: <1405510644.5423.8.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <53C6618F.3010707@huawei.com>
On Wed, 2014-07-16 at 19:27 +0800, hujianyang wrote:
> >
> > Things like UBI volume table, UBI fast-map stuff are not "headers", so I
> > am not sure if using word "headers" a good idea. Probably we want
> > options like --ubifs and --ubi to denote ubi and ubifs-level stuff. The
> > default would be "everything".
> >
> > But again, if you start smaller, and upstream a good tool for
> > UBIFS-level stuff, it will be easier to add UBI stuff separately.
> >
> > Besides, I have some additional vision, which you do not have to
> > implement, but which should be taken into account. E.g., ubidump which
> > does not need UBI/UBIFS drivers, ubidump which can deal with an image
> > generated with nanddump without "mounting" it, etc. So I was thinking
> > doing small steps at a time would make it easier for me and for you to
> > make a tool which has limited functionality today, but which can be
> > later extended to support more functionality.
> >
>
> It seems you what more than me. I think you are right. I need to
> reconsider how to realize these above, not hole of them, but a
> good architecture that can be extended easily.
>
> So I think getting data from mtd driver is a good choice and then
> run it with an image file. Current UBI functionality has lots of
> limit and it is basing on UBI driver. But we need to do more work
> in user space (rebuilding volume table and so on) in this way. I
> think it's worth.
>
> Give me some time to re-create this utility. I will send it to you
> if I finished it. If you get some new ideas, please tell me as soon
> as possible.
I am not trying to make you do a lot more than you need.
If you are analyzing an MTD image without "mounting" it, the only way to
find out the LEB->PEB mapping is to do full scan, and basically copy the
UBI driver code. This is a lot of work.
In your case you have the driver, and it is fine to add an ioctl which
provides LEB->PEB mapping. This is a lot simpler.
So I envision that the tool would work like this.
$ ubidump my.img --lnum 5
- dump LEB 5, will need to scan the entire image.
$ ubidump /dev/ubiX_Y --lnum 5
- will just ask the UBI driver to give the PEB number for LEB 5, then
find out the MTD device for this volume (should be possible by checking
the sysfs files), and then reads the MTD device, and gets the UBI-level
information from there.
Something like this, just quick thoughts.
--
Best Regards,
Artem Bityutskiy
next prev parent reply other threads:[~2014-07-16 11:38 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-07 7:15 [PATCH RFC] ubi-utils: Add a new utility ubidump hujianyang
2014-07-07 7:17 ` [PATCH 1/7] UBI: Add a new ioctl to support ubidump hujianyang
2014-07-16 7:59 ` Artem Bityutskiy
2014-07-16 8:47 ` hujianyang
2014-07-16 10:30 ` Artem Bityutskiy
2014-07-07 7:19 ` [PATCH 2/7] Add new ioctl in userspace hujianyang
2014-07-07 7:20 ` [PATCH 3/7] Add ubifs-media.h hujianyang
2014-07-07 7:22 ` [PATCH 4/7] Add libubifs.h hujianyang
2014-07-07 7:24 ` [PATCH 5/7] Add libubifs.c hujianyang
2014-07-07 7:26 ` [PATCH 6/7] New utility ubidump hujianyang
2014-07-16 8:05 ` Artem Bityutskiy
2014-07-16 8:53 ` hujianyang
2014-07-16 10:37 ` Artem Bityutskiy
2014-07-16 11:27 ` hujianyang
2014-07-16 11:37 ` Artem Bityutskiy [this message]
2014-07-16 11:43 ` Artem Bityutskiy
2014-07-16 11:57 ` hujianyang
2014-07-21 16:20 ` Bill Pringlemeir
2014-07-22 8:15 ` hujianyang
2014-07-22 15:42 ` Bill Pringlemeir
2014-07-29 9:14 ` Artem Bityutskiy
2014-07-29 10:01 ` hujianyang
2014-07-07 7:27 ` [PATCH 7/7] Compile support hujianyang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1405510644.5423.8.camel@sauron.fi.intel.com \
--to=dedekind1@gmail.com \
--cc=hujianyang@huawei.com \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).