summaryrefslogtreecommitdiff
path: root/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-native.bb
diff options
context:
space:
mode:
authorDhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>2017-07-12 14:45:14 +0300
committerPatrick Williams <patrick@stwcx.xyz>2017-08-08 17:55:33 +0300
commite251ef95850a75c73794a5eccbf0930d76f0d182 (patch)
tree737bd160588716b9650e8cbb4647f6a24b7901b9 /meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-native.bb
parent1025084ea00ab69774d72ab19ae416af724710c0 (diff)
downloadopenbmc-e251ef95850a75c73794a5eccbf0930d76f0d182.tar.xz
Configuration yaml changes for virtual sensors
Change-Id: I270a62022340d6be382091a6595859dafdb634ae Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-native.bb')
-rw-r--r--meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-native.bb32
1 files changed, 29 insertions, 3 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-native.bb b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-native.bb
index db018c656f..169b54772e 100644
--- a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-native.bb
+++ b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-native.bb
@@ -4,17 +4,19 @@ PR = "r1"
inherit native
inherit obmc-phosphor-license
inherit phosphor-ipmi-host
-
-SRC_URI += "file://config.yaml"
+inherit pythonnative
DEPENDS += " \
mrw-native \
mrw-perl-tools-native \
+ packagegroup-obmc-ipmi-sensors \
+ phosphor-ipmi-sensor-inventory-mrw-config-native \
"
PROVIDES += "virtual/phosphor-ipmi-sensor-inventory"
S = "${WORKDIR}"
+SRC_URI += "file://merge_sensor_config.py"
do_install() {
DEST=${D}${sensor_datadir}
@@ -23,6 +25,30 @@ do_install() {
${bindir}/perl-native/perl \
${bindir}/gen_ipmi_sensor.pl \
-i ${datadir}/obmc-mrw/${MACHINE}.xml \
- -m config.yaml \
+ -m ${sensor_yamldir}/config.yaml \
-o ${DEST}/sensor.yaml
}
+
+python do_merge_sensor_config () {
+ import subprocess
+
+ # TODO: Perform the merge in a temporary directory?
+ workdir = d.getVar('WORKDIR', True)
+ nativedir = d.getVar('STAGING_DIR_NATIVE', True)
+ sensoryamldir = d.getVar('sensor_yamldir', True)
+ cmd = []
+ cmd.append(os.path.join(workdir, 'merge_sensor_config.py'))
+ cmd.append(os.path.join(sensoryamldir, 'config.yaml'))
+
+ fetch = os.listdir(sensoryamldir)
+ override_urls = filter(lambda f: f.endswith('-config.yaml'), fetch)
+ for url in override_urls:
+ bb.debug(2, 'Merging extra configurations: ' + url)
+ filename = os.path.join(sensoryamldir, url)
+ cmd.append(filename)
+
+ # Invoke the script and don't catch any resulting exception.
+ subprocess.check_call(cmd)
+}
+# python-pyyaml-native is installed by do_configure, so put this task after
+addtask merge_sensor_config after do_configure before do_compile