From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: Re: [PATCH 06/10] fdtdump: add a --scan option
Date: Mon, 15 Apr 2013 15:02:17 +1000 [thread overview]
Message-ID: <20130415050217.GJ16400@truffula.fritz.box> (raw)
In-Reply-To: <201304111844.21667.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 2777 bytes --]
On Thu, Apr 11, 2013 at 06:44:20PM -0400, Mike Frysinger wrote:
> On Thursday 11 April 2013 00:11:30 David Gibson wrote:
> > On Wed, Apr 10, 2013 at 02:29:11PM -0400, Mike Frysinger wrote:
> > > Often times, fdts get embedded in other larger files. Rather than force
> > > people to `dd` the blob out themselves, make the fdtdump file smarter.
> > >
> > > It can now scan the blob looking for the fdt magic. Once locate, it does
> > > a little validation on the main struct to make sure we didn't hit random
> > > binary data.
> >
> > Hrm. I have mixed feelings about this. The scanning functionality is
> > certainly useful. But on the other hand, fdtdump is not supposed to
> > be a general use tool. It's basically a debugging aid: a quick and
> > dirty independent implementation of a dtb dump, for checking that dtc
> > is producing sane output. The preferred way to dump dtbs "for real"
> > is to use dtc -I dtb -O dts
> >
> > I think the way I'd prefer to see this functionality would be to add a
> > new input format to dtc which is a little wrapper around the dtb input
> > format which does the scan.
>
> that seems reasonable, but really my use case was: scan a big blob, find the
> dtb embedded in there, then both decode and dump the offsets. this was so i
> could easily hack said big blob with a hexeditor and tweak a few
> keys.
Yeah, so when I got to your debug patch, I already started changing my
mind here.
> adding a new input format would satisfy the first part (locating the dtb), and
> the fact that dtc already supports "-O dtb" is good as it'd allow me to run it
> through fdtdump after the fact. i can probably even chain them in a pipeline.
>
> i'd still want the --debug option in fdtdump, but it sounds like that wouldn't
> be against your desired goal for this utility ?
>
> if that sounds good to you, i can rework things so that dtc gets a new "scan"
> input format (guessing i don't need to name it "scan-dtb"). then we both
> should be happy.
Actually, you've convinced me. So for now, just go back to your
original approach and address the other more specific comments and
that should be fine. When I made that suggestion I hadn't realised
what you were using this for. Now that I have, I think it fits into
fdtdump as intended.
> on a related note, is there a reason these tools malloc & read in the whole
> file into memory instead of just doing mmap() when possible ?
Some combination of simplicity and portability. I've never really
thought about it much..
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 192 bytes --]
_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
next prev parent reply other threads:[~2013-04-15 5:02 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-10 18:29 [PATCH 00/10 v2] usage()/--help clean up & unification Mike Frysinger
[not found] ` <1365618555-5893-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-10 18:29 ` [PATCH 01/10] utilfdt_read_err: use xmalloc funcs Mike Frysinger
2013-04-10 18:29 ` [PATCH 02/10] utilfdt_read: pass back up the length of data read Mike Frysinger
[not found] ` <1365618555-5893-3-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-15 4:58 ` David Gibson
[not found] ` <20130415045838.GI16400-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
2013-04-15 23:22 ` Mike Frysinger
2013-04-10 18:29 ` [PATCH 03/10] die: constify format string arg Mike Frysinger
2013-04-10 18:29 ` [PATCH 04/10] util_version: new helper for displaying version info Mike Frysinger
2013-04-10 18:29 ` [PATCH 05/10] fdtdump: make usage a bit more friendly Mike Frysinger
[not found] ` <1365618555-5893-6-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-11 4:00 ` David Gibson
[not found] ` <20130411040014.GA8165-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
2013-04-11 16:31 ` Mike Frysinger
2013-04-10 18:29 ` [PATCH 06/10] fdtdump: add a --scan option Mike Frysinger
[not found] ` <1365618555-5893-7-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-11 4:11 ` David Gibson
[not found] ` <20130411041130.GB8165-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
2013-04-11 22:44 ` Mike Frysinger
[not found] ` <201304111844.21667.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-15 5:02 ` David Gibson [this message]
2013-04-10 18:29 ` [PATCH 07/10] dtc/fdt{get, put}/convert-dtsv0-lexer: convert to new usage helpers Mike Frysinger
2013-04-10 18:29 ` [PATCH 08/10] util: drop "long" from " Mike Frysinger
2013-04-10 18:29 ` [PATCH 09/10] util: add common ARRAY_SIZE define Mike Frysinger
[not found] ` <1365618555-5893-10-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-11 4:12 ` David Gibson
2013-04-10 18:29 ` [PATCH 10/10] fdtdump: add a debug mode Mike Frysinger
[not found] ` <1365618555-5893-11-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-15 5:12 ` David Gibson
[not found] ` <20130415051206.GK16400-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
2013-04-15 23:35 ` Mike Frysinger
[not found] ` <201304151935.56128.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-15 23:53 ` David Gibson
-- strict thread matches above, loose matches on Subject: below --
2013-04-16 2:13 [PATCH 00/10 v3] usage()/--help clean up & unification, and extend fdtdump Mike Frysinger
[not found] ` <1366078397-14889-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-16 2:13 ` [PATCH 06/10] fdtdump: add a --scan option Mike Frysinger
[not found] ` <1366078397-14889-7-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-30 8:12 ` David Gibson
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=20130415050217.GJ16400@truffula.fritz.box \
--to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.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).