* [U-Boot] Extract data file from U-Boot image
@ 2013-07-25 15:31 Guilherme Maciel Ferreira
2013-07-25 18:57 ` Albert ARIBAUD
2013-07-25 19:01 ` Wolfgang Denk
0 siblings, 2 replies; 7+ messages in thread
From: Guilherme Maciel Ferreira @ 2013-07-25 15:31 UTC (permalink / raw)
To: u-boot
Hi list,
I guess I'm not the first one who ever needed to retrieve data files
from multifile images, those create by mkimage tool. However, I could
just find scripts to do that (specially an old thread answered by
Wolfgang about dd).
I made a patch to allow mkimage to extract files from images, which
just works for multi-file image. But, the fact that nobody has ever
done this means that this feature is not desired in the tool?
IMHO, it is very convenient to have a C code to do that, specially for
embedded systems where scripting is noticeably slower than binary
code. Besides it requires 'dd' to extract and another tool to parse
file's offsets inside the image.
Comments?
--
Guilherme Maciel Ferreira
Mobile Brazil: +55 48 9904 3728 e +55 48 9134 4651
Site: http://guilhermemacielferreira.com/
Skype: guilherme.maciel.ferreira
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Extract data file from U-Boot image
2013-07-25 15:31 [U-Boot] Extract data file from U-Boot image Guilherme Maciel Ferreira
@ 2013-07-25 18:57 ` Albert ARIBAUD
2013-07-25 19:01 ` Wolfgang Denk
1 sibling, 0 replies; 7+ messages in thread
From: Albert ARIBAUD @ 2013-07-25 18:57 UTC (permalink / raw)
To: u-boot
Hi Guilherme,
On Thu, 25 Jul 2013 12:31:46 -0300, Guilherme Maciel Ferreira
<guilherme.maciel.ferreira@gmail.com> wrote:
> Hi list,
>
> I guess I'm not the first one who ever needed to retrieve data files
> from multifile images, those create by mkimage tool. However, I could
> just find scripts to do that (specially an old thread answered by
> Wolfgang about dd).
>
> I made a patch to allow mkimage to extract files from images, which
> just works for multi-file image. But, the fact that nobody has ever
> done this means that this feature is not desired in the tool?
>
> IMHO, it is very convenient to have a C code to do that, specially for
> embedded systems where scripting is noticeably slower than binary
> code. Besides it requires 'dd' to extract and another tool to parse
> file's offsets inside the image.
>
> Comments?
My comment would be that, while U-Boot images /run/ on embedded
systems, people do not necessarily /work on/ these images /from within/
said systems; indeed, work on such images, and more generally,
development around U-Boot, is performed on development systems, not
on target systems.
Besides, in many cases, the image was actually built from files
available -- even from files themselves built just before putting them
together within the image.
Apart from very specific cases (tweaking the initrd in an existing
image comes to mind), I don't see the point in taking images apart when
you can simply build them the way you want.
Amicalement,
--
Albert.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Extract data file from U-Boot image
2013-07-25 15:31 [U-Boot] Extract data file from U-Boot image Guilherme Maciel Ferreira
2013-07-25 18:57 ` Albert ARIBAUD
@ 2013-07-25 19:01 ` Wolfgang Denk
[not found] ` <CAHCtDORkcGdgTnTPyJfrxwdpmA=mrFDAJ5rHEzz94gy=wuq1fQ@mail.gmail.com>
2013-07-25 21:12 ` Guilherme Maciel Ferreira
1 sibling, 2 replies; 7+ messages in thread
From: Wolfgang Denk @ 2013-07-25 19:01 UTC (permalink / raw)
To: u-boot
Dear Guilherme Maciel Ferreira,
In message <CAF=5bWftE3UwPrOH+q+JPm-ag0igmAr_G4s=kLzhSObNhN=YyA@mail.gmail.com> you wrote:
>
> I made a patch to allow mkimage to extract files from images, which
> just works for multi-file image. But, the fact that nobody has ever
> done this means that this feature is not desired in the tool?
Speaking just for myself: I needed such features only in very rare
occasions, where it was way faster to use a one-liner on the command
line than to write any actual code.
YMMV...
But I fear that mkimage explodes from creaping featurism, so if you
go and implement something like this, please do not add it to kmimage,
but rather create a separate, new tool, say "dumpimage" or so.
> IMHO, it is very convenient to have a C code to do that, specially for
> embedded systems where scripting is noticeably slower than binary
> code. Besides it requires 'dd' to extract and another tool to parse
> file's offsets inside the image.
Well, when I was doing such things, I never did this on the embedded
targets, nor did I ever have to care about performance because I
always needed it just once or twice.
Could you please be so kind and feed my curiousity a bit: what exactly
are you doing that you need such a feature on the target? I can't
think of useful applications at the moment...
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
: ... and it's got weird formatting - Notepad, Write, Works 3 can't
: decipher it, and it's too big to go in DOS Edit. Help!
Install an operating system. :-) -- Tom Christiansen
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Extract data file from U-Boot image
[not found] ` <CAHCtDORkcGdgTnTPyJfrxwdpmA=mrFDAJ5rHEzz94gy=wuq1fQ@mail.gmail.com>
@ 2013-07-25 19:43 ` Wolfgang Denk
0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2013-07-25 19:43 UTC (permalink / raw)
To: u-boot
Dear Heer Lorcan,
In message <CAHCtDORkcGdgTnTPyJfrxwdpmA=mrFDAJ5rHEzz94gy=wuq1fQ@mail.gmail.com> you wrote:
>
> want to extract files from my u-boot.bin.
> could you send me the script to do this?
u-boot.bin is a raw binary which does not contain any sort of "files".
You cannot extract what's not there in the first place. And you
cannot find tools to perform tasks that are impossible.
> why, when building a compiler, interpreter, debugger,
> do the builders always forget to include a file/script to decompile a given
> file made by tools from the same group...
> it's just plain stupid...
Well, that's a prtty strong statement given that 1) you ignore the
netiquette (you top-post / full-quote) and dropped the ML from Cc:,
and 2) you appear to have only very limited understanding of what
u-boot.bin actually is.
There is sufficient tools for all kinds of file manipulation
available, but only for possible manipulations. It's like mixing
chemicals - for example, once you mixed UDMH and nitrogen tetroxide,
it will be very difficult to find tools to separate (i. e.
"decompile") these again (for several reasons :-)
Some operations are simply irreversible.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The first rule of magic is simple. Don't waste your time waving your
hands and hoping when a rock or a club will do."
- McCloctnik the Lucid
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Extract data file from U-Boot image
2013-07-25 19:01 ` Wolfgang Denk
[not found] ` <CAHCtDORkcGdgTnTPyJfrxwdpmA=mrFDAJ5rHEzz94gy=wuq1fQ@mail.gmail.com>
@ 2013-07-25 21:12 ` Guilherme Maciel Ferreira
2013-07-26 5:24 ` Wolfgang Denk
1 sibling, 1 reply; 7+ messages in thread
From: Guilherme Maciel Ferreira @ 2013-07-25 21:12 UTC (permalink / raw)
To: u-boot
Dear Wolfgang,
2013/7/25 Wolfgang Denk <wd@denx.de>:
> Dear Guilherme Maciel Ferreira,
>
> In message <CAF=5bWftE3UwPrOH+q+JPm-ag0igmAr_G4s=kLzhSObNhN=YyA@mail.gmail.com> you wrote:
>>
>> I made a patch to allow mkimage to extract files from images, which
>> just works for multi-file image. But, the fact that nobody has ever
>> done this means that this feature is not desired in the tool?
>
> Speaking just for myself: I needed such features only in very rare
> occasions, where it was way faster to use a one-liner on the command
> line than to write any actual code.
>
> YMMV...
>
> But I fear that mkimage explodes from creaping featurism, so if you
> go and implement something like this, please do not add it to kmimage,
> but rather create a separate, new tool, say "dumpimage" or so.
How does 'unimage' sound to you? =) Following the example of
unsquashfs and unubi?
I mean, if people really consider this tool of some use.
>
>> IMHO, it is very convenient to have a C code to do that, specially for
>> embedded systems where scripting is noticeably slower than binary
>> code. Besides it requires 'dd' to extract and another tool to parse
>> file's offsets inside the image.
>
> Well, when I was doing such things, I never did this on the embedded
> targets, nor did I ever have to care about performance because I
> always needed it just once or twice.
>
> Could you please be so kind and feed my curiousity a bit: what exactly
> are you doing that you need such a feature on the target? I can't
> think of useful applications at the moment...
Well, I'm not allowed to say much, but broadly speaking it's intended
for a less intrusive firmware upgrade.
Today, in order to upgrade the firmware, the device receives a
Multifile image composed by a new kernel and a new root file system
and overwrite both of them. Which requires the device to hang for a
moment.
However, now we want a selective upgrade, where we can pick a few
directories from within the new root file system without the need to
write the whole new file system and kernel.
Best regards,
--
Guilherme Maciel Ferreira
Mobile Brazil: +55 48 9904 3728 e +55 48 9134 4651
Site: http://guilhermemacielferreira.com/
Skype: guilherme.maciel.ferreira
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Extract data file from U-Boot image
2013-07-25 21:12 ` Guilherme Maciel Ferreira
@ 2013-07-26 5:24 ` Wolfgang Denk
2013-07-26 19:30 ` Guilherme Maciel Ferreira
0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2013-07-26 5:24 UTC (permalink / raw)
To: u-boot
Dear Guilherme Maciel Ferreira,
In message <CAF=5bWcMhBhvvWP1933Xyi9Cpv_t3Y306ceWr6pH+TqwoYpi=g@mail.gmail.com> you wrote:
>
> > But I fear that mkimage explodes from creaping featurism, so if you
> > go and implement something like this, please do not add it to kmimage,
> > but rather create a separate, new tool, say "dumpimage" or so.
>
> How does 'unimage' sound to you? =) Following the example of
> unsquashfs and unubi?
I dislike such names; they appear not natural to me. "Make an image"
=> mkimage or "dump the image content" => dumpimage kind of describe
what the command does in a natural language. But "unimage" is a word
that I cannot put anywhere.
> I mean, if people really consider this tool of some use.
The simple rule is: if something is useful for someone, and does not
hurt others, it can get added. Just make sure it's a separate make
target so it does not get built automatically for each and every
build, but only when you ask for it.
> However, now we want a selective upgrade, where we can pick a few
> directories from within the new root file system without the need to
> write the whole new file system and kernel.
Hm... Repacking images on the target appears not really an efficient
approach to me. Also I wonder how this works - are you talking about
ramdisk based root file system images?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If today is the first day of the rest of your life, what the hell was
yesterday?
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Extract data file from U-Boot image
2013-07-26 5:24 ` Wolfgang Denk
@ 2013-07-26 19:30 ` Guilherme Maciel Ferreira
0 siblings, 0 replies; 7+ messages in thread
From: Guilherme Maciel Ferreira @ 2013-07-26 19:30 UTC (permalink / raw)
To: u-boot
Dear Wolfgang,
2013/7/26 Wolfgang Denk <wd@denx.de>:
> Dear Guilherme Maciel Ferreira,
>
> In message <CAF=5bWcMhBhvvWP1933Xyi9Cpv_t3Y306ceWr6pH+TqwoYpi=g@mail.gmail.com> you wrote:
>>
>> > But I fear that mkimage explodes from creaping featurism, so if you
>> > go and implement something like this, please do not add it to kmimage,
>> > but rather create a separate, new tool, say "dumpimage" or so.
>>
>> How does 'unimage' sound to you? =) Following the example of
>> unsquashfs and unubi?
>
> I dislike such names; they appear not natural to me. "Make an image"
> => mkimage or "dump the image content" => dumpimage kind of describe
> what the command does in a natural language. But "unimage" is a word
> that I cannot put anywhere.
dumpimage... That's fine for me.
>
>> I mean, if people really consider this tool of some use.
>
> The simple rule is: if something is useful for someone, and does not
> hurt others, it can get added. Just make sure it's a separate make
> target so it does not get built automatically for each and every
> build, but only when you ask for it.
Ok. Just give me some time to rework the patch.
>
>> However, now we want a selective upgrade, where we can pick a few
>> directories from within the new root file system without the need to
>> write the whole new file system and kernel.
>
> Hm... Repacking images on the target appears not really an efficient
> approach to me. Also I wonder how this works - are you talking about
> ramdisk based root file system images?
>
Exactly, a ramdisk root file system image, which is received -- by the
device -- inside a Multifile image.
Best regards,
--
Guilherme Maciel Ferreira
Mobile Brazil: +55 48 9904 3728 e +55 48 9134 4651
Site: http://guilhermemacielferreira.com/
Skype: guilherme.maciel.ferreira
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-07-26 19:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-25 15:31 [U-Boot] Extract data file from U-Boot image Guilherme Maciel Ferreira
2013-07-25 18:57 ` Albert ARIBAUD
2013-07-25 19:01 ` Wolfgang Denk
[not found] ` <CAHCtDORkcGdgTnTPyJfrxwdpmA=mrFDAJ5rHEzz94gy=wuq1fQ@mail.gmail.com>
2013-07-25 19:43 ` Wolfgang Denk
2013-07-25 21:12 ` Guilherme Maciel Ferreira
2013-07-26 5:24 ` Wolfgang Denk
2013-07-26 19:30 ` Guilherme Maciel Ferreira
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox