Add nvramtool -D option that allows taking cmos data from
a plain binary file. Overrides using cmos.default in CBFS
if both -C and -D are given.

Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Acked-by: Stefan Reinauer <stepan@coreboot.org>


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6286 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
diff --git a/util/nvramtool/opts.c b/util/nvramtool/opts.c
index 9aaeedf..4949649 100644
--- a/util/nvramtool/opts.c
+++ b/util/nvramtool/opts.c
@@ -41,7 +41,7 @@
 static void resolve_op_modifiers(void);
 static void sanity_check_args(void);
 
-static const char getopt_string[] = "-ab:B:c::C:de:hil::np:r:tvw:xX:y:Y";
+static const char getopt_string[] = "-ab:B:c::C:dD:e:hil::np:r:tvw:xX:y:Y";
 
 /****************************************************************************
  * parse_nvramtool_args
@@ -89,6 +89,10 @@
 		case 'd':
 			register_op(&op_found, NVRAMTOOL_OP_LBTABLE_DUMP, NULL);
 			break;
+		case 'D':
+			register_op_modifier(NVRAMTOOL_MOD_USE_CMOS_FILE,
+					     optarg);
+			break;
 		case 'e':
 			register_op(&op_found, NVRAMTOOL_OP_SHOW_PARAM_VALUES,
 				    optarg);