README: Introduce vendor-specific tools
Add detailed description about what the vendor-specific tools shall do,
and how to configure meson to specify the vendor-specific tools.
It also updates meson_options.txt to use updated psutils from
phosphor-power by default.
Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I17a508b675a754e76645d08d49547f669385813e
diff --git a/README.md b/README.md
index 00f2bbf..ebd479d 100644
--- a/README.md
+++ b/README.md
@@ -24,5 +24,41 @@
for t in `find build/test/ -maxdepth 1 -name "test_*"`; do ./$t || break ; done
```
+## Vendor-specific tools
+
+This repo contains generic code to handle the PSU versions and
+updates. It depends on vendor-specific tools to provide the below
+functions on the real PSU hardware:
+* Get PSU firmware version
+* Compare the firmware version
+* Update the PSU firmware
+
+It provides configure options for vendor-specific tools for the above functions:
+* `PSU_VERSION_UTIL`: It shall be defined as a command-line tool that
+accepts the PSU inventory path as input, and outputs the PSU version
+string to stdout.
+* `PSU_VERSION_COMPARE_UTIL`: It shall be defined as a command-line
+tool that accepts one or more PSU version strings, and outputs the
+latest version string to stdout.
+* `PSU_UPDATE_SERVICE`: It shall be defined as a systemd service that
+accepts two arguments:
+ * The PSU inventory DBus object;
+ * The path of the PSU image(s).
+
+For example:
+```
+meson -Dtests=disabled \
+ '-DPSU_VERSION_UTIL=/usr/bin/psutils --raw --get-version' \
+ '-DPSU_VERSION_COMPARE_UTIL=/usr/bin/psutils --raw --compare' \
+ '-DPSU_UPDATE_SERVICE=psu-update@.service' \
+ build
+```
+
+The above configures the vendor-specific tools to use `psutils` from
+[phosphor-power][3] to get and compare the PSU versions, and use
+`psu-update@.service` to perform the PSU firmware update, where
+internally it invokes `psutils` as well.
+
[1]: https://github.com/openbmc/docs/blob/master/testing/local-ci-build.md
[2]: https://github.com/openbmc/docs/blob/master/cheatsheet.md#building-the-openbmc-sdk
+[3]: https://github.com/openbmc/phosphor-power/tree/master/tools/power-utils
diff --git a/meson_options.txt b/meson_options.txt
index f4e84b4..027c92a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -29,7 +29,7 @@
# get_version <some-psu-path>
option('PSU_VERSION_UTIL',
type: 'string',
- value: '/usr/bin/psutils --getversion',
+ value: '/usr/bin/psutils --raw --get-version',
description: 'The command and arguments to get PSU version')
# The PSU_VERSION_COMPARE_UTIL specifies an executable that accepts the PSU
@@ -39,7 +39,7 @@
# get_latest_version 0001 0002 0003 # output 0003
option('PSU_VERSION_COMPARE_UTIL',
type: 'string',
- value: '/usr/bin/psutils --compare',
+ value: '/usr/bin/psutils --raw --compare',
description: 'The command and arguments to compare PSU versions')
# The PSU update service