fp5280g2: inventory: Add Chassis interface to the chassis
Create the xyz.openbmc_project.Inventory.Item.Chassis interface
on the /system/chassis inventory item at startup.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I0cce08944dfc59f659bf439edb3001cd5fffc527
diff --git a/meta-fp5280g2/recipes-phosphor/inventory/phosphor-inventory-manager-chassis.bb b/meta-fp5280g2/recipes-phosphor/inventory/phosphor-inventory-manager-chassis.bb
new file mode 100644
index 0000000..11ff662
--- /dev/null
+++ b/meta-fp5280g2/recipes-phosphor/inventory/phosphor-inventory-manager-chassis.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Add Chassis interface for inventory manager"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+inherit allarch
+inherit phosphor-inventory-manager
+
+PROVIDES += "virtual/phosphor-inventory-manager-chassis"
+S = "${WORKDIR}"
+
+SRC_URI = "file://chassis.yaml"
+
+do_install() {
+ install -D chassis.yaml ${D}${base_datadir}/events.d/chassis.yaml
+}
+
+FILES_${PN} += "${base_datadir}/events.d/chassis.yaml"
diff --git a/meta-fp5280g2/recipes-phosphor/inventory/phosphor-inventory-manager-chassis/chassis.yaml b/meta-fp5280g2/recipes-phosphor/inventory/phosphor-inventory-manager-chassis/chassis.yaml
new file mode 100644
index 0000000..b5c548e
--- /dev/null
+++ b/meta-fp5280g2/recipes-phosphor/inventory/phosphor-inventory-manager-chassis/chassis.yaml
@@ -0,0 +1,13 @@
+events:
+ - name: Add Chassis interface
+ description: >
+ Add the chassis interface on the chassis inventory path
+ type: startup
+ actions:
+ - name: createObjects
+ objs:
+ /system/chassis:
+ xyz.openbmc_project.Inventory.Item.Chassis:
+ Type:
+ value: "RackMount"
+ type: string
diff --git a/meta-fp5280g2/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend b/meta-fp5280g2/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend
index 6f8a60e..e420667 100644
--- a/meta-fp5280g2/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend
+++ b/meta-fp5280g2/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend
@@ -2,6 +2,8 @@
PACKAGECONFIG_append = " associations"
SRC_URI_append = " file://associations.json"
+DEPENDS_append_fp5280g2 = " phosphor-inventory-manager-chassis"
+
do_install_append() {
install -d ${D}${base_datadir}
install -m 0755 ${WORKDIR}/associations.json ${D}${base_datadir}/associations.json