ExternalSensor: New service for external sensors
This code was mostly copied from HwmonTempSensor, and inspired by the
initial proof of concept from https://gerrit.openbmc-project.xyz/35476
External sensors are designed to be placeholders, with no hwmon or
other hardware support locally. Thus, there is no detection or kernel
driver load, so no change is necessary to entity-manager.
The expectation is that these sensors will be updated by something
external to the BMC, such as the host, which can be useful for
including host-based sensors into phosphor-pid-control thermal zones.
* Added systemd service file, similar to the others.
* Added CMakeLists blocks, similar to the others.
* Also cleaned up some nearby formatting in CMakeLists.
Tested: With the addition of the Mutable feature from 36275, and the
installation of the systemd file from 36272, and a change to our IPMI
daemon (still in the process of being upstreamed), the host can write
to a sensor over IPMI. It correctly shows up in the IPMI SDR, and the
written value correctly shows up on the D-Bus ExternalSensor here.
Here is example JSON for use with entity-manager:
{
"Name": "HostOnlyDevTemp",
"Measure": "temperature",
"MinValue": -10.0,
"MaxValue": 117.5,
"Type": "ExternalSensor"
},
Signed-off-by: Josh Lehan <krellan@google.com>
Change-Id: Id499e1cd6c7918179bb1729e5ce8546cf4121dfa
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/service_files/xyz.openbmc_project.externalsensor.service b/service_files/xyz.openbmc_project.externalsensor.service
new file mode 100644
index 0000000..9df1b6d
--- /dev/null
+++ b/service_files/xyz.openbmc_project.externalsensor.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=External Sensor
+StopWhenUnneeded=false
+Requires=xyz.openbmc_project.EntityManager.service
+After=xyz.openbmc_project.EntityManager.service
+
+[Service]
+Restart=always
+RestartSec=5
+ExecStart=/usr/bin/externalsensor
+
+[Install]
+WantedBy=multi-user.target