1 #include "config.h" 2 3 #include "item_updater.hpp" 4 5 #include <phosphor-logging/lg2.hpp> 6 #include <sdbusplus/async.hpp> 7 8 #include <string> 9 10 using ItemUpdaterIntf = phosphor::software::updater::ItemUpdater; 11 12 PHOSPHOR_LOG2_USING; 13 main()14int main() 15 { 16 info("Creating Software Manager"); 17 auto bmcPath = std::string(SOFTWARE_OBJPATH) + "/bmc"; 18 auto biosPath = std::string(SOFTWARE_OBJPATH) + "/bios"; 19 sdbusplus::async::context ctx; 20 sdbusplus::server::manager_t manager{ctx, SOFTWARE_OBJPATH}; 21 22 constexpr auto serviceName = "xyz.openbmc_project.Software.Manager"; 23 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 30 ctx.request_name(serviceName); 31 32 ctx.run(); 33 return 0; 34 } 35