Jagpal Singh Gill | dd003f5 | 2024-08-13 15:45:50 -0700 | [diff] [blame] | 1 | #include "config.h" |
| 2 | |
Jagpal Singh Gill | 6d131aa | 2024-04-07 23:56:48 -0700 | [diff] [blame] | 3 | #include "item_updater.hpp" |
Jagpal Singh Gill | 2311b64 | 2024-06-23 15:20:35 -0700 | [diff] [blame] | 4 | |
Jagpal Singh Gill | cc49878 | 2024-02-29 15:16:36 -0800 | [diff] [blame] | 5 | #include <phosphor-logging/lg2.hpp> |
Jagpal Singh Gill | 2311b64 | 2024-06-23 15:20:35 -0700 | [diff] [blame] | 6 | #include <sdbusplus/async.hpp> |
Jagpal Singh Gill | 6d131aa | 2024-04-07 23:56:48 -0700 | [diff] [blame] | 7 | |
Jagpal Singh Gill | dd003f5 | 2024-08-13 15:45:50 -0700 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Jagpal Singh Gill | 6d131aa | 2024-04-07 23:56:48 -0700 | [diff] [blame] | 10 | using ItemUpdaterIntf = phosphor::software::updater::ItemUpdater; |
Jagpal Singh Gill | cc49878 | 2024-02-29 15:16:36 -0800 | [diff] [blame] | 11 | |
| 12 | PHOSPHOR_LOG2_USING; |
| 13 | |
| 14 | int main() |
| 15 | { |
| 16 | info("Creating Software Manager"); |
Jagpal Singh Gill | dd003f5 | 2024-08-13 15:45:50 -0700 | [diff] [blame] | 17 | auto bmcPath = std::string(SOFTWARE_OBJPATH) + "/bmc"; |
| 18 | auto biosPath = std::string(SOFTWARE_OBJPATH) + "/bios"; |
Jagpal Singh Gill | 2311b64 | 2024-06-23 15:20:35 -0700 | [diff] [blame] | 19 | sdbusplus::async::context ctx; |
Jagpal Singh Gill | 6d131aa | 2024-04-07 23:56:48 -0700 | [diff] [blame] | 20 | sdbusplus::server::manager_t manager{ctx, SOFTWARE_OBJPATH}; |
Jagpal Singh Gill | 2311b64 | 2024-06-23 15:20:35 -0700 | [diff] [blame] | 21 | |
Jagpal Singh Gill | 6d131aa | 2024-04-07 23:56:48 -0700 | [diff] [blame] | 22 | constexpr auto serviceName = "xyz.openbmc_project.Software.Manager"; |
| 23 | |
Jagpal Singh Gill | dd003f5 | 2024-08-13 15:45:50 -0700 | [diff] [blame] | 24 | ItemUpdaterIntf bmcItemUpdater{ctx, bmcPath, |
| 25 | ItemUpdaterIntf::UpdaterType::BMC}; |
| 26 | #ifdef HOST_BIOS_UPGRADE |
| 27 | ItemUpdaterIntf biosItemUpdater{ctx, biosPath, |
| 28 | ItemUpdaterIntf::UpdaterType::BIOS}; |
| 29 | #endif // HOST_BIOS_UPGRADE |
Jagpal Singh Gill | 6d131aa | 2024-04-07 23:56:48 -0700 | [diff] [blame] | 30 | ctx.request_name(serviceName); |
Jagpal Singh Gill | 2311b64 | 2024-06-23 15:20:35 -0700 | [diff] [blame] | 31 | |
| 32 | ctx.run(); |
Jagpal Singh Gill | cc49878 | 2024-02-29 15:16:36 -0800 | [diff] [blame] | 33 | return 0; |
| 34 | } |