utils: Add function to get the latest version

This repo does not know which PSU version is the latest, and it lets the
vendor tool to decide which one is the latest.

This commit defines PSU_VERSION_COMPARE_UTIL which is expected to be a
tool that accepts arguments of a list of versions, and returns the
latest version string.

Tested: Put and configure to use the example get_latest_version on
        Witherspoon, verify the versionId with a larger version string
        is returned.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: Ic5a10d3724cf6a98b3979486c72d54f8deac7038
10 files changed
tree: 00f84bd2805f182b3dbf3be58c2e379389d0879a
  1. service/
  2. src/
  3. test/
  4. vendor-example/
  5. .clang-format
  6. .gitignore
  7. LICENSE
  8. MAINTAINERS
  9. meson.build
  10. meson_options.txt
  11. README.md
README.md

phosphor-psu-code-mgmt

phosphor-psu-code-mgmt is a service to provide management for PSU code, including:

  • PSU code version
  • PSU code update

Building

meson build/ && ninja -C build

Unit test

  • Run it in OpenBMC CI, refer to local-ci-build.md
  • Run it in OE SDK, run below commands in a x86-64 SDK env:
    meson -Doe-sdk=enabled -Dtests=enabled build/
    ninja -C build/ test  # Meson skips running the case due to it thinks it's cross compiling
    # Manually run the tests
    for t in `find build/test/ -maxdepth 1 -name "test_*"`; do ./$t || break ; done