[LinuxBIOS] r2820 - trunk/util/flashrom
svn at openbios.org
svn at openbios.org
Thu Oct 4 08:26:41 CEST 2007
Author: stepan
Date: 2007-10-04 08:26:41 +0200 (Thu, 04 Oct 2007)
New Revision: 2820
Modified:
trunk/util/flashrom/flashrom.c
Log:
[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 at amd.com>
Acked-by: Stefan Reinauer <stepan at coresystems.de>
Modified: trunk/util/flashrom/flashrom.c
===================================================================
--- trunk/util/flashrom/flashrom.c 2007-10-03 18:56:51 UTC (rev 2819)
+++ trunk/util/flashrom/flashrom.c 2007-10-04 06:26:41 UTC (rev 2820)
@@ -195,8 +195,7 @@
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 @@
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;
More information about the coreboot
mailing list