[flashrom] [PATCH] Refine messages related to erase/write recovery.

Stefan Tauner stefan.tauner at student.tuwien.ac.at
Wed Aug 7 17:07:47 CEST 2013


We are more verbose inside erase_and_write_flash() although it does not
matter as much as here - at the end of the process.

New output for the non-fatal (i.e. read-protected + successful read) case:

Reading old flash chip contents... done.
Erasing and writing flash chip... spi_block_erase_d8 failed during command execution at address 0x8000
Reading current flash chip contents... done. spi_chip_erase_c7 failed during command execution
FAILED!
Uh oh. Erase/write failed. Checking if anything has changed.
Reading current flash chip contents... done.
Good. Writing to the flash chip apparently didn't do anything.
Please check the connections (especially those to write protection pins) between
the programmer and the flash chip. If you think the error is caused by flashrom
please report this on IRC at chat.freenode.net (channel #flashrom) or
mail flashrom at flashrom.org, thanks!

Signed-off-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>
---
 flashrom.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/flashrom.c b/flashrom.c
index db5b1c7..694d01e 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1979,16 +1979,19 @@ int doit(struct flashctx *flash, int force, const char *filename, int read_it,
 
 	if (write_it) {
 		if (erase_and_write_flash(flash, oldcontents, newcontents)) {
-			msg_cerr("Uh oh. Erase/write failed. Checking if "
-				 "anything changed.\n");
+			msg_cerr("Uh oh. Erase/write failed. Checking if anything has changed.\n");
+			msg_cinfo("Reading current flash chip contents... ");
 			if (!flash->chip->read(flash, newcontents, 0, size)) {
+				msg_cinfo("done.\n");
 				if (!memcmp(oldcontents, newcontents, size)) {
-					msg_cinfo("Good. It seems nothing was changed.\n");
+					msg_cinfo("Good. ");
 					nonfatal_help_message();
 					ret = 1;
 					goto out;
 				}
-			}
+				msg_cinfo("Apparently at least some data has changed.\n");
+			} else
+				msg_cerr("Can't even read anymore!\n");
 			emergency_help_message();
 			ret = 1;
 			goto out;
-- 
Kind regards, Stefan Tauner





More information about the flashrom mailing list