[coreboot] flashrom image identification problem/coreboot signature RFC
c-d.hailfinger.devel.2006 at gmx.net
Mon Jun 16 20:21:09 CEST 2008
On 16.06.2008 19:53, Stefan Reinauer wrote:
> Carl-Daniel Hailfinger wrote:
>>> Top 256 bytes will not always work. The current trouble is due to the
>>> fact that we have some mainboards that need the information in a
>>> different place than others.
>> Anything in the top 4k would be OK for me, unless there are specific
>> reasons this is impossible with some boards. I'd appreciate a pointer
>> about the "different place" thing.
> Why would you want to artificially limit this at all. A lar entry can be
> anywhere in the binary and it will still work. Now imagine how flexible
> that would be ;-)
And unpacking the lar will possible result in garbage if the header is
>>> Other than that, we might indeed put the coreboot version into the
>>> firmware signature, too, if there's a reason to do so. Is there?
>> Not sure about svn revision, but differentiating between v2 and v3 would
>> help. For one, we could keep a pseudo-LAR out of v2.
> What's the benefit of using "CB20" as a magic rather than "LARCHIVE"?
> Exactly: None.
> There are disadvantages to having to maintain two different ways of
> doing things though. Especially given that v2 is going to be obsoleted
> some time.
>>> I miss the actual information in your suggestion, namely the mainboard
>>> vendor and type.
>> Placing vendor and type somewhere else is possible, as long as flashrom
>> knows that it should look there.
> Sure. And this is what the whole discussion is about. Maybe you missed
> the point in the first place?
The point was to make sure flashrom does not segfault anymore on real
world images. Feel free to fix that in any way you want.
>>> Since we already have LAR, using that format instead of yet another
>>> signature rule makes a lot of sense in my opinion.
>> For v3, yes mostly.
>> For v2, someone would have to add a invalid LAR pseudoheader to the
>> final linked image.
> No invalid header needed. No pseudo header anyways. Just pack a plain
> normal valid header there.
And unpacking the plain normal valid header will result in what?
>> Definitely not something I'd like to try (my linker
>> script skills are not good enough nor do I consider this to be a
>> particularly compelling idea).
> Placing a few bytes at an arbitrary 16byte aligned address within the
> image is quite simple.
Great. As long as you fix the flashrom segfault (which needs a flashrom
code change and was the reason the thread got started) you can change
the v2 image any way you want.
You could even postpone the signature decision and improve the coreboot
detection heuristic in flashrom by checking the read values for sanity
(a negative image size is not sane).
P.S. Back to university work...
More information about the coreboot