VPD tool : dumpInventory & dumpObject
VPD tool has four options.
a) Dump Complete Inventory - no additional arguments are needed.
b) Dump Specific Object - by providing the object name.
c) Read the keyword - by providing the object name, record name and keyword to be read.
d) Write/Update the keyword - by providing the object name, record name, keyword and the value to be updated.
{value - in ascii or hex & all the other arguments in string}
"--help" option provides details on how to use the above mentioned options.
This commit has implementation of dump inventory and dump specific object.
Output:
---------Dump Inventory---------
Not displaying the complete output.
root@rainier:/tmp# ./vpd-tool -i
[
{
"/system": {
"LocationCode": "U9105.22A.SIMP10R",
"Model": "9105-22A",
"SerialNumber": "SIMP10R",
"type": "xyz.openbmc_project.Inventory.Item.System"
},
"/system/chassis": {
"LocationCode": "U78DA.ND1.1234567",
"type": "xyz.openbmc_project.Inventory.Item.Chassis"
},
.
.
.
.
and so on..
]
---------Dump Object----------
root@rainier:/tmp# ./vpd-tool -o -O /system/chassis/motherboard/ebmc_card_bmc
[
{
"/system/chassis/motherboard/ebmc_card_bmc": {
"CC": "6B58",
"DR": "EBMC ",
"FN": "F191014",
"LocationCode": "U78DA.ND1.1234567-P0-C5",
"PN": "PN12345",
"SN": "YL6B58010000",
"type": "xyz.openbmc_project.Inventory.Item.Bmc"
}
}
]
Flag to enable VPD tool:
There is no seperate flag for VPD tool.
ibm-parser flag will generate the vpd-tool binary.
Steps to build and generate the executable using meson:
meson -Denabled=ibm-parser build
ninja -C build
Test:
Tested on simics.
Signed-off-by: PriyangaRamasamy <priyanga24@in.ibm.com>
Change-Id: I712f7ad4303eefa68f232685b6b0e53646f859f5
diff --git a/meson.build b/meson.build
index 8d95281..ac6ba29 100644
--- a/meson.build
+++ b/meson.build
@@ -3,7 +3,7 @@
'c',
'cpp',
default_options: [
- 'cpp_std=c++17'
+ 'cpp_std=c++17'
],
version: '1.0'
)
@@ -22,8 +22,10 @@
configure_file(output: 'config.h',
configuration :{
'INVENTORY_JSON': '"'+get_option('INVENTORY_JSON')+'"',
+ 'INVENTORY_PATH': '"'+get_option('INVENTORY_PATH')+'"',
+ 'INVENTORY_MANAGER_SERVICE': '"'+get_option('INVENTORY_MANAGER_SERVICE')+'"'
}
- )
+ )
ibm_read_vpd_SOURCES = ['ibm_vpd_app.cpp',
'ibm_vpd_type_check.cpp',
'parser.cpp',
@@ -44,6 +46,19 @@
install: true,
cpp_args : '-DIPZ_PARSER'
)
+
+ vpd_tool_SOURCES = ['vpd_tool.cpp',
+ 'vpd_tool_impl.cpp'
+ ]
+
+ vpd_tool_exe = executable(
+ 'vpd-tool',
+ vpd_tool_SOURCES,
+ dependencies: [
+ sdbusplus
+ ],
+ install: true,
+ )
else
FRUGEN = '$srcdir/extra-properties.py -e' + get_option('FRU_YAML')
PROPGEN = '$srcdir/extra-properties.py -e' + get_option('PROP_YAML')