summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/biosconfig/0003-Add-support-to-ResetBios-action.patch
blob: a5c55afd1e9457c3451f7e1e0810d7065fb26d70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 415b5079ff45c1dabad15e0f751001a6265412e4 Mon Sep 17 00:00:00 2001
From: AppaRao Puli <apparao.puli@linux.intel.com>
Date: Fri, 27 Aug 2021 13:02:20 +0000
Subject: [PATCH] Add support to ResetBios action

Tested:

Bios reset flag can be modified throw redfish
POST https://IP_ADDR/redfish/v1/Systems/system/Bios/Actions/Bios.ResetBios

Change-Id: Ic719c55705e5f634539b3dd858b60922e505a8d0
Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
---
 redfish-core/lib/bios.hpp | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/redfish-core/lib/bios.hpp b/redfish-core/lib/bios.hpp
index 85ccaaa..360a749 100644
--- a/redfish-core/lib/bios.hpp
+++ b/redfish-core/lib/bios.hpp
@@ -737,18 +737,24 @@ inline void requestRoutesBiosReset(App& app)
         .methods(boost::beast::http::verb::post)(
             [](const crow::Request&,
                const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+                std::string resetFlag = "xyz.openbmc_project.BIOSConfig."
+                                        "Manager.ResetFlag.FactoryDefaults";
+
                 crow::connections::systemBus->async_method_call(
                     [asyncResp](const boost::system::error_code ec) {
                         if (ec)
                         {
-                            BMCWEB_LOG_ERROR << "Failed to reset bios: " << ec;
+                            BMCWEB_LOG_ERROR << "doPost bios reset got error "
+                                             << ec;
                             messages::internalError(asyncResp->res);
                             return;
                         }
                     },
-                    "org.open_power.Software.Host.Updater",
-                    "/xyz/openbmc_project/software",
-                    "xyz.openbmc_project.Common.FactoryReset", "Reset");
+                    "xyz.openbmc_project.BIOSConfigManager",
+                    "/xyz/openbmc_project/bios_config/manager",
+                    "org.freedesktop.DBus.Properties", "Set",
+                    "xyz.openbmc_project.BIOSConfig.Manager",
+                    "ResetBIOSSettings", std::variant<std::string>(resetFlag));
             });
 }
 } // namespace redfish
-- 
2.17.1