From c0a76f5940ce3d802cc3ecaa2d7c16c5c34cb0d0 Mon Sep 17 00:00:00 2001 From: hailfinger Date: Wed, 28 Apr 2010 15:22:14 +0000 Subject: --force may have been a good idea back when only developers were using flashrom, but over the last few months we've seen too many people who incorrectly believed that --force would solve anything. One of the problems is that --force had multiple meanings: - Force chip read by faking probe success. - Force chip access even if the chip is bigger than max decode size for the flash bus. - Force erase even if erase is known bad. - Force write even if write is known bad. - Force writing even if cbtable tells us that this is the wrong image for this board. This patch cleans up --force usage: - Remove any suggestions to use --force for probe/read from flashrom output. - Don't talk about "success" or "Found chip" if the chip is forced. - Add a new internal programmer parameter boardmismatch=force. This overrides any mismatch detection from cbtable/image comparisons. - Add a new internal programmer parameter laptop=force_I_want_a_brick. - Adjust the documentation for --force. - Clean up the man page a bit whereever it talks about --force or laptops. Additional changes in this patch: - Add warnings about laptops to the documentation. - Abort if a laptop is detected. Can be overridden with the programmer parameter mentioned above. - Add "Portable" to the list of DMI strings indicating laptops. - Check if a chip specified with -c is known to flashrom. - Programmer parameter reliability and consistency fixes. - More paranoid self-checks. - Improve documentation. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Michael Karcher git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@996 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- layout.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'layout.c') diff --git a/layout.c b/layout.c index 26b7c6a..df77c2f 100644 --- a/layout.c +++ b/layout.c @@ -111,14 +111,15 @@ int show_id(uint8_t *bios, int size, int force) !strcasecmp(mainboard_part, lb_part)) { printf_debug("This firmware image matches this mainboard.\n"); } else { - if (force) { + if (force_boardmismatch) { printf("WARNING: This firmware image does not " "seem to fit to this machine - forcing it.\n"); } else { printf("ERROR: Your firmware image (%s:%s) does not " "appear to\n be correct for the detected " - "mainboard (%s:%s)\n\nOverride with --force if you " - "are absolutely sure that you\nare using a correct " + "mainboard (%s:%s)\n\nOverride with -p internal:" + "boardmismatch=force if you are absolutely sure " + "that\nyou are using a correct " "image for this mainboard or override\nthe detected " "values with --mainboard :.\n\n", mainboard_vendor, mainboard_part, lb_vendor, -- cgit v1.2.1