summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2009-06-24 17:31:08 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2009-06-24 17:31:08 +0000
commitea07f6245cb622a073a363112a95fea51429a086 (patch)
tree498230722825a09f93a737bbeee66804de5d0953 /flashrom.c
parent3431bb70aaf5414a142a39049b257ee794caabdd (diff)
downloadast2050-flashrom-ea07f6245cb622a073a363112a95fea51429a086.zip
ast2050-flashrom-ea07f6245cb622a073a363112a95fea51429a086.tar.gz
Always verify write operations automatically
Should this be undesireable because of speed reasons, --noverify can be used to suppress an auto-verify. Corresponding to flashrom svn r631. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Harald Gutmann <harald.gutmann@gmx.net>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/flashrom.c b/flashrom.c
index 97b086f..7bc9b71 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -480,6 +480,7 @@ void usage(const char *name)
(" -r | --read: read flash and save into file\n"
" -w | --write: write file into flash\n"
" -v | --verify: verify flash against file\n"
+ " -n | --noverify: don't verify flash against file\n"
" -E | --erase: erase flash device\n"
" -V | --verbose: more verbose output\n"
" -c | --chip <chipname>: probe only for specified flash chip\n"
@@ -515,7 +516,7 @@ int main(int argc, char *argv[])
int option_index = 0;
int force = 0;
int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0;
- int list_supported = 0, list_supported_wiki = 0;
+ int dont_verify_it = 0, list_supported = 0, list_supported_wiki = 0;
int operation_specified = 0;
int ret = 0, i;
@@ -524,6 +525,7 @@ int main(int argc, char *argv[])
{"write", 0, 0, 'w'},
{"erase", 0, 0, 'E'},
{"verify", 0, 0, 'v'},
+ {"noverify", 0, 0, 'n'},
{"chip", 1, 0, 'c'},
{"mainboard", 1, 0, 'm'},
{"verbose", 0, 0, 'V'},
@@ -553,7 +555,7 @@ int main(int argc, char *argv[])
}
setbuf(stdout, NULL);
- while ((opt = getopt_long(argc, argv, "rRwvVEfc:m:l:i:p:Lzh",
+ while ((opt = getopt_long(argc, argv, "rRwvnVEfc:m:l:i:p:Lzh",
long_options, &option_index)) != EOF) {
switch (opt) {
case 'r':
@@ -580,6 +582,9 @@ int main(int argc, char *argv[])
}
verify_it = 1;
break;
+ case 'n':
+ dont_verify_it = 1;
+ break;
case 'c':
chip_to_probe = strdup(optarg);
break;
@@ -779,6 +784,10 @@ int main(int argc, char *argv[])
exit(1);
}
+ /* Always verify write operations unless -n is used. */
+ if (write_it && !dont_verify_it)
+ verify_it = 1;
+
size = flash->total_size * 1024;
buf = (uint8_t *) calloc(size, sizeof(char));
OpenPOWER on IntegriCloud