David Hendricks has posted comments on this change. ( https://review.coreboot.org/23021 )
Change subject: layout: Add -i <region>[:<file>] support. ......................................................................
Patch Set 13:
(3 comments)
PS13 addresses a couple lingering issues from earlier patch sets.
I also came up with a patch to try and implement the original intended behavior for '-w': https://review.coreboot.org/#/c/flashrom/+/23353/
It's a bit hacky though, though it does allow us to keep the policy decision in the CLI code. There might be a better way.
https://review.coreboot.org/#/c/23021/5/flashrom.c File flashrom.c:
https://review.coreboot.org/#/c/23021/5/flashrom.c@1484 PS5, Line 1484: const char *region_file = layout->entries[i].file; : : if (first_entry_encountered == 0) { : ms
Should be kept in do_write_buf_to_file() where the actual file handling […]
Done
https://review.coreboot.org/#/c/23021/5/layout.c File layout.c:
https://review.coreboot.org/#/c/23021/5/layout.c@217 PS5, Line 217: }
why? is it necessary? doesn't `file` point into `argv` of main()?
No, I don't think it's necessary. It seems to be a remnant of https://mail.coreboot.org/pipermail/flashrom/2013-October/011729.html, but that may have been based on an even older version of layout.c from CrOS.
https://review.coreboot.org/#/c/23021/5/layout.c@285 PS5, Line 285: removed this as well since we don't need to allocate memory for layout.entries[i].file.