summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-04-28 15:22:14 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-04-28 15:22:14 +0000
commit270237687a7f550e86c01548550f25b1d0a31d65 (patch)
tree88f216baf356f0e22fb8c8f7733ca9f175bd1545 /flashrom.c
parent837d81079689927b78baa5c606c6d8484ea21a95 (diff)
downloadast2050-flashrom-270237687a7f550e86c01548550f25b1d0a31d65.zip
ast2050-flashrom-270237687a7f550e86c01548550f25b1d0a31d65.tar.gz
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. Corresponding to flashrom svn r996. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/flashrom.c b/flashrom.c
index 2450dee..77a6042 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -488,7 +488,17 @@ char *extract_param(char **haystack, char *needle, char *delim)
char *param_pos, *rest, *tmp;
char *dev = NULL;
int devlen;
+ int needlelen;
+ needlelen = strlen(needle);
+ if (!needlelen) {
+ msg_gerr("%s: empty needle! Please report a bug at "
+ "flashrom@flashrom.org\n", __func__);
+ return NULL;
+ }
+ /* No programmer parameters given. */
+ if (*haystack == NULL)
+ return NULL;
param_pos = strstr(*haystack, needle);
do {
if (!param_pos)
@@ -924,7 +934,8 @@ notfound:
if (!flash || !flash->name)
return NULL;
- printf("Found chip \"%s %s\" (%d KB, %s) at physical address 0x%lx.\n",
+ printf("%s chip \"%s %s\" (%d KB, %s) at physical address 0x%lx.\n",
+ force ? "Assuming" : "Found",
flash->vendor, flash->name, flash->total_size,
flashbuses_to_text(flash->bustype), base);
OpenPOWER on IntegriCloud