[flashrom] CrOS flashrom compatibility and upstreaming of CrOS features

Nico Huber nico.h at gmx.de
Wed Jan 24 19:36:29 CET 2018


Hey folks,

during review of commits that port per-region file arguments [1] from
CrOS flashrom over here, we ran into a discussion about the command line
interface changes. The basic question that arose is

    Do we want to maintain full CLI compatibility to CrOS flashrom?

This would have the upside, that it would ease remerging of the two
flashrom versions (in some unknown future). And anybody currently
using CrOS flashrom could transition more smoothly. OTOH, depending on
how the compatibility is achieved, it might increase the costs for
review and development heavily (for a project with 0 spare resources).

To not have to discuss this each and every time when some non-trivial
feature is ported over from CrOS, I'd like to have some opinions, how
valuable CLI compatibility is to you all and how we want to achieve it.
I have currently some alternative ideas in mind that I'll sketch below.
Feel free to add other ideas or just to comment them.

1) Integrate CLI changes from CrOS into flashrom proper's CLI.

   This turned out to be much harder than one might initially think:
   For the mentioned patches, it means that a lot of additional deve-
   lopment has to happen:
     * Restore internal behaviour in flashrom that became incompatible.
     * Add appropriate sanity checks for the arguments passed (yes,
       flashrom proper does such).
     * Discuss and review the additional code, too.
   It also restricts us to the design choices already made for CrOS
   flashrom and makes our review process kind of mindless.

   It does, however, get the job done, and everybody could just run
   `make` and wouldn't have to care if he's using one version of
   flashrom or the other.

2) Design our own interface for flashrom proper, but keep internal
   compatibility for an alternate CLI.

   It would allow us to make our own design choices at the interface
   level. A steady implementation might be much easier to accomplish
   if we keep things simple.

   Somebody would have to maintain an additional, CrOS compatible CLI.

   We could be more lax regarding to sanity checks in the alternate
   CLI, to speed up development.

   But, everybody already familiar with the CrOS flashrom CLI might
   get confused until he finds the alternative CLI.

3) Design our own implementation; provide compatibility with a wrapper
   script.

   The basic function of flashrom should be clear: read, write or
   verify the contents of a flash chip. Everything else (like com-
   bining multiple files in complex ways) shouldn't add unnecessary
   complexity to flashrom, and can likely be done in cleaner ways
   with other tools. In other words, we could try to keep flashrom
   more like a UNIX tool.

   IMHO, this would allow us to get new features in faster. If some-
   body sees a better way to implement a feature, we can just do it.

   Writing a wrapper script seems much easier too me than main-
   taining compatibility and safety in an unnecessary complex
   C program.

   Same as 2), people used to the other interface would have to learn
   a new one (or use the wrapper).

So please let me know what you think, folks ;)

Nico

[1] 23021, 23022 and related 23353 in https://review.coreboot.org/



More information about the flashrom mailing list