mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 23:22:37 +02:00
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. Corresponding to flashrom svn r141 and coreboot v2 svn r2820. Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Acked-by: Stefan Reinauer <stepan@coresystems.de>
This commit is contained in:
parent
e151499fd2
commit
144ede66ca
16
flashrom.c
16
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(" [-e exclude_end] [-m vendor:part] [-l file.layout] [-i imagename] [file]\n");
|
||||||
printf
|
printf
|
||||||
(" -r | --read: read flash and save into file\n"
|
(" -r | --read: read flash and save into file\n"
|
||||||
" -w | --write: write file into flash (default when\n"
|
" -w | --write: write file into flash\n"
|
||||||
" file is specified)\n"
|
|
||||||
" -v | --verify: verify flash against file\n"
|
" -v | --verify: verify flash against file\n"
|
||||||
" -E | --erase: erase flash device\n"
|
" -E | --erase: erase flash device\n"
|
||||||
" -V | --verbose: more verbose output\n"
|
" -V | --verbose: more verbose output\n"
|
||||||
@ -366,15 +365,22 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if ((flash = probe_flash(flashchips)) == NULL) {
|
if ((flash = probe_flash(flashchips)) == NULL) {
|
||||||
printf("No EEPROM/flash device found.\n");
|
printf("No EEPROM/flash device found.\n");
|
||||||
|
// FIXME: flash writes stay enabled!
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Flash part is %s (%d KB)\n", flash->name, flash->total_size);
|
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) {
|
if (!filename && !erase_it) {
|
||||||
// FIXME: Do we really want this feature implicitly?
|
printf("Error: No filename specified.\n");
|
||||||
printf("OK, only ENABLING flash write, but NOT FLASHING.\n");
|
// FIXME: flash writes stay enabled!
|
||||||
return 0;
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
size = flash->total_size * 1024;
|
size = flash->total_size * 1024;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user