1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 23:22:37 +02:00

Warn if running on laptops

Corresponding to flashrom svn r916.

Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
Michael Karcher 2010-02-26 09:51:20 +00:00
parent 0d7fb7c5ed
commit 8c1df280e3
3 changed files with 21 additions and 0 deletions

8
dmi.c
View File

@ -98,6 +98,7 @@ static char *get_dmi_string(const char *string_name)
void dmi_init(void) void dmi_init(void)
{ {
int i; int i;
char *chassis_type;
has_dmi_support = 1; has_dmi_support = 1;
for (i = 0; i < DMI_ID_INVALID; i++) { for (i = 0; i < DMI_ID_INVALID; i++) {
dmistrings[i] = get_dmi_string(dmidecode_names[i]); dmistrings[i] = get_dmi_string(dmidecode_names[i]);
@ -106,6 +107,13 @@ void dmi_init(void)
break; break;
} }
} }
chassis_type = get_dmi_string("chassis-type");
if (chassis_type && !strcmp(chassis_type, "Notebook")) {
printf_debug("Laptop detected via DMI");
is_laptop = 1;
}
free(chassis_type);
} }
/** /**

View File

@ -382,6 +382,7 @@ struct pci_dev *pci_card_find(uint16_t vendor, uint16_t device,
void get_io_perms(void); void get_io_perms(void);
void release_io_perms(void); void release_io_perms(void);
#if INTERNAL_SUPPORT == 1 #if INTERNAL_SUPPORT == 1
extern int is_laptop;
void probe_superio(void); void probe_superio(void);
int internal_init(void); int internal_init(void);
int internal_shutdown(void); int internal_shutdown(void);

View File

@ -110,6 +110,8 @@ void probe_superio(void)
#endif #endif
} }
int is_laptop;
int internal_init(void) int internal_init(void)
{ {
int ret = 0; int ret = 0;
@ -131,6 +133,16 @@ int internal_init(void)
/* Probe for the SuperI/O chip and fill global struct superio. */ /* Probe for the SuperI/O chip and fill global struct superio. */
probe_superio(); probe_superio();
/* Warn if a laptop is detected */
if (is_laptop)
printf("========================================================================\n"
"WARNING! You seem to be running flashrom on a laptop.\n"
"Laptops, notebooks and netbooks are difficult to support and we recommend\n"
"to use the vendor flashing utility. The embedded controller (EC) in these\n"
"machines often interacts badly with flashing\n"
"See http://www.flashrom.org/Laptops\n"
"========================================================================\n");
/* try to enable it. Failure IS an option, since not all motherboards /* try to enable it. Failure IS an option, since not all motherboards
* really need this to be done, etc., etc. * really need this to be done, etc., etc.
*/ */