Arun Lal K M | 1a1dfbd | 2023-01-17 06:38:19 +0000 | [diff] [blame] | 1 | /* |
Manojkiran Eda | fae5732 | 2024-11-12 12:58:11 +0530 | [diff] [blame] | 2 | Copyright (c) 2020 Intel Corporation |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http:www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
Arun Lal K M | 1a1dfbd | 2023-01-17 06:38:19 +0000 | [diff] [blame] | 15 | */ |
Prithvi Pai | 627c99d | 2025-02-08 14:05:25 +0530 | [diff] [blame^] | 16 | #include "configuration.h" |
Arun Lal K M | 1a1dfbd | 2023-01-17 06:38:19 +0000 | [diff] [blame] | 17 | |
Patrick Williams | 5c7e80d | 2024-10-18 21:24:12 -0400 | [diff] [blame] | 18 | #include "config.hpp" |
Arun Lal K M | 1a1dfbd | 2023-01-17 06:38:19 +0000 | [diff] [blame] | 19 | #include "manager.hpp" |
| 20 | #include "password.hpp" |
Prithvi Pai | 627c99d | 2025-02-08 14:05:25 +0530 | [diff] [blame^] | 21 | #include "secureboot.hpp" |
Arun Lal K M | 1a1dfbd | 2023-01-17 06:38:19 +0000 | [diff] [blame] | 22 | |
| 23 | #include <boost/asio.hpp> |
| 24 | #include <phosphor-logging/elog-errors.hpp> |
| 25 | #include <phosphor-logging/lg2.hpp> |
| 26 | #include <sdbusplus/asio/connection.hpp> |
| 27 | #include <sdbusplus/asio/object_server.hpp> |
| 28 | |
Patrick Williams | 773c922 | 2024-10-18 21:39:55 -0400 | [diff] [blame] | 29 | PHOSPHOR_LOG2_USING; |
| 30 | |
| 31 | int main(int argc, char** argv) |
Arun Lal K M | 1a1dfbd | 2023-01-17 06:38:19 +0000 | [diff] [blame] | 32 | { |
Patrick Williams | 773c922 | 2024-10-18 21:39:55 -0400 | [diff] [blame] | 33 | std::string persistPath = BIOS_PERSIST_PATH; |
| 34 | if (argc >= 2) |
| 35 | { |
| 36 | persistPath = argv[1]; |
| 37 | info("Using temporary path {PATH}", "PATH", persistPath); |
| 38 | } |
| 39 | |
Jason M. Bills | a46dc4e | 2025-02-26 08:35:01 -0800 | [diff] [blame] | 40 | boost::asio::io_context io; |
Arun Lal K M | 1a1dfbd | 2023-01-17 06:38:19 +0000 | [diff] [blame] | 41 | auto systemBus = std::make_shared<sdbusplus::asio::connection>(io); |
| 42 | |
| 43 | systemBus->request_name(bios_config::service); |
| 44 | sdbusplus::asio::object_server objectServer(systemBus); |
| 45 | |
| 46 | /** |
yes | 8de46ff | 2023-03-22 14:51:28 +0530 | [diff] [blame] | 47 | * Manager class is responsible for handling methods and signals under |
Arun Lal K M | 1a1dfbd | 2023-01-17 06:38:19 +0000 | [diff] [blame] | 48 | * the following object path and interface. |
| 49 | * |
| 50 | * Object path : /xyz/openbmc_project/bios_config/manager |
| 51 | * Interface : xyz.openbmc_project.BIOSConfig.Manager |
| 52 | */ |
Patrick Williams | 773c922 | 2024-10-18 21:39:55 -0400 | [diff] [blame] | 53 | bios_config::Manager manager(objectServer, systemBus, persistPath); |
Arun Lal K M | 1a1dfbd | 2023-01-17 06:38:19 +0000 | [diff] [blame] | 54 | |
| 55 | /** |
yes | 8de46ff | 2023-03-22 14:51:28 +0530 | [diff] [blame] | 56 | * Password class is responsible for handling methods and signals under |
Arun Lal K M | 1a1dfbd | 2023-01-17 06:38:19 +0000 | [diff] [blame] | 57 | * the following object path and interface. |
| 58 | * |
| 59 | * Object path : /xyz/openbmc_project/bios_config/password |
| 60 | * Interface : xyz.openbmc_project.BIOSConfig.Password |
| 61 | */ |
Patrick Williams | 773c922 | 2024-10-18 21:39:55 -0400 | [diff] [blame] | 62 | bios_config_pwd::Password password(objectServer, systemBus, persistPath); |
Arun Lal K M | 1a1dfbd | 2023-01-17 06:38:19 +0000 | [diff] [blame] | 63 | |
Prithvi Pai | 627c99d | 2025-02-08 14:05:25 +0530 | [diff] [blame^] | 64 | #ifdef ENABLE_BIOS_SECUREBOOT |
| 65 | /** |
| 66 | * SecureBoot class is responsible for handling methods and signals under |
| 67 | * the following object path and interface. |
| 68 | * |
| 69 | * Object path : /xyz/openbmc_project/bios_config/secure_boot |
| 70 | * Interface : xyz.openbmc_project.BIOSConfig.SecureBoot |
| 71 | */ |
| 72 | bios_config_sec::SecureBoot secureboot(objectServer, systemBus, |
| 73 | persistPath); |
| 74 | #endif |
| 75 | |
Arun Lal K M | 1a1dfbd | 2023-01-17 06:38:19 +0000 | [diff] [blame] | 76 | io.run(); |
| 77 | return 0; |
| 78 | } |