Attention is currently required from: Evan Benn.
Peter Marheine has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/71973 )
Change subject: flashrom_tester: Rewrite IOOpts to support more operations ......................................................................
Patch Set 6:
(2 comments)
File util/flashrom_tester/flashrom/src/cmd.rs:
https://review.coreboot.org/c/flashrom/+/71973/comment/0163f94a_ba6792d3 PS4, Line 82: // an operation must provide a file or a region.file or both.
I think you are saying some things I get and some that I dont, I have had another attempt PTAL. […]
It's moving in a direction that makes more sense; comments on the changes.
File util/flashrom_tester/flashrom/src/cmd.rs:
https://review.coreboot.org/c/flashrom/+/71973/comment/fe78b8a6_5058d806 PS6, Line 73: Option This still seems weird, in that it's required to specify either a file or a region with some file. It seems like we want to express these cases:
* One file, entire chip * One file, part of chip * Multiple files, one per part of chip
..which can be translated to a type in a pretty straighforward way once we've enumerated the options that make sense:
``` enum FileIoMapping { /// Operate on the entire flash, mapped to an entire file. CompleteImage(Path), /// Operate on the named flash regions only, mapped to the corresponding portions of /// the given file. PartialImage(Path, &[&str]), /// Operate on the named flash regions, mapping each to a single file. FilePerRegion(&[(Path, &str)]), } ```
It could also then move the layout into the variants that operate on regions, to capture that layout only matters if you're not operating on the complete flash.