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
diff --git a/common/recipes-phosphor/sensors/phosphor-hwmon.bb b/common/recipes-phosphor/sensors/phosphor-hwmon.bb
index f6276fa..984aabf 100644
--- a/common/recipes-phosphor/sensors/phosphor-hwmon.bb
+++ b/common/recipes-phosphor/sensors/phosphor-hwmon.bb
@@ -5,7 +5,9 @@
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig obmc-phosphor-systemd
+
+SYSTEMD_SERVICE_${PN} = "xyz.openbmc_project.Hwmon@.service"
 
 DEPENDS += "autoconf-archive-native"
 DEPENDS += "sdbusplus"
@@ -15,7 +17,14 @@
         "
 
 SRC_URI += "git://github.com/openbmc/phosphor-hwmon"
+SRC_URI += "file://70-hwmon.rules"
 
 SRCREV = "8d89325adccbf7616e34210bb15ec3bebe17fcfe"
 
 S = "${WORKDIR}/git"
+
+do_install_append() {
+
+	install -d ${D}/${base_libdir}/udev/rules.d/
+	install ${WORKDIR}/70-hwmon.rules ${D}/${base_libdir}/udev/rules.d/
+}