main: refactor service initialization

The service initialization tasks currently consist of:
- Instantiating freedesktop.ObjectManager
- Instantiating an updater instance and providing it with a dbus
  connection
- Instantiating a watch instance and attaching it to the program event
  loop
- Claiming a well known name on DBus

Move these service initialization tasks to a new function.  This opens
the door to _not_ performing service initialization in an easy to read
way.

A couple of subtle ordering changes have occurred:
- The bus socket callbacks are attached to the event loop as soon as the
  event loop is instantiated.  This change doesn't have any functional
  impact; any data waiting in the dbus socket isn't processed until
  loop.loop() is called anyway.  What the relocation does enable is access
  to the event loop in the new method, via the of the bus.get_event()
  method.
- watch is now instantiated prior to claiming a busname.  That's ok
  because that doesn't result in any observable difference to client
  applications that may be watching for signals.

Change-Id: Ie0a42eb5764114110056cac2ad74da651c8dbd90
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
1 file changed
tree: f78e9964402022d5469d1d1bbf81c365350481da
  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. generate-tar
  14. generate-ubi
  15. image_verify.cpp
  16. image_verify.hpp
  17. item_updater.cpp
  18. item_updater.hpp
  19. item_updater_main.cpp
  20. LICENSE
  21. MAINTAINERS
  22. Makefile.am
  23. meson.build
  24. meson_options.txt
  25. msl_verify.cpp
  26. msl_verify.hpp
  27. msl_verify_main.cpp
  28. op-pnor-msl.service
  29. openpower-pnor-update@.service
  30. org.open_power.Software.Host.Updater.service
  31. README.md
  32. utils.cpp
  33. utils.hpp
  34. version.cpp
  35. 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`.