diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-01-11 15:30:07 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-01-19 19:26:05 +0000 |
commit | 4186efb290fedef83cf5f396d655fadcc09d6f47 (patch) | |
tree | f0c54bf37257f2905e06b58b483c486b546436b3 /meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon | |
parent | 7e60f16751c317c1adaa518f2efe4d3f39f44423 (diff) | |
download | talos-openbmc-4186efb290fedef83cf5f396d655fadcc09d6f47.tar.gz talos-openbmc-4186efb290fedef83cf5f396d655fadcc09d6f47.zip |
Add hwmon systemd unit and udev rule
The udev rule invokes phosphor-hwmon with the
devicetree path of the hwmon device.
The systemd unit is a templated on the devicetree path,
which is forwarded directly to phosphor-hwmon. The
phosphor-hwmon environment file is also templated, so
environment files must be placed in a devicetree
like-named directory tree under
/etc/defaults/obmc/hwmon/<dtreepath>.conf
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I5001f03ace34cb4e39c82270a98c0c3c902a6e63
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon')
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon/70-hwmon.rules | 1 | ||||
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon/xyz.openbmc_project.Hwmon@.service | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon/70-hwmon.rules b/meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon/70-hwmon.rules new file mode 100644 index 000000000..070d88f51 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon/70-hwmon.rules @@ -0,0 +1 @@ +SUBSYSTEM=="hwmon", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xyz.openbmc_project.Hwmon@%E{OF_FULLNAME}.service" diff --git a/meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon/xyz.openbmc_project.Hwmon@.service b/meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon/xyz.openbmc_project.Hwmon@.service new file mode 100644 index 000000000..fcfada6c2 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/sensors/phosphor-hwmon/xyz.openbmc_project.Hwmon@.service @@ -0,0 +1,8 @@ +[Unit] +Description=Phosphor Hwmon Poller +ConditionFileNotEmpty=/etc/default/obmc/hwmon/%I.conf + +[Service] +Restart=always +ExecStart={sbindir}/phosphor-hwmon-readd -o %f +EnvironmentFile=/etc/default/obmc/hwmon/%I.conf |