<div dir="ltr">Build the tool in go. It's trivial. If you have an idea how it ought to work I can set it up in the playground in a few minutes.<div><br></div><div>ron</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 23, 2015 at 8:24 AM Patrick Georgi <<a href="mailto:pgeorgi@google.com">pgeorgi@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Some mainboards come with soldered-on memory without SPD ROM. For<br>
these, we carry the SPD data in coreboot.<br>
<br>
Currently, they're stored in a hexdump format that is then converted<br>
to binary at build time. The various mechanisms of doing so fail on<br>
some platform or another:<br>
 - "echo -e -n $stuff" isn't well-liked by some shells (emits "e -n $stuff")<br>
 - "printf '\x42'" isn't well-liked by some shells (or /usr/bin/printf<br>
tools) that don't support hexadecimal formats<br>
 - "printf '\0377'" isn't well-liked by some non-conforming, but existing shells<br>
 - xxd -rg1 $file > $file.bin requires xxd, which comes with vim and<br>
may just not exist<br>
<br>
I see essentially two ways out of this, before we can start reducing<br>
duplication across the tree in that area:<br>
We could build our own tool to parse hex files and dump binary, or we<br>
could ship SPD data as binary from the start (and only have to<br>
concatenate them).<br>
<br>
The second option has the appeal of being much simpler (and there<br>
isn't really a "preferred form" for editing SPD data that I'm aware of<br>
- is there?), but looks icky at a glance because it's binary (but it's<br>
really just as impenetrable as the equivalent hexdump).<br>
<br>
So what do these files contain? Parameters (as in: facts) about the<br>
hardware's size, layout, and timing, and a bunch of vendor/model<br>
identifier strings.<br>
<br>
<br>
So, is there a third option that I'm missing? Other opinions?<br>
Patrick<br>
--<br>
Google Germany GmbH, ABC-Str. 19, 20354 Hamburg<br>
Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft: Hamburg<br>
Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle<br>
<br>
--<br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org" target="_blank">coreboot@coreboot.org</a><br>
<a href="http://www.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">http://www.coreboot.org/mailman/listinfo/coreboot</a></blockquote></div>