Hi all:
The behaviour of option --image has changed between versions 0.9.9 and 1.0.0.
In the past, I wasn't specifying any --image, and flashrom just flashed the one and only that I had defined in my layout file.
Now, flashrom just states that the chip content is identical, which is not the case. This is the output:
--------8<--------8<--------8<-------- flashrom v1.0 on Windows 6.1 (x86) flashrom is free software, get the source code at https://flashrom.org
Calibrating delay loop... OK. Found Macronix flash chip "MX25L6406E/MX25L6408E" (8192 kB, SPI) on ft2232_spi. Reading old flash chip contents... done. Erasing and writing flash chip... Warning: Chip content is identical to the requested image. Erase/write done. --------8<--------8<--------8<--------
That is misleading. If the newer flashrom does not default to any image (or maybe to all images?), and the user specifies a layout file but not --image arguments, it should then fail with "no layout image specified" or a similar error message.
Best regards, rdiez
Hi,
On 10.01.2018 16:20, R. Diez via flashrom wrote:
Hi all:
The behaviour of option --image has changed between versions 0.9.9 and 1.0.0.
thanks for noting. It has changed indeed, the old behaviour wasn't quite safe, imho.
In the past, I wasn't specifying any --image, and flashrom just flashed the one and only that I had defined in my layout file.
That's not accurate. If you didn't specify any --image to include, it just ignored the layout. Which unlikely was the intention if one speci- fied a layout in the first place.
Now, flashrom just states that the chip content is identical, which is not the case. This is the output:
--------8<--------8<--------8<-------- flashrom v1.0 on Windows 6.1 (x86) flashrom is free software, get the source code at https://flashrom.org
Calibrating delay loop... OK. Found Macronix flash chip "MX25L6406E/MX25L6408E" (8192 kB, SPI) on ft2232_spi. Reading old flash chip contents... done. Erasing and writing flash chip... Warning: Chip content is identical to the requested image. Erase/write done. --------8<--------8<--------8<--------
That is misleading. If the newer flashrom does not default to any image (or maybe to all images?), and the user specifies a layout file but not --image arguments, it should then fail with "no layout image specified" or a similar error message.
Right, this was overlooked so far. Or maybe I thought the warning might be enough to show the user that something is fishy. We are currently reworking the --image parameters. Such a message should be added.
I'm not sure about failing (i.e. returning an error code), though. Technically, not writing anything when no --image arguments are given seems correct.
Nico
In the past, I wasn't specifying any --image, and flashrom just flashed the one and only that I had defined in my layout file.
That's not accurate. If you didn't specify any --image to include, it just ignored the layout. Which unlikely was the intention if one speci- fied a layout in the first place.
Are you sure? The reason why I added the layout in the first place (long before version 0.9.9) was to save time in my sort of "production line".
These are new flash chips, and I only need to flash the first megabyte. Writing all 8 megabytes was taking longer. I believe that I timed the process, at least with the first flashrom version that I tried, and using the layout was a little faster.
I'm not sure about failing (i.e. returning an error code), though. Technically, not writing anything when no --image arguments are given seems correct.
If you are calling flashrom, surely you do not expect it to be a "no operation" that should just succeed. That is counterintuitive. We end-users are not logic-driven mathematicians!
At the very least you should change the wording from "Warning: Chip content is identical to the requested image." and "Erase/write done." to "no operation specified", "nothing to do" or something similar.
I personally would return an error code too.
The help text should also say that "--layout" requires at least one --image. Or at least mention that, without at least one --image argument, it becomes a noop.
Best regards, R. Diez
Hi,
On 11.01.2018 08:30, R. Diez wrote:
I'm not sure about failing (i.e. returning an error code), though. Technically, not writing anything when no --image arguments are given seems correct.
If you are calling flashrom, surely you do not expect it to be a "no operation" that should just succeed. That is counterintuitive. We end-users are not logic-driven mathematicians!
yes, you are! Logic follows the same patterns as intuitively developed languages. Somebody who can read and write English as good as you is a logic-driven mathematician. That people tend to object is mostly due to the weird ways they try to teach you "logic" in school (which usually feels wrong because it's not following the way you already intuitively learned it). Anyway, please ignore the above, it's OT on this list.
At the very least you should change the wording from "Warning: Chip content is identical to the requested image." and "Erase/write done." to "no operation specified", "nothing to do" or something similar.
I've already agreed to update the message. Patches are welcome.
I personally would return an error code too.
Error codes are usually only checked by other programs / scripts. Not following basic logic at such an interface makes software overall more complex and error-prone, IMHO.
The help text should also say that "--layout" requires at least one --image. Or at least mention that, without at least one --image argument, it becomes a noop.
Right, patches are welcome.
Nico