[flashrom] DMI matching patch
flashrom at mkarcher.dialup.fu-berlin.de
Fri Jan 1 01:55:27 CET 2010
Am Freitag, den 01.01.2010, 01:18 +0100 schrieb Carl-Daniel Hailfinger:
> If AWDFLASH etc. have no common scheme, I think we can come up with our
> own. Suggestion:
> - Ability to specify arbitrary combinations of all six strings without
> introducing a boatload of new fields.
> - (related to the point above) Storage format for string combinations,
> delimited with "," and starting with a field specifying the string
> selection (one char per selected string), delimiter, first string [,
> delimiter, second string [, delimiter, third string]]. The end result is
> still a human-readable string and can thus be stored in a simple C string.
You mean something like "mv,HP,VL400" for "system manufacturer HP,
system version VL400". Yes, this is possible, but will break if the
separator is included in the fields you want to match. But most
important: Don't overdesign this stuff. This is only used to tell boards
apart that already passed the PCI ID check.
> - Strip all leading and trailing whitespace from the strings before
> matching. Something like ltrim(rtrim($variable)) in BASIC.
Sounds sensible, but why? Leading/trailing space in DMI seems quite
uncommon, and could be included in the expected pattern as well.
> - Always match full strings (no substring matching).
This will break on Luc's HP example, IIRC. If we already go the route of
implementing a parser for some (maybe trivial) matching language, one
could at a asterisk in the beginning/end for non-anchored matches. It's
still the question whether it really is worth the trouble.
More information about the flashrom