diff options
author | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2013-08-12 22:58:43 +0000 |
---|---|---|
committer | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2013-08-12 22:58:43 +0000 |
commit | de4fbf79a662fb77cef3c09c3b4922ca8098e6c7 (patch) | |
tree | 23f602150eecb4599d675e45ff1a61640953d52e /flashrom.c | |
parent | 85daf7b1d30c7b73a67411ad9b777954b4e5a532 (diff) | |
download | flashrom-de4fbf79a662fb77cef3c09c3b4922ca8098e6c7.tar.gz |
Fix verification operation.
I broke this in r1702 where I enabled avoidance of the verification step if
we did not modify anything in the erase/write step. The problem is that
all_skipped is initialized to true and hence it would only ever verify if
there have been changes noted in the erase/write step. This obviously
breaks the verification operation (-v/--verify) because there we never
enter the erase/write loop.
The better alternative would be to enable (the implicit) verification
in the write loop and not in cli_classic.c. This would require a bigger
change due to the existance of dont_verify_it. Eventually this is the
right thing to do but not so shortly before a release.
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1707 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'flashrom.c')
-rw-r--r-- | flashrom.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -335,6 +335,9 @@ struct shutdown_func_data { */ static int may_register_shutdown = 0; +/* Did we change something or was every erase/write skipped (if any)? */ +static bool all_skipped = true; + static int check_block_eraser(const struct flashctx *flash, int k, int log); /* Register a function to be executed on programmer shutdown. @@ -1309,7 +1312,6 @@ static int selfcheck_eraseblocks(const struct flashchip *chip) return ret; } -static bool all_skipped = true; static int erase_and_write_block_helper(struct flashctx *flash, unsigned int start, unsigned int len, uint8_t *curcontents, @@ -1995,7 +1997,8 @@ int doit(struct flashctx *flash, int force, const char *filename, int read_it, } } - if (verify_it && !all_skipped) { + /* Verify only if we either did not try to write (verify operation) or actually changed something. */ + if (verify_it && (!write_it || !all_skipped)) { msg_cinfo("Verifying flash... "); if (write_it) { |