blob: 651b758b2ece2fab1145400ee4d48bacaea2056a [file] [log] [blame]
Jagpal Singh Gilldd003f52024-08-13 15:45:50 -07001#include "config.h"
2
Jagpal Singh Gill6d131aa2024-04-07 23:56:48 -07003#include "item_updater.hpp"
Jagpal Singh Gill2311b642024-06-23 15:20:35 -07004
Jagpal Singh Gillcc498782024-02-29 15:16:36 -08005#include <phosphor-logging/lg2.hpp>
Jagpal Singh Gill2311b642024-06-23 15:20:35 -07006#include <sdbusplus/async.hpp>
Jagpal Singh Gill6d131aa2024-04-07 23:56:48 -07007
Jagpal Singh Gilldd003f52024-08-13 15:45:50 -07008#include <string>
9
Jagpal Singh Gill6d131aa2024-04-07 23:56:48 -070010using ItemUpdaterIntf = phosphor::software::updater::ItemUpdater;
Jagpal Singh Gillcc498782024-02-29 15:16:36 -080011
12PHOSPHOR_LOG2_USING;
13
14int main()
15{
16 info("Creating Software Manager");
Jagpal Singh Gilldd003f52024-08-13 15:45:50 -070017 auto bmcPath = std::string(SOFTWARE_OBJPATH) + "/bmc";
18 auto biosPath = std::string(SOFTWARE_OBJPATH) + "/bios";
Jagpal Singh Gill2311b642024-06-23 15:20:35 -070019 sdbusplus::async::context ctx;
Jagpal Singh Gill6d131aa2024-04-07 23:56:48 -070020 sdbusplus::server::manager_t manager{ctx, SOFTWARE_OBJPATH};
Jagpal Singh Gill2311b642024-06-23 15:20:35 -070021
Jagpal Singh Gill6d131aa2024-04-07 23:56:48 -070022 constexpr auto serviceName = "xyz.openbmc_project.Software.Manager";
23
Jagpal Singh Gilldd003f52024-08-13 15:45:50 -070024 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 Gill6d131aa2024-04-07 23:56:48 -070030 ctx.request_name(serviceName);
Jagpal Singh Gill2311b642024-06-23 15:20:35 -070031
32 ctx.run();
Jagpal Singh Gillcc498782024-02-29 15:16:36 -080033 return 0;
34}