diff options
author | Matt Spinler <spinler@us.ibm.com> | 2017-03-29 12:34:40 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-03-29 21:31:56 +0000 |
commit | 6fb9ddb3c4bab1a38453d06d3a3eefd890a49ac8 (patch) | |
tree | 2aa489971f5b68235f29ffbbbc58f7491e727fd3 /meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb | |
parent | e6870323bed60378abc8f8ae4a8ba2f5d1e7c790 (diff) | |
download | talos-openbmc-6fb9ddb3c4bab1a38453d06d3a3eefd890a49ac8.tar.gz talos-openbmc-6fb9ddb3c4bab1a38453d06d3a3eefd890a49ac8.zip |
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>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb')
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb b/meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb index d72d5036b..e667a7a9c 100644 --- a/meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb +++ b/meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb @@ -10,16 +10,17 @@ DEPENDS += "mrw-perl-tools-native mrw-native" 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 @@ def find_conf_files(): 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) |