Changeset 1440


Ignore:
Timestamp:
09/14/11 01:14:25 (8 months ago)
Author:
stefanct
Message:

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@…>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/internal.c

    r1426 r1440  
    140140#endif 
    141141        int force_laptop = 0; 
     142        int not_a_laptop = 0; 
    142143        char *arg; 
    143144 
     
    171172 
    172173        arg = extract_programmer_param("laptop"); 
    173         if (arg && !strcmp(arg,"force_I_want_a_brick")) { 
     174        if (arg && !strcmp(arg, "force_I_want_a_brick")) 
    174175                force_laptop = 1; 
    175         } else if (arg && !strlen(arg)) { 
     176        else if (arg && !strcmp(arg, "this_is_not_a_laptop")) 
     177                not_a_laptop = 1; 
     178        else if (arg && !strlen(arg)) { 
    176179                msg_perr("Missing argument for laptop.\n"); 
    177180                free(arg); 
     
    238241                                 "not detect this for sure because your vendor has not setup the SMBIOS\n" 
    239242                                 "tables correctly. You can enforce execution by adding\n" 
    240                                  "'-p internal:laptop=force_I_want_a_brick' to the command line, but\n" 
     243                                 "'-p internal:laptop=this_is_not_a_laptop' to the command line, but\n" 
    241244                                 "please read the following warning if you are not sure.\n\n"); 
    242245                } 
     
    252255                         "========================================================================\n"); 
    253256 
    254                 if (force_laptop) { 
    255                         msg_perr("Proceeding anyway because user specified " 
    256                                  "laptop=force_I_want_a_brick\n"); 
     257                if (force_laptop || (not_a_laptop && (is_laptop == 2))) { 
     258                        msg_perr("Proceeding anyway because user forced us to.\n"); 
    257259                } else { 
    258260                        msg_perr("Aborting.\n"); 
Note: See TracChangeset for help on using the changeset viewer.