openpower-fru-vpd: add udev rule

Add udev rule to launch unit file upon eeprom plug event

Change-Id: Ice525ec26fe3c7144e78728e104d11c15ef3f465
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/common/recipes-phosphor/vpd/openpower-fru-vpd.bb b/common/recipes-phosphor/vpd/openpower-fru-vpd.bb
index 801b85d..1efe2ea 100644
--- a/common/recipes-phosphor/vpd/openpower-fru-vpd.bb
+++ b/common/recipes-phosphor/vpd/openpower-fru-vpd.bb
@@ -9,6 +9,8 @@
 
 require ${PN}.inc
 
+SRC_URI += "file://70-op-vpd.rules"
+
 DEPENDS += " \
         virtual/openpower-fru-vpd-layout \
         virtual/openpower-fru-inventory \
@@ -35,4 +37,7 @@
         DEST=${D}${inventory_envdir}
         install -d ${DEST}
         install ${SRC}/inventory ${DEST}
+
+        install -d ${D}/${base_libdir}/udev/rules.d/
+        install ${WORKDIR}/70-op-vpd.rules ${D}/${base_libdir}/udev/rules.d/
 }
diff --git a/common/recipes-phosphor/vpd/openpower-fru-vpd/70-op-vpd.rules b/common/recipes-phosphor/vpd/openpower-fru-vpd/70-op-vpd.rules
new file mode 100644
index 0000000..4b86b91
--- /dev/null
+++ b/common/recipes-phosphor/vpd/openpower-fru-vpd/70-op-vpd.rules
@@ -0,0 +1 @@
+SUBSYSTEM=="i2c", ENV{OF_NAME}=="eeprom", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="op-vpd-parser"