| commit | c9ecf8eabe11a1f8766c0e043d94c76ad00c0551 | [log] [tgz] |
|---|---|---|
| author | Priyanga Ramasamy <priyanga24@in.ibm.com> | Fri Oct 08 02:28:52 2021 -0500 |
| committer | Santosh Puranik <santosh.puranik@in.ibm.com> | Fri Nov 26 12:43:09 2021 +0000 |
| tree | 9df11fcde8f095446a38147faa9cad8e87a269e3 | |
| parent | 0243493148100bb98527ce82f5c929f071aec999 [diff] |
VpdTool:Treat NULL char at the end as a terminator
If there is a non-printable null character at the end or if
there are many non printable null characters towards the end of
the buffer, vpd-tool treats null char(s) as a null terminator
and displays the bytes in ascii format.
vpd-tool displays the vector data in hex if,
- If there are any other non printable character(s) except null.
- If the non printable null character(s) is at the middle of the
buffer.
Test:
Tested on rainier
-> vpd-tool output before emplacing this logic:(displays SN in hex)
(where SN has only one non printable NULL at the end)
root@rain135bmc:/tmp# vpd-tool -o -O /system/chassis/motherboard/powersupply3
[
{
"/system/chassis/motherboard/powersupply3": {
"CC": "2B1E",
"DR": "IBM PS",
"FN": "03FP302",
"LocationCode": "U78DB.ND0.WZS000G-E3",
"PN": "03FP301",
"SN": "0x594c31304b593038434b364b00",
"TYPE": "FRU",
"type": "xyz.openbmc_project.Inventory.Item.PowerSupply"
}
}
]
-> vpd-tool output after emplacing this logic:(displays SN in string format)
(by treating end NULL char as NULL terminator)
root@rain135bmc:/tmp# ./vpd-tool -o -O "/system/chassis/motherboard/powersupply3"
[
{
"/system/chassis/motherboard/powersupply3": {
"CC": "2B1E",
"DR": "IBM PS",
"FN": "03FP302",
"LocationCode": "U78DB.ND0.WZS000G-E3",
"PN": "03FP301",
"SN": "YL10KY08CK6K",
"TYPE": "FRU",
"type": "xyz.openbmc_project.Inventory.Item.PowerSupply"
}
}
]
Signed-off-by: Priyanga Ramasamy <priyanga24@in.ibm.com>
Change-Id: I4fb073c49ed3cad117e8dbd0d4da54dcb35f0dc2
This repository hosts code for OpenPower and IBM IPZ format VPD parsers. Both OpenPower VPD and IPZ VPD formats are structured binaries that consist of records and keywords. A record is a collection of multiple keywords. More information about the format can be found here.
The repository consists of two distinct applications, which are:
This is a build-time YAML driven application that parses the OpenPower VPD format and uses the YAML configuration (see extra-properties-example.yaml and writefru.yaml) to determine:
The application instance must be passed in the file path to the VPD (this can, for example, be a sysfs path exposed by the EEPROM device driver) and also the D-Bus object path(s) that EEPROM data needs to be published under.
This parser is can be built by passing in the --enable-ibm-parser configure option. This parser differs from the OpenPower VPD parser in the following ways:
# and are > 255 bytes in length).Making the application runtime JSON driven allows us to support multiple systems (with different FRU configurations) to be supported in a single code image as well as making the application more flexible for future improvements.