Alexander Hansen | f2c95a0 | 2024-11-26 11:16:44 +0100 | [diff] [blame] | 1 | #include "bios_software_manager.hpp" |
| 2 | |
| 3 | #include <phosphor-logging/lg2.hpp> |
| 4 | #include <sdbusplus/asio/connection.hpp> |
| 5 | #include <sdbusplus/asio/object_server.hpp> |
| 6 | #include <sdbusplus/async.hpp> |
| 7 | #include <sdbusplus/server.hpp> |
| 8 | |
| 9 | void run(bool dryRun) |
| 10 | { |
| 11 | sdbusplus::async::context ctx; |
| 12 | |
| 13 | std::vector<std::string> configIntfs = { |
| 14 | "xyz.openbmc_project.Configuration.SPIFlash", |
| 15 | }; |
| 16 | |
| 17 | BIOSSoftwareManager spidcu(ctx, dryRun); |
| 18 | |
| 19 | ctx.spawn(spidcu.initDevices(configIntfs)); |
| 20 | |
| 21 | ctx.run(); |
| 22 | } |
| 23 | |
| 24 | int main(int argc, char* argv[]) |
| 25 | { |
| 26 | bool dryRun = false; |
| 27 | |
| 28 | for (int i = 1; i < argc; i++) |
| 29 | { |
| 30 | std::string arg = std::string(argv[i]); |
| 31 | if (arg == "--dryrun") |
| 32 | { |
| 33 | dryRun = true; |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | run(dryRun); |
| 38 | |
| 39 | return 0; |
| 40 | } |