Do not populate presence if handlePresence=false
This commit is to skip populating Present property for those frus whose
handlePresence is made false explicitly in VPD JSON.
This is required in cases where the FRU has its own VPD, yet its
presence gets handled by other application and not by VPD parser app.
Test:
Test works as expected.
To note:
phosphor-fan-monitor identifies and sets the fan presence before
collecting system VPD. Journal log be like,
Feb 14 12:54:08 ever6bmc phosphor-fan-monitor[601]: Fan /system/chassis/motherboard/fan0 presence state change to true
Feb 14 12:54:09 ever6bmc systemd[1]: Finished Wait for /xyz/openbmc_project/led/groups/bmc_booted.
Feb 14 12:54:09 ever6bmc phosphor-psu-monitor[604]: Binding device driver. path: /sys/bus/i2c/drivers/ibm-cffps/bind device: 3-006b
Feb 14 12:54:09 ever6bmc phosphor-psu-monitor[604]: Failed binding or unbinding device. errno=16
Feb 14 12:54:09 ever6bmc phosphor-psu-monitor[604]: Updating inventory present property. present:true invpath:/system/chassis/motherboard/powersupply3 name:powersupply3
Feb 14 12:54:09 ever6bmc systemd[1]: Starting Wait for /xyz/openbmc_project/led/groups...
Feb 14 12:54:09 ever6bmc systemd[1]: Starting Set the Asserted property of all the LED groups to false...
Feb 14 12:54:09 ever6bmc systemd[1]: Starting Update BIOS attr table with host firmware well-known names...
Feb 14 12:54:09 ever6bmc systemd[1]: Started Network IPMI daemon.
Feb 14 12:54:09 ever6bmc systemd[1]: Started Network IPMI daemon.
Feb 14 12:54:09 ever6bmc systemd[1]: Starting System VPD Collection...
Tested in the above mentioned scenario:
-> busctl set-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/
inventory/system/chassis/motherboard/fan0 xyz.openbmc_project.Inventory.Item
Present b false
->busctl introspect xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
xyz.openbmc_project.Inventory.Item interface - - -
.Present property b false emits-change writable
.PrettyName property s "fan0"
-> busctl set-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/
inventory/system/chassis/motherboard xyz.openbmc_project.Inventory.Item Present b false
->systemctl restart system-vpd.service
Result:
busctl introspect xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
xyz.openbmc_project.Inventory.Item interface - - -
.Present property b false emits-change writable
.PrettyName property s "fan0"
Signed-off-by: Priyanga Ramasamy <priyanga24@in.ibm.com>
Change-Id: I775380792b0f031efdff8c42e236b822ba3c2b45
diff --git a/ibm_vpd/fru/50003000_v2.json b/ibm_vpd/fru/50003000_v2.json
index 59e36da..0c4bfd1 100644
--- a/ibm_vpd/fru/50003000_v2.json
+++ b/ibm_vpd/fru/50003000_v2.json
@@ -2440,6 +2440,7 @@
"devAddress": "31-0050",
"driverType": "at24",
"busType": "i2c",
+ "handlePresence": false,
"concurrentlyMaintainable": true,
"extraInterfaces": {
"xyz.openbmc_project.Inventory.Item.Fan": null,
@@ -2455,6 +2456,7 @@
"devAddress": "32-0050",
"driverType": "at24",
"busType": "i2c",
+ "handlePresence": false,
"concurrentlyMaintainable": true,
"extraInterfaces": {
"xyz.openbmc_project.Inventory.Item.Fan": null,
@@ -2470,6 +2472,7 @@
"devAddress": "33-0050",
"driverType": "at24",
"busType": "i2c",
+ "handlePresence": false,
"concurrentlyMaintainable": true,
"extraInterfaces": {
"xyz.openbmc_project.Inventory.Item.Fan": null,
@@ -2485,6 +2488,7 @@
"devAddress": "34-0050",
"driverType": "at24",
"busType": "i2c",
+ "handlePresence": false,
"concurrentlyMaintainable": true,
"extraInterfaces": {
"xyz.openbmc_project.Inventory.Item.Fan": null,