phosphor-hwmon-config-mrw: avoid relative path in recipe

This path can be different on different build systems.
Instead, use WORKDIR as the path.

Change-Id: I11f91087c62174e1f700c7c7d7d4618a4c0b47df
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/classes/mrw-rev.bbclass b/classes/mrw-rev.bbclass
index 7cf8e7d..9a49bd4 100644
--- a/classes/mrw-rev.bbclass
+++ b/classes/mrw-rev.bbclass
@@ -2,4 +2,4 @@
 MRW_API_SRCREV ?= "60c8e10cbb11768cd1ba394b35cb1d6627efec42"
 
 MRW_TOOLS_SRC_URI ?= "git://github.com/openbmc/phosphor-mrw-tools"
-MRW_TOOLS_SRCREV ?= "902c85375105db9f73353f510b4a6e2651d65c9e"
+MRW_TOOLS_SRCREV ?= "9142da4b410e6c34aca3ef8a8e84b13d39a9c00d"
diff --git a/common/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb b/common/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb
index d72d503..e667a7a 100644
--- a/common/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb
+++ b/common/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb
@@ -10,16 +10,17 @@
 do_compile_append() {
     ${STAGING_BINDIR_NATIVE}/perl-native/perl \
         ${STAGING_BINDIR_NATIVE}/hwmon.pl \
-        -x ${STAGING_DATADIR_NATIVE}/obmc-mrw/${MACHINE}.xml
+        -x ${STAGING_DATADIR_NATIVE}/obmc-mrw/${MACHINE}.xml \
+        -d ${WORKDIR}
 }
 
-def find_conf_files():
+def find_conf_files(dir):
     from fnmatch import fnmatch
     myfiles = []
 
     #These conf files generated by hwmon.pl are in
     #subdirectories which we need to preserve the path to.
-    for root, dirs, files in os.walk("./"):
+    for root, dirs, files in os.walk(dir):
         for name in files:
             if fnmatch(name, "*.conf"):
                 myfiles.append(os.path.join(root, name))
@@ -29,12 +30,15 @@
 python install_conf_files() {
     from shutil import copy
 
-    files = find_conf_files()
+    files = find_conf_files(d.getVar("WORKDIR", True))
 
     install_dir = os.path.join(d.getVar("D", True),
                                "etc", "default", "obmc", "hwmon")
+
+    dir_len = len(d.getVar("WORKDIR", True))
+
     for f in files:
-        dest = os.path.join(install_dir, f)
+        dest = os.path.join(install_dir, f[dir_len + 1:])
         parent = os.path.dirname(dest)
         if not os.path.exists(parent):
             os.makedirs(parent)