Attention is currently required from: Edward O'Callaghan, Daniel Campello. Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/59532 )
Change subject: [FIX ME] tests: Add test for extract operation ......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1: Daniel, Edward I added you because I found your names in commit ce983bccaab450d358854494f15c2d8a1846d56b which added do_extract operation.
I am confused because it seems do_extract operation always returns 1. This is because:
1) do_extract calls `do_read(flash, NULL)` and so at this point filename is NULL 2) do_read calls `read_flash_to_file(flash, filename)` 3) then it goes to `write_buf_to_file(buf, size, filename)` and the latter has a block of code: if (!filename) { msg_gerr("No filename specified.\n"); return 1; }
There is no way to provide filename into do_extract, so I don't know how to make it work. I would appreciate your advice!
As an experiment, I changes two lines in flashrom.c#do_extract: replaced return do_read(flash, NULL);
with const char *const filename = "read_chip.test"; return do_read(flash, filename);
This replacement makes test running successfully!
Maybe I am using API in a wrong way? Or could it be bug in do_extract?
Thank you for advice!