Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vpd-tool: Dump Inventory in Table format #559

Draft
wants to merge 4 commits into
base: 1110
Choose a base branch
from

Conversation

souvik1914581
Copy link

This commit implements vpd-tool --dumpInventory option in tabular format
The properties of FRUs published in PIM are printed in the form of a 2D
table to console, with each row representing a FRU.
If the "Present" property of a FRU is false, no row is created for that
FRU.

The properties which are printed are:
1. Object Path
2. Pretty Name, Location Code, SubModel
3. SN, PN, CC, FN, DR keywords under VINI record

@souvik1914581 souvik1914581 marked this pull request as draft January 3, 2025 11:59
@souvik1914581 souvik1914581 force-pushed the sr_vpdToolDumpInventoryTable branch 4 times, most recently from 0626569 to 222010a Compare January 7, 2025 12:34
Souvik Roy added 4 commits January 9, 2025 03:21
This commit implements object dump functionality in vpd-tool.
For a given Object path, the object dump functionality prints the
following properties in JSON format to the console:
1. Pretty Name, Location Code, Sub Model
2. SN, PN, CC, FN, DR keywords under VINI record

The above properties are dumped to console only if the FRU's Present
property is true, otherwise "FRU <object path> is not present in the
system is printed on console.

Test:

Tested on a rainier2s2u system
'''
root@p10bmc:~# ./vpd-tool -o -O \
/xyz/openbmc_project/inventory/system/chassis/motherboard
    [
        {
            "/xyz/openbmc_project/inventory/system/
             chassis/motherboard": {
                "CC": "2E2D",
                "DR": "SYSTEM BACKPLANE",
                "FN": "02WG676",
                "LocationCode": "U78DA.ND0.WZS0042-P0",
                "PN": "02WG678",
                "PrettyName": "System backplane",
                "SN": "Y131UF07302T"
                "type":
                "xyz.openbmc_project.Inventory.Item.Board.Motherboard"
            }
        }
    ]

    root@p10bmc:~# ./vpd-tool -o -O \
    /xyz/openbmc_project/inventory/system/chassis/motherboard/vdd_vrm0
    [
        {
            "/xyz/openbmc_project/inventory/
            system/chassis/motherboard/vdd_vrm0": {
                "CC": "2E32",
                "DR": "CPU POWER CARD  ",
                "FN": "02CM285",
                "LocationCode": "U78DA.ND0.WZS0042-P0-C14",
                "PN": "02CM286",
                "PrettyName": "Voltage regulator module for
                    system processor module 0",
                "SN": "YH30A005M11C"
		"type":
		"xyz.openbmc_project.Inventory.Item.Vrm"
            }
        }
    ]

    root@rain104bmctest:~# ./vpd-tool -o -O "InvalidObjectPath"
    root@rain104bmctest:~# echo $?
    255

    ./vpd-tool -o -O
    /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0
    FRU /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0
    is not present in the system

    '''

Change-Id: Ie4f5ad137d6aad53ad72a312e8542accccf98e6b
Signed-off-by: Souvik Roy <souvik.roy10@ibm.com>
This commit adds --dumpInventory option in vpd-tool. This commit just
lets the user select --dumpInventory option. This commit does not
include  actual implementation of --dumpInventory.

Change-Id: I6885281684b8d193ae6d246b817289071d36767c
Signed-off-by: Souvik Roy <souvik.roy10@ibm.com>
This commit implements --dumpInventory option in vpd-tool.
--dumpInventory option dumps specific properties of all the objects in
Phosphor Inventory Manager DBus tree to console in JSON format to
console.For each object, the following properties are dumped to console:
- Pretty Name, Location Code, Sub Model
- SN, PN, CC, FN, DR keywords under VINI record
If the "Present" property of a FRU is false, the FRU is not dumped to
console.

Note: Dump Inventory in tabular format is a TODO.

Change-Id: Id3ab24e2a51ba4fed586f0fb251a67443b9c7c6d
Signed-off-by: Souvik Roy <souvik.roy10@ibm.com>
This commit implements vpd-tool --dumpInventory option in tabular format
The properties of  FRUs published in PIM are printed in the form of a
table to console, with each row representing a FRU.
If the "Present" property of a FRU is false, no row is created for that
FRU.

The properties which are printed are:
1. Object Path
2. Pretty Name, Location Code, SubModel
3. SN, PN, CC, FN, DR keywords under VINI record

Note: Those FRUs which have object path ending in "unit[0-9]" are not
printed to console.

Test:

```
Tested on Rainier2S2U and Everest systems.
 ```

Change-Id: I0f0eef8d58bf321c01344cd3e89b487755d0be35
Signed-off-by: Souvik Roy <souvik.roy10@ibm.com>
@souvik1914581 souvik1914581 force-pushed the sr_vpdToolDumpInventoryTable branch from 222010a to 99ba840 Compare January 9, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant