summaryrefslogtreecommitdiff
path: root/internal.c
diff options
context:
space:
mode:
authorstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-09-13 23:14:25 +0000
committerstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-09-13 23:14:25 +0000
commitad175978c5e977223324fceddb745ca0040535f6 (patch)
tree59ef0a70048a38ea157293f38b15ce3811cf5320 /internal.c
parent09d545c8327513747ab9d9a8f6689c3d8640dba0 (diff)
downloadflashrom-ad175978c5e977223324fceddb745ca0040535f6.tar.gz
Make the laptop warning less scary if unsure
Telling the user to use "force_I_want_a_brick" if it is not even a laptop, is a bit over-the-top. Introduce a new laptop parameter "this_is_not_a_laptop" that allows to force operation, but only if the detection is not sure. Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1440 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'internal.c')
-rw-r--r--internal.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/internal.c b/internal.c
index 46836b7..fc9d9e4 100644
--- a/internal.c
+++ b/internal.c
@@ -139,6 +139,7 @@ int internal_init(void)
int ret = 0;
#endif
int force_laptop = 0;
+ int not_a_laptop = 0;
char *arg;
arg = extract_programmer_param("boardenable");
@@ -170,9 +171,11 @@ int internal_init(void)
free(arg);
arg = extract_programmer_param("laptop");
- if (arg && !strcmp(arg,"force_I_want_a_brick")) {
+ if (arg && !strcmp(arg, "force_I_want_a_brick"))
force_laptop = 1;
- } else if (arg && !strlen(arg)) {
+ else if (arg && !strcmp(arg, "this_is_not_a_laptop"))
+ not_a_laptop = 1;
+ else if (arg && !strlen(arg)) {
msg_perr("Missing argument for laptop.\n");
free(arg);
return 1;
@@ -237,7 +240,7 @@ int internal_init(void)
msg_perr("WARNING! You may be running flashrom on an unsupported laptop. We could\n"
"not detect this for sure because your vendor has not setup the SMBIOS\n"
"tables correctly. You can enforce execution by adding\n"
- "'-p internal:laptop=force_I_want_a_brick' to the command line, but\n"
+ "'-p internal:laptop=this_is_not_a_laptop' to the command line, but\n"
"please read the following warning if you are not sure.\n\n");
}
msg_perr("Laptops, notebooks and netbooks are difficult to support and we\n"
@@ -251,9 +254,8 @@ int internal_init(void)
"You have been warned.\n"
"========================================================================\n");
- if (force_laptop) {
- msg_perr("Proceeding anyway because user specified "
- "laptop=force_I_want_a_brick\n");
+ if (force_laptop || (not_a_laptop && (is_laptop == 2))) {
+ msg_perr("Proceeding anyway because user forced us to.\n");
} else {
msg_perr("Aborting.\n");
exit(1);