summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/fans
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor/fans')
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/0001-allow-dbus-sensors-without-thresholds.patch39
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service14
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend14
3 files changed, 67 insertions, 0 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/0001-allow-dbus-sensors-without-thresholds.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/0001-allow-dbus-sensors-without-thresholds.patch
new file mode 100644
index 000000000..6af0a5702
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/0001-allow-dbus-sensors-without-thresholds.patch
@@ -0,0 +1,39 @@
+From 6b4071c12bdcc3bd20e72a7bd2eed19ff14b97af Mon Sep 17 00:00:00 2001
+From: Zhikui Ren <zhikui.ren@intel.com>
+Date: Wed, 12 May 2021 19:11:08 -0700
+Subject: [PATCH] allow dbus sensors without thresholds
+
+catch dbus exceptions when query for thresholds interfaces.
+log messages and continue.
+
+Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
+---
+ dbus/dbusconfiguration.cpp | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/dbus/dbusconfiguration.cpp b/dbus/dbusconfiguration.cpp
+index 55151d3..fd7a138 100644
+--- a/dbus/dbusconfiguration.cpp
++++ b/dbus/dbusconfiguration.cpp
+@@ -286,13 +286,15 @@ void populatePidInfo(
+ {
+ interface = thresholds::criticalInterface;
+ }
+- const std::string& path = sensorConfig.at(info.inputs.front()).readPath;
+
+- DbusHelper helper(sdbusplus::bus::new_system());
+- std::string service = helper.getService(interface, path);
+ double reading = 0;
+ try
+ {
++ const std::string& path = sensorConfig.at(info.inputs.front()).readPath;
++
++ DbusHelper helper(sdbusplus::bus::new_system());
++ std::string service = helper.getService(interface, path);
++
+ helper.getProperty(service, path, interface, *thresholdProperty,
+ reading);
+ }
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service
new file mode 100644
index 000000000..0e80b554a
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Phosphor-Pid-Control Margin-based Fan Control Daemon
+After=xyz.openbmc_project.EntityManager.service
+After=xyz.openbmc_project.ObjectMapper.service
+
+[Service]
+Restart=always
+ExecStart={bindir}/swampd
+RestartSec=5
+StartLimitInterval=0
+Type=simple
+
+[Install]
+WantedBy=basic.target
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend
new file mode 100644
index 000000000..328176aca
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend
@@ -0,0 +1,14 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+inherit obmc-phosphor-systemd
+SYSTEMD_SERVICE:${PN} = "phosphor-pid-control.service"
+EXTRA_OECONF = "--enable-configure-dbus=yes"
+
+SRC_URI = "git://github.com/openbmc/phosphor-pid-control.git"
+SRCREV = "cca9c659889d149c06e95bab4b8808db4f1e3eab"
+
+SRC_URI += "\
+ file://0001-allow-dbus-sensors-without-thresholds.patch \
+ "
+
+FILES:${PN} = "${bindir}/swampd ${bindir}/setsensor"