Update keyword’s value in backup and restore PEL

PELs related to backup and restore are not showing correct
representation of source and destination keyword’s value, as some of
the keywords may have nonprintable characters.

To solve this issue, keyword’s value is shown in hexadecimal
representation while creating PELs.

Test Output:
PEL logged for VPD mismatch
```
root@p10bmcnewtest:~# peltool -i 0x5000188A
{
"Private Header": {
    "Section Version":          "1",
    "Sub-section type":         "0",
    "Created by":               "bmc vpd",
    "Created at":               "04/11/2025 11:15:54",
    "Committed at":             "04/11/2025 11:15:54",
    "Creator Subsystem":        "BMC",
    "CSSVER":                   "",
    "Platform Log Id":          "0x5000188A",
    "Entry Id":                 "0x5000188A",
    "BMC Event Log Id":         "88"
},
"User Header": {
    "Section Version":          "1",
    "Sub-section type":         "0",
    "Log Committed by":         "bmc error logging",
    "Subsystem":                "CEC Hardware - VPD Interface",
    "Event Scope":              "Entire Platform",
    "Event Severity":           "Predictive Error",
    "Event Type":               "Not Applicable",
    "Action Flags": [
                                "Service Action Required",
                                "Report Externally",
                                "HMC Call Home"
    ],
    "Host Transmission":        "Not Sent",
    "HMC Transmission":         "Not Sent"
},
"Primary SRC": {
    "Section Version":          "1",
    "Sub-section type":         "1",
    "Created by":               "bmc vpd",
    "SRC Version":              "0x02",
    "SRC Format":               "0x55",
    "Virtual Progress SRC":     "False",
    "I5/OS Service Event Bit":  "False",
    "Hypervisor Dump Initiated":"False",
    "Backplane CCIN":           "2E2D",
    "Terminate FW Error":       "False",
    "Deconfigured":             "False",
    "Guarded":                  "False",
    "Error Details": {
        "Message":              "Error occurred due to VPD mismatch between primary and backup."
    },
    "Valid Word Count":         "0x09",
    "Reference Code":           "BD554008",
    "Hex Word 2":               "00000055",
    "Hex Word 3":               "2E2D0010",
    "Hex Word 4":               "00000000",
    "Hex Word 5":               "00000000",
    "Hex Word 6":               "00000000",
    "Hex Word 7":               "00000000",
    "Hex Word 8":               "00000000",
    "Hex Word 9":               "00000000",
    "Callout Section": {
        "Callout Count":        "1",
        "Callouts": [{
            "FRU Type":         "Maintenance Procedure Required",
            "Priority":         "Mandatory, replace all with this type as a unit",
            "Procedure":        "BMC0007"
        }]
    }
},
"Extended User Header": {
    "Section Version":          "1",
    "Sub-section type":         "0",
    "Created by":               "bmc error logging",
    "Reporting Machine Type":   "9105-22B",
    "Reporting Serial Number":  "139F210",
    "FW Released Ver":          "",
    "FW SubSys Version":        "fw1110.00-3.83",
    "Common Ref Time":          "00/00/0000 00:00:00",
    "Symptom Id Len":           "20",
    "Symptom Id":               "BD554008_2E2D0010"
},
"Failing MTMS": {
    "Section Version":          "1",
    "Sub-section type":         "0",
    "Created by":               "bmc error logging",
    "Machine Type Model":       "9105-22B",
    "Serial Number":            "139F210"
},
"User Data 0": {
    "Section Version": "1",
    "Sub-section type": "1",
    "Created by": "bmc error logging",
    "BMCLoad": "1.36 0.94 0.73",
    "BMCState": "Ready",
    "BMCUptime": "0y 0d 1h 7m 50s",
    "BootState": "Unspecified",
    "ChassisState": "Off",
    "FW Version ID": "fw1110.00-3.83-2-g593537a90a-dirty",
    "HostState": "Off",
    "System IM": "50001001"
},
"User Data 1": {
    "Section Version": "1",
    "Sub-section type": "1",
    "Created by": "bmc error logging",
    "DESCRIPTION": "Mismatch found between source and destination VPD for record : LXR0 and keyword : LX . Value read from source : 0x3100040100300071 . Value read from destination : 0x3300040100300071",
    "FileName": "/usr/src/debug/openpower-fru-vpd/1.0+git/vpd-manager/src/backup_restore.cpp",
    "FunctionName": "backupAndRestoreIpzVpd",
    "InteranlRc": "0",
    "UserData1": "",
    "UserData2": ""
}
}
```

Change-Id: Ie99f9758071ab07e6b992c66bee58571a6672ac0
Signed-off-by: Anupama B R <anupama.b.r1@ibm.com>
2 files changed
tree: 622525bf12c1f3c75450787baba2a8b927131c58
  1. configuration/
  2. docs/
  3. scripts/
  4. service_files/
  5. test/
  6. vpd-manager/
  7. vpd-tool/
  8. vpdecc/
  9. .clang-format
  10. .gitignore
  11. LICENSE
  12. meson.build
  13. meson.options
  14. OWNERS
  15. README.md
README.md

Overview

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:

OpenPower VPD Parser

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 supported records and keywords.
  • How VPD data is translated into D-Bus interfaces and properties.

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.

IBM VPD Parser

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:

  • It parses all the records and keywords from the VPD, including large keywords (Keywords that begin with a # and are > 255 bytes in length).
  • It relies on a runtime JSON configuration (see examples/inventory.json) to determine the D-Bus object path(s) that hold interfaces and properties representing the VPD for a given VPD file path.

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.

TODOs and Future Improvements

  1. The long-term goal is to completely do away with the build time YAML driven configurations and instead reconcile the OpenPower VPD parser and the IBM VPD parser applications into a single runtime JSON driven application.
  2. Add details to the README on how to configure and build the application.
  3. More JSON documentation.
  4. Support for more IBM VPD formats.
  5. VPD Write and tool documentation.