commit | a169b0f9d2d5114729e149c158d518176556b892 | [log] [tgz] |
---|---|---|
author | Brandon Wyman <bjwyman@gmail.com> | Tue Dec 07 20:18:06 2021 +0000 |
committer | Shawn McCarney <shawnmm@us.ibm.com> | Fri Dec 10 17:22:12 2021 +0000 |
tree | 9647d6fed96ebb73e7111e95c3084595dd1b14e4 | |
parent | 56ae78e10b40a21ada14fa1a666931646c004423 [diff] |
psu-ng: IBM FN goes to SparePartNumber When reading the IBM FN (FRU_NUMBER), add it to the SparePartNumber asset properties in the D-Bus inventory. Tested: root@p10bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager \ > /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0 \ > xyz.openbmc_project.Inventory.Decorator.Asset \ > PartNumber s "3FP210" root@p10bmc:~# root@p10bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager \ > /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1 \ > xyz.openbmc_project.Inventory.Decorator.Asset \ > PartNumber s "3FP210" root@p10bmc:~# root@p10bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager \ > /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0 \ > xyz.openbmc_project.Inventory.Decorator.Asset \ > SparePartNumber s "" root@p10bmc:~# root@p10bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager \ > /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1 \ > xyz.openbmc_project.Inventory.Decorator.Asset \ > SparePartNumber s "" root@p10bmc:~# root@p10bmc:~# # patch needed in /usr root@p10bmc:~# mkdir -p /tmp/persist/usr root@p10bmc:~# mkdir -p /tmp/persist/work/usr root@p10bmc:~# mount -t overlay -o lowerdir=/usr,upperdir=/tmp/persist/usr,workdir=/tmp/persist/work/usr overlay /usr root@p10bmc:~# md5sum /usr/bin/phosphor-psu-monitor /tmp/phosphor-psu-monitor ac1a50698a63e53dd3819b9f3c78c378 /usr/bin/phosphor-psu-monitor 4a2806d1a3494d1dd7176cd7b9dadf1a /tmp/phosphor-psu-monitor root@p10bmc:~# mv /tmp/phosphor-psu-monitor /usr/bin/phosphor-psu-monitor root@p10bmc:~# md5sum /usr/bin/phosphor-psu-monitor /tmp/phosphor-psu-monitor 4a2806d1a3494d1dd7176cd7b9dadf1a /usr/bin/phosphor-psu-monitor md5sum: can't open '/tmp/phosphor-psu-monitor': No such file or directory root@p10bmc:~# systemctl daemon-reload root@p10bmc:~# systemctl restart phosphor-psu-monitor.service root@p10bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager \ > /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0 \ > xyz.openbmc_project.Inventory.Decorator.Asset \ > PartNumber s "3FP210" root@p10bmc:~# root@p10bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager \ > /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1 \ > xyz.openbmc_project.Inventory.Decorator.Asset \ > PartNumber s "3FP210" root@p10bmc:~# root@p10bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager \ > /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0 \ > xyz.openbmc_project.Inventory.Decorator.Asset \ > SparePartNumber s "3FP211" root@p10bmc:~# root@p10bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager \ > /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1 \ > xyz.openbmc_project.Inventory.Decorator.Asset \ > SparePartNumber s "3FP211" root@p10bmc:~# Change-Id: I4aaa906f576894f62fa36083c40c89d935d646a8 Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
This repository contains applications for configuring and monitoring devices that deliver power to the system.
To build all applications in this repository:
meson build ninja -C build
To clean the repository and remove all build output:
rm -rf build
You can specify meson options to customize the build process. For example, you can specify:
Several applications in this repository require a PSU JSON config to run. The JSON config file provides information for:
There is an example psu.json to describe the necessary configurations.
inventoryPMBusAccessType
defines the pmbus access type, which tells the service which sysfs type to use to read the attributes. The possible values are:/sys/bus/i2c/devices/3-0069/
/sys/bus/i2c/devices/3-0069/hwmon/hwmonX/
/sys/kernel/debug/pmbus/hwmonX/
/sys/kernel/debug/pmbus/hwmonX/cffps1/
fruConfigs
defines the mapping between the attribute file and the FRU inventory interface and property. The configuration example below indicates that the service will read part_number
attribute file from a directory specified by the above pmbus access type, and assign to PartNumber
property in xyz.openbmc_project.Inventory.Decorator.Asset
interface."fruConfigs": [ { "propertyName": "PartNumber", "fileName": "part_number", "interface": "xyz.openbmc_project.Inventory.Decorator.Asset" } ]
psuDevices
defines the kernel device dir for each PSU in inventory. The configuration example below indicates that powersupply0
's device is located in /sys/bus/i2c/devices/3-0069
."psuDevices": { "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0" : "/sys/bus/i2c/devices/3-0069", }