1# compare_vpd
2
3## Description
4Compares a VPD (Vital Product Data) keyword value to an expected value.
5
6VPD is information that describes a hardware component.  VPD is typically read
7from an EEPROM on a Field-Replaceable Unit (FRU).  For this reason, VPD is also
8called "FRU data".
9
10The following VPD keywords are currently supported:
11* CCIN
12* Manufacturer
13* Model
14* PartNumber
15* HW
16
17This action can be used in an [if](if.md) condition to execute actions based on
18a VPD keyword value.  For example, you could set the output voltage only for
19regulators with a specific Model number.
20
21## Properties
22| Name | Required | Type | Description |
23| :--- | :------: | :--- | :---------- |
24| fru | yes | string | Field-Replaceable Unit (FRU) that contains the VPD.  Specify the relative D-Bus inventory path of the FRU.  Full inventory paths begin with the root "/xyz/openbmc_project/inventory".  Specify the relative path below the root, such as "system/chassis/disk_backplane". |
25| keyword | yes | string | VPD keyword.  Specify one of the following: "CCIN", "Manufacturer", "Model", "PartNumber", "HW". |
26| value | see [notes](#notes) | string | Expected value. |
27| byte\_values | see [notes](#notes) | array of strings | One or more expected byte values expressed in hexadecimal.  Each value must be prefixed with 0x and surrounded by double quotes. |
28
29### Notes
30* You must specify either "value" or "byte_values".
31
32## Return Value
33Returns true if the keyword value equals the expected value, otherwise returns
34false.
35
36## Examples
37```
38{
39  "comments": [ "Check if disk backplane has CCIN value 2D35" ],
40  "compare_vpd": {
41    "fru": "system/chassis/disk_backplane",
42    "keyword": "CCIN",
43    "value": "2D35"
44  }
45}
46```
47```
48{
49  "comments": [ "Check if disk backplane has CCIN value 0x32, 0x44, 0x33, 0x35" ],
50  "compare_vpd": {
51    "fru": "system/chassis/disk_backplane",
52    "keyword": "CCIN",
53    "byte_values": [ "0x32", "0x44", "0x33", "0x35" ]
54  }
55}
56```
57