updater: add process-host-firmware subcommand

Add general support for subcommands.  Do this by bringing in the the
CLI11 library, and by skipping over dbus service initialization if a
subcommand is specified on the command line.

Implement the first subcommand: process-host-firmware.  If no subcommand
is specified on the command line, openpower-update-manager continues to
launch as a dbus service.

Introduce functions.cpp/functions.hpp.  functions.cpp is intended to be
a module in which process-hostfirmware and future openpower-item-updater
subcommands can be implemented.  functions.hpp should be used to export
declarations to unit tests or item_updater_main.cpp.

The IBM POWER host firmware runtime looks for data and/or additional
code while bootstraping in locations with well-known names.
Additionally, the host firmware runtime relies on an external party to
map platform specific data and/or code to the well known names.  The
process-host-firmware command maintains that mapping on behalf of the
host firmware and ensures the correct blob files exist in the well-known
locations prior to starting the host firmware runtime.

The process-host-firmware subcommand registers for callbacks from entity
manager when entity manager adds new DBus interfaces.  Interfaces other
than IBMCompatibleSystem are ignored.  Entity manager is started with
dbus activation if it is not already running.  If IBMCompatibleSystem is
found and a set of host firmware blob filename extensions are mapped,
they are used to write "well-known" names into the filesystem for use by
the host firmware runtime.

Once the well-known names are written to the filesystem the program will
exit.

If entity manager does not publish an IBMCompatibleSystem interface the
command will wait indefinitely for it to appear.  For this reason it is
not recommended to run the process-host-fimrware subcommand if
IBMCompatibleSystem is not implemented.

If IBMCompatibleSystem is implemented but no host firmware blob filename
extensions are mapped, the program will exit without doing anything.

Testcases are provided.

Change-Id: Icb066b0f3e164520cae312e3b03432a6ad67e0df
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
8 files changed
tree: fcd70eab7032e67bb197ab26c8a53af4f306f3a7
  1. m4/
  2. mmc/
  3. static/
  4. test/
  5. ubi/
  6. vpnor/
  7. .clang-format
  8. .gitignore
  9. activation.cpp
  10. activation.hpp
  11. bootstrap.sh
  12. configure.ac
  13. functions.cpp
  14. functions.hpp
  15. generate-tar
  16. generate-ubi
  17. image_verify.cpp
  18. image_verify.hpp
  19. item_updater.cpp
  20. item_updater.hpp
  21. item_updater_main.cpp
  22. LICENSE
  23. MAINTAINERS
  24. Makefile.am
  25. meson.build
  26. meson_options.txt
  27. msl_verify.cpp
  28. msl_verify.hpp
  29. msl_verify_main.cpp
  30. op-pnor-msl.service
  31. openpower-pnor-update@.service
  32. org.open_power.Software.Host.Updater.service
  33. README.md
  34. utils.cpp
  35. utils.hpp
  36. version.cpp
  37. version.hpp
README.md

openpower-pnor-code-mgmt

OpenPower PNOR (Processor NOR) Code Management provides a set of host software management applications for OpenPower systems. The host firmware is stored on the PNOR chip. More information can be found at Software Architecture or Host Code Update

To Build

To build this package, do the following steps:

    1. ./bootstrap.sh
    2. ./configure ${CONFIGURE_FLAGS}
    3. make

To clean the repository run `./bootstrap.sh clean`.