summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRatan Gupta <ratagupt@in.ibm.com>2018-01-19 16:23:10 +0530
committerRatan Gupta <ratagupt@in.ibm.com>2018-02-12 14:24:33 +0530
commit003309731e2e1dbf22b85d8691357177747846f4 (patch)
treeafafbca763f0dbbc4fdc1f244ea90da06c1ef27b /scripts
parentd211702b0c149fc548825f1d1066eb8c73993377 (diff)
downloadphosphor-host-ipmid-003309731e2e1dbf22b85d8691357177747846f4.zip
phosphor-host-ipmid-003309731e2e1dbf22b85d8691357177747846f4.tar.gz
Inventory:- making changes in the mako and the C++ structure
As fru yaml would be having extra properties like entityID,entityInstance so changes were needed to make the change in the corresponding c++ structure. Change-Id: I314d1556cf07a3e212996615c1cd2f28fb6d9bba Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/fru-read-example.yaml219
-rw-r--r--scripts/readfru.mako.cpp13
2 files changed, 126 insertions, 106 deletions
diff --git a/scripts/fru-read-example.yaml b/scripts/fru-read-example.yaml
index 86151af..41e1598 100644
--- a/scripts/fru-read-example.yaml
+++ b/scripts/fru-read-example.yaml
@@ -12,113 +12,128 @@
# IPMI Fru mapping
0:
/system:
- xyz.openbmc_project.Inventory.Item:
- PrettyName:
- IPMIFruProperty: Product Name
- IPMIFruSection: Product
- xyz.openbmc_project.Inventory.Decorator.Asset:
- Manufacturer:
- IPMIFruProperty: Manufacturer
- IPMIFruSection: Product
- PartNumber:
- IPMIFruProperty: Part Number
- IPMIFruSection: Product
- SerialNumber:
- IPMIFruProperty: Serial Number
- IPMIFruSection: Product
- BuildDate:
- IPMIFruProperty: Mfg Date
- IPMIFruSection: Product
- xyz.openbmc_project.Inventory.Decorator.Revision:
- Version:
- IPMIFruProperty: Version
- IPMIFruSection: Product
- xyz.openbmc_project.Inventory.Item.System:
+ entityID: 23
+ entityInstance: 1
+ interfaces:
+ xyz.openbmc_project.Inventory.Item:
+ PrettyName:
+ IPMIFruProperty: Product Name
+ IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Decorator.Asset:
+ Manufacturer:
+ IPMIFruProperty: Manufacturer
+ IPMIFruSection: Product
+ PartNumber:
+ IPMIFruProperty: Part Number
+ IPMIFruSection: Product
+ SerialNumber:
+ IPMIFruProperty: Serial Number
+ IPMIFruSection: Product
+ BuildDate:
+ IPMIFruProperty: Mfg Date
+ IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Decorator.Revision:
+ Version:
+ IPMIFruProperty: Version
+ IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Item.System:
1:
/system/chassis/motherboard/dimm0:
- xyz.openbmc_project.Inventory.Item:
- PrettyName:
- IPMIFruProperty: Product Name
- IPMIFruSection: Product
- xyz.openbmc_project.Inventory.Decorator.Asset:
- Manufacturer:
- IPMIFruProperty: Manufacturer
- IPMIFruSection: Product
- BuildDate:
- IPMIFruProperty: Mfg Date
- IPMIFruSection: Product
- SerialNumber:
- IPMIFruProperty: Serial Number
- IPMIFruSection: Product
- PartNumber:
- IPMIFruProperty: Part Number
- IPMIFruSection: Product
- xyz.openbmc_project.Inventory.Decorator.Revision:
- Version:
- IPMIFruProperty: Version
- IPMIFruSection: Product
- xyz.openbmc_project.Inventory.Item.Dimm:
+ entityID: 32
+ entityInstance: 1
+ interfaces:
+ xyz.openbmc_project.Inventory.Item:
+ PrettyName:
+ IPMIFruProperty: Product Name
+ IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Decorator.Asset:
+ Manufacturer:
+ IPMIFruProperty: Manufacturer
+ IPMIFruSection: Product
+ BuildDate:
+ IPMIFruProperty: Mfg Date
+ IPMIFruSection: Product
+ SerialNumber:
+ IPMIFruProperty: Serial Number
+ IPMIFruSection: Product
+ PartNumber:
+ IPMIFruProperty: Part Number
+ IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Decorator.Revision:
+ Version:
+ IPMIFruProperty: Version
+ IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Item.Dimm:
2:
/system/chassis/motherboard/dimm1:
- xyz.openbmc_project.Inventory.Item:
- PrettyName:
- IPMIFruProperty: Product Name
- IPMIFruSection: Product
- xyz.openbmc_project.Inventory.Decorator.Asset:
- Manufacturer:
- IPMIFruProperty: Manufacturer
- IPMIFruSection: Product
- BuildDate:
- IPMIFruProperty: Mfg Date
- IPMIFruSection: Product
- SerialNumber:
- IPMIFruProperty: Serial Number
- IPMIFruSection: Product
- PartNumber:
- IPMIFruProperty: Part Number
- IPMIFruSection: Product
- xyz.openbmc_project.Inventory.Decorator.Revision:
- Version:
- IPMIFruProperty: Version
- IPMIFruSection: Product
- xyz.openbmc_project.Inventory.Item.Dimm:
+ entityID: 32
+ entityInstance: 2
+ interfaces:
+ xyz.openbmc_project.Inventory.Item:
+ PrettyName:
+ IPMIFruProperty: Product Name
+ IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Decorator.Asset:
+ Manufacturer:
+ IPMIFruProperty: Manufacturer
+ IPMIFruSection: Product
+ BuildDate:
+ IPMIFruProperty: Mfg Date
+ IPMIFruSection: Product
+ SerialNumber:
+ IPMIFruProperty: Serial Number
+ IPMIFruSection: Product
+ PartNumber:
+ IPMIFruProperty: Part Number
+ IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Decorator.Revision:
+ Version:
+ IPMIFruProperty: Version
+ IPMIFruSection: Product
+ xyz.openbmc_project.Inventory.Item.Dimm:
3:
/system/chassis/motherboard/cpu0:
- xyz.openbmc_project.Inventory.Item:
- PrettyName:
- IPMIFruProperty: Product Name
- IPMIFruSection: Board
- xyz.openbmc_project.Inventory.Decorator.Asset:
- BuildDate:
- IPMIFruProperty: Mfg Date
- IPMIFruSection: Board
- SerialNumber:
- IPMIFruProperty: Serial Number
- IPMIFruSection: Board
- PartNumber:
- IPMIFruProperty: Part Number
- IPMIFruSection: Board
- Manufacturer:
- IPMIFruProperty: Manufacturer
- IPMIFruSection: Board
- xyz.openbmc_project.Inventory.Item.Cpu:
+ entityID: 3
+ entityInstance: 1
+ interfaces:
+ xyz.openbmc_project.Inventory.Item:
+ PrettyName:
+ IPMIFruProperty: Product Name
+ IPMIFruSection: Board
+ xyz.openbmc_project.Inventory.Decorator.Asset:
+ BuildDate:
+ IPMIFruProperty: Mfg Date
+ IPMIFruSection: Board
+ SerialNumber:
+ IPMIFruProperty: Serial Number
+ IPMIFruSection: Board
+ PartNumber:
+ IPMIFruProperty: Part Number
+ IPMIFruSection: Board
+ Manufacturer:
+ IPMIFruProperty: Manufacturer
+ IPMIFruSection: Board
+ xyz.openbmc_project.Inventory.Item.Cpu:
4:
/system/chassis/motherboard/cpu1:
- xyz.openbmc_project.Inventory.Item:
- PrettyName:
- IPMIFruProperty: Product Name
- IPMIFruSection: Board
- xyz.openbmc_project.Inventory.Decorator.Asset:
- BuildDate:
- IPMIFruProperty: Mfg Date
- IPMIFruSection: Board
- SerialNumber:
- IPMIFruProperty: Serial Number
- IPMIFruSection: Board
- PartNumber:
- IPMIFruProperty: Part Number
- IPMIFruSection: Board
- Manufacturer:
- IPMIFruProperty: Manufacturer
- IPMIFruSection: Board
- xyz.openbmc_project.Inventory.Item.Cpu:
+ entityID: 3
+ entityInstance: 2
+ interfaces:
+ xyz.openbmc_project.Inventory.Item:
+ PrettyName:
+ IPMIFruProperty: Product Name
+ IPMIFruSection: Board
+ xyz.openbmc_project.Inventory.Decorator.Asset:
+ BuildDate:
+ IPMIFruProperty: Mfg Date
+ IPMIFruSection: Board
+ SerialNumber:
+ IPMIFruProperty: Serial Number
+ IPMIFruSection: Board
+ PartNumber:
+ IPMIFruProperty: Part Number
+ IPMIFruSection: Board
+ Manufacturer:
+ IPMIFruProperty: Manufacturer
+ IPMIFruSection: Board
+ xyz.openbmc_project.Inventory.Item.Cpu:
diff --git a/scripts/readfru.mako.cpp b/scripts/readfru.mako.cpp
index 061b4e0..57265be 100644
--- a/scripts/readfru.mako.cpp
+++ b/scripts/readfru.mako.cpp
@@ -6,17 +6,22 @@ extern const FruMap frus = {
% for key in fruDict.keys():
{${key},{
<%
- fru = fruDict[key]
+ instanceList = fruDict[key]
%>
- % for object,interfaces in fru.items():
- {"${object}",{
+ % for instancePath,instanceInfo in instanceList.items():
+<%
+ entityID = instanceInfo["entityID"]
+ entityInstance = instanceInfo["entityInstance"]
+ interfaces = instanceInfo["interfaces"]
+%>
+ {${entityID}, ${entityInstance}, "${instancePath}",{
% for interface,properties in interfaces.items():
{"${interface}",{
% if properties:
% for dbus_property,property_value in properties.items():
{"${dbus_property}",{
"${property_value.get("IPMIFruSection", "")}",
- "${property_value.get("IPMIFruProperty", "")}", \
+ "${property_value.get("IPMIFruProperty", "")}",\
<%
delimiter = property_value.get("IPMIFruValueDelimiter")
if not delimiter:
OpenPOWER on IntegriCloud