flashrom: use msr path compatible w/ hotplug2
authorFlorian Fainelli <[email protected]>
Wed, 30 Mar 2011 20:10:48 +0000 (20:10 +0000)
committerFlorian Fainelli <[email protected]>
Wed, 30 Mar 2011 20:10:48 +0000 (20:10 +0000)
The issue wasn't that flashrom-0.9.3 was broken, but that the incompatible device path put the box into a funky state that couldn't be reverted.

This fix causes it to use the hotplug2 path.

With this, we don't need to revert to 0.9.1, superseding my early patch to revert...

Signed-off-by: Philip Prindeville <[email protected]>
SVN-Revision: 26381

utils/flashrom/Makefile
utils/flashrom/patches/001-msr_dev_path.patch [new file with mode: 0644]

index fd1cf8b86df4909884326740a3e775193aa66de9..6d8b5a7d17a5119d3fa8a54299df57098095e1c0 100644 (file)
@@ -1,5 +1,5 @@
 # 
-# Copyright (C) 2010 OpenWrt.org
+# Copyright (C) 2010-2011 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=flashrom
 PKG_VERSION:=0.9.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://qa.coreboot.org/releases/
diff --git a/utils/flashrom/patches/001-msr_dev_path.patch b/utils/flashrom/patches/001-msr_dev_path.patch
new file mode 100644 (file)
index 0000000..55435d9
--- /dev/null
@@ -0,0 +1,21 @@
+--- flashrom-0.9.3/physmap.c.orig      2010-10-05 20:56:44.000000000 -0600
++++ flashrom-0.9.3/physmap.c   2011-03-29 20:26:22.000000000 -0600
+@@ -352,7 +352,7 @@ int setup_cpu_msr(int cpu)
+ {
+       char msrfilename[64];
+       memset(msrfilename, 0, sizeof(msrfilename));
+-      snprintf(msrfilename, sizeof(msrfilename), "/dev/cpu/%d/msr", cpu);
++      snprintf(msrfilename, sizeof(msrfilename), "/dev/msr%d", cpu);
+       if (fd_msr != -1) {
+               msg_pinfo("MSR was already initialized\n");
+@@ -362,7 +362,8 @@ int setup_cpu_msr(int cpu)
+       fd_msr = open(msrfilename, O_RDWR);
+       if (fd_msr < 0) {
+-              perror("Error while opening /dev/cpu/0/msr");
++              fprintf(stderr, "Error while opening %s: %s\n", msrfilename,
++                      strerror(errno));
+               msg_pinfo("Did you run 'modprobe msr'?\n");
+               return -1;
+       }