summaryrefslogtreecommitdiff
path: root/util/flashrom
diff options
context:
space:
mode:
authorJordan Crouse <jordan.crouse@amd.com>2007-10-04 06:26:41 +0000
committerStefan Reinauer <stepan@openbios.org>2007-10-04 06:26:41 +0000
commit573ff508ab3d61ede76cd3b68aaaf7f2bdcfa34a (patch)
treefe11cb421230594b72ae453b80fc8135eaf1cc6b /util/flashrom
parent209148c535dd61df9e96209a063f315912ca9685 (diff)
[FLASHROM] Fix the help, and print a message when nothing happens
The help implied that writes happen by default, which they don't. Fix the text, and say something when we dont specify any commands. Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2820 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flashrom')
-rw-r--r--util/flashrom/flashrom.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/util/flashrom/flashrom.c b/util/flashrom/flashrom.c
index 36462a4bc9..7587ac79b8 100644
--- a/util/flashrom/flashrom.c
+++ b/util/flashrom/flashrom.c
@@ -195,8 +195,7 @@ void usage(const char *name)
printf(" [-e exclude_end] [-m vendor:part] [-l file.layout] [-i imagename] [file]\n");
printf
(" -r | --read: read flash and save into file\n"
- " -w | --write: write file into flash (default when\n"
- " file is specified)\n"
+ " -w | --write: write file into flash\n"
" -v | --verify: verify flash against file\n"
" -E | --erase: erase flash device\n"
" -V | --verbose: more verbose output\n"
@@ -366,15 +365,22 @@ int main(int argc, char *argv[])
if ((flash = probe_flash(flashchips)) == NULL) {
printf("No EEPROM/flash device found.\n");
+ // FIXME: flash writes stay enabled!
exit(1);
}
printf("Flash part is %s (%d KB)\n", flash->name, flash->total_size);
+ if (!(read_it | write_it | verify_it | erase_it)) {
+ printf("No operations were specified.\n");
+ // FIXME: flash writes stay enabled!
+ exit(1);
+ }
+
if (!filename && !erase_it) {
- // FIXME: Do we really want this feature implicitly?
- printf("OK, only ENABLING flash write, but NOT FLASHING.\n");
- return 0;
+ printf("Error: No filename specified.\n");
+ // FIXME: flash writes stay enabled!
+ exit(1);
}
size = flash->total_size * 1024;