[flashrom] [commit] r916 - trunk

repository service svn at flashrom.org
Fri Feb 26 10:51:21 CET 2010


Author: mkarcher
Date: Fri Feb 26 10:51:20 2010
New Revision: 916
URL: http://flashrom.org/trac/coreboot/changeset/916

Log:
Warn if running on laptops

Signed-off-by: Michael Karcher <flashrom at mkarcher.dialup.fu-berlin.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Modified:
   trunk/dmi.c
   trunk/flash.h
   trunk/internal.c

Modified: trunk/dmi.c
==============================================================================
--- trunk/dmi.c	Fri Feb 26 10:51:16 2010	(r915)
+++ trunk/dmi.c	Fri Feb 26 10:51:20 2010	(r916)
@@ -98,6 +98,7 @@
 void dmi_init(void)
 {
 	int i;
+	char *chassis_type;
 	has_dmi_support = 1;
 	for (i = 0; i < DMI_ID_INVALID; i++) {
 		dmistrings[i] = get_dmi_string(dmidecode_names[i]);
@@ -106,6 +107,13 @@
 			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);
 }
 
 /**

Modified: trunk/flash.h
==============================================================================
--- trunk/flash.h	Fri Feb 26 10:51:16 2010	(r915)
+++ trunk/flash.h	Fri Feb 26 10:51:20 2010	(r916)
@@ -382,6 +382,7 @@
 void get_io_perms(void);
 void release_io_perms(void);
 #if INTERNAL_SUPPORT == 1
+extern int is_laptop;
 void probe_superio(void);
 int internal_init(void);
 int internal_shutdown(void);

Modified: trunk/internal.c
==============================================================================
--- trunk/internal.c	Fri Feb 26 10:51:16 2010	(r915)
+++ trunk/internal.c	Fri Feb 26 10:51:20 2010	(r916)
@@ -110,6 +110,8 @@
 #endif
 }
 
+int is_laptop;
+
 int internal_init(void)
 {
 	int ret = 0;
@@ -131,6 +133,16 @@
 	/* Probe for the SuperI/O chip and fill global struct 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
 	 * really need this to be done, etc., etc.
 	 */




More information about the flashrom mailing list