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_options.txt b/meson_options.txt
index f198832..9c094c7 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -4,3 +4,5 @@
 option('PROP_YAML',type: 'string', value: 'extra-properties-example.yaml',  description: 'YAML PROPERTY')
 option('ibm-parser', type: 'feature', description: 'ENABLE IBM PARSER')
 option('INVENTORY_JSON',type: 'string', value: '/usr/share/vpd/vpd_inventory.json',  description: 'JSON file that defines inventory blueprint')
+option('INVENTORY_PATH',type: 'string', value: '/xyz/openbmc_project/inventory', description: 'Prefix for inventory D-Bus objects')
+option('INVENTORY_MANAGER_SERVICE',type: 'string', value: 'xyz.openbmc_project.Inventory.Manager', description: 'Inventory manager service')