commit | 951d6609e458fbdd2c28cccd1bd6c99741f04f74 | [log] [tgz] |
---|---|---|
author | Anupama B R <anupama.b.r1@ibm.com> | Sat Jan 18 09:52:33 2025 -0600 |
committer | Jinu Joy Thomas <jinu.joy.thomas@in.ibm.com> | Tue Feb 11 04:30:55 2025 +0000 |
tree | 08f93feac08bc20fc77cf0b353fa83798488bd50 | |
parent | 1f4c8f8123c0c08635367d2b279cef4fed3116b2 [diff] |
Take input from file for write keyword This commit adds code to read keyword’s value from the local file to update keyword’s value. User can provide file path where the value exists using --file option. Output: ``` Write keyword using object path (both primary and backup path VPD gets updated) Before update: root@p10bmc:/tmp# ./vpd-tool -O /system/chassis/motherboard -R VSYS -K BR -r { "/system/chassis/motherboard": { "BR": "S0" } } root@p10bmc:/tmp# ./vpd-tool -O /sys/bus/i2c/drivers/at24/8-0050/eeprom -R VSYS -K BR -r -H { "/sys/bus/i2c/drivers/at24/8-0050/eeprom": { "BR": "S0" } } Input file (In ASCII format): root@p10bmc:/tmp# cat input.txt A2 Update keyword command: root@p10bmc:/tmp# ./vpd-tool -O /system/chassis/motherboard -R VSYS -K BR -w --file input.txt Data updated successfully After update: root@p10bmc:/tmp# ./vpd-tool -O /system/chassis/motherboard -R VSYS -K BR -r { "/system/chassis/motherboard": { "BR": "A2" } } root@p10bmc:/tmp# ./vpd-tool -O /sys/bus/i2c/drivers/at24/8-0050/eeprom -R VSYS -K BR -r -H { "/sys/bus/i2c/drivers/at24/8-0050/eeprom": { "BR": "A2" } } Write keyword using hardware path (updates only given hardware path): Input file (In hexadecimal format): root@p10bmc:/tmp# cat input.txt 0x5330 Update keyword command: root@p10bmc:/tmp# ./vpd-tool -O /sys/bus/i2c/drivers/at24/8-0050/eeprom -R VSYS -K BR -w -H --file input.txt Data updated successfully After update: root@p10bmc:/tmp# ./vpd-tool -O /system/chassis/motherboard -R VSYS -K BR -r { "/system/chassis/motherboard": { "BR": "A2" } } root@p10bmc:/tmp# ./vpd-tool -O /sys/bus/i2c/drivers/at24/8-0050/eeprom -R VSYS -K BR -r -H { "/sys/bus/i2c/drivers/at24/8-0050/eeprom": { "BR": "S0" } } ``` Change-Id: I762dceae351ab2f9a1989b664a424cda4470dd1d Signed-off-by: Anupama B R <anupama.b.r1@ibm.com>
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.