diff options
author | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2012-08-20 00:24:22 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2012-08-20 00:24:22 +0000 |
commit | b4e06bde9b2a91d05c31b709d633464fca1c8815 (patch) | |
tree | 481c52c32309f394131ea7bb6e2792eb91e8faf4 /flashrom.c | |
parent | a16a892ca462b6034fd513bb92245ad827b2945f (diff) | |
download | flashrom-b4e06bde9b2a91d05c31b709d633464fca1c8815.tar.gz flashrom-b4e06bde9b2a91d05c31b709d633464fca1c8815.tar.bz2 flashrom-b4e06bde9b2a91d05c31b709d633464fca1c8815.zip |
Refactor the -p internal:mainboard handling
This patch gets rid of some global variables and makes lots of bits along
the code path that control the board enable execution more generic and
clearer. From now on flashrom aborts on a few more occasions that should be
safer for the user. For example it aborts if the enable function for the
specified mainboard (enable) can not be found.
Parts of the board_match_cbname refactoring were done by Carl-Daniel.
Corresponding to flashrom svn r1577.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'flashrom.c')
-rw-r--r-- | flashrom.c | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -1012,12 +1012,11 @@ int probe_flash(struct registered_programmer *pgm, int startchip, "work, but to support all possible " "features"); - msg_cinfo(" we need to add them manually.\nYou " - "can help us by mailing us the output of " - "the following command to flashrom@flashrom." - "org: \n'flashrom -VV [plus the " - "-p/--programmer parameter (if needed)]" - "'\nThanks for your help!\n" + msg_cinfo(" we need to add them manually.\n" + "You can help us by mailing us the output of the following command to " + "flashrom@flashrom.org:\n" + "'flashrom -VV [plus the -p/--programmer parameter]'\n" + "Thanks for your help!\n" "===\n"); } @@ -1814,11 +1813,16 @@ int doit(struct flashctx *flash, int force, const char *filename, int read_it, } #if CONFIG_INTERNAL == 1 - if (programmer == PROGRAMMER_INTERNAL) - if (show_id(newcontents, size)) { + if (programmer == PROGRAMMER_INTERNAL && cb_check_image(newcontents, size) < 0) { + if (force_boardmismatch) { + msg_pinfo("Proceeding anyway because user forced us to.\n"); + } else { + msg_perr("Aborting. You can override this with " + "-p internal:boardmismatch=force.\n"); ret = 1; goto out; } + } #endif } |