[package] flashrom: use msr path compatible w/ hotplug2

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 <philipp@redfish-solutions.com>

git-svn-id: svn://svn.openwrt.org/openwrt/packages@26381 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian
2011-03-30 20:10:48 +00:00
parent 6a6b46554a
commit 1b6d4fd149
2 changed files with 23 additions and 2 deletions

View File

@ -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;
}