[LinuxBIOS] [FLASHROM] Fix the help, and print a message when nothing happens

Jordan Crouse jordan.crouse at amd.com
Tue Oct 2 19:53:46 CEST 2007

I have used flashrom just little enough to forget that -w isn't implied,
and wonder why nothing happened.  This fixes the help, and says something
at the end of no operations are specified.  Just a little user-friendliness
from your good friends at LinuxBIOS.

Jordan Crouse
Systems Software Development Engineer 
Advanced Micro Devices, Inc.
-------------- next part --------------
[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 get to the bottom and nothing happened.

Signed-off-by: Jordan Crouse <jordan.crouse at amd.com>

Index: flashrom/flashrom.c
--- flashrom.orig/flashrom.c	2007-10-02 11:43:38.000000000 -0600
+++ flashrom/flashrom.c	2007-10-02 11:45:51.000000000 -0600
@@ -195,8 +195,7 @@
 	printf("       [-e exclude_end] [-m vendor:part] [-l file.layout] [-i imagename] [file]\n");
 	    ("   -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"
@@ -456,5 +455,9 @@
 	if (verify_it)
 		ret |= verify_flash(flash, buf);
+	if (!(read_it|write_it|verify_it|erase_it)) {
+		printf("No operations were specified.\n");
+	}
 	return ret;

More information about the coreboot mailing list