From d071adf43ac87f21dde2f84287120960c723962c Mon Sep 17 00:00:00 2001 From: "Jason M. Bills" Date: Thu, 9 Jul 2020 15:11:22 -0700 Subject: Update to internal 0.66 Signed-off-by: Jason M. Bills --- ...porarily-disable-EventService-log-support.patch | 30 +++ ...changes-for-setting-ApplyOptions-ClearCfg.patch | 245 +++++++++++++++++++++ 2 files changed, 275 insertions(+) create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0003-Temporarily-disable-EventService-log-support.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0003-bmcweb-changes-for-setting-ApplyOptions-ClearCfg.patch (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb') diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0003-Temporarily-disable-EventService-log-support.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0003-Temporarily-disable-EventService-log-support.patch new file mode 100644 index 000000000..bfa843e73 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0003-Temporarily-disable-EventService-log-support.patch @@ -0,0 +1,30 @@ +From cd173b21c42456bde9765e7f6164e495b6c6a303 Mon Sep 17 00:00:00 2001 +From: James Feist +Date: Wed, 3 Jun 2020 10:08:05 -0700 +Subject: [PATCH 1/1] Temporarily disable EventService log support + +This is causing bmcweb to crash when there is no +redfish log. + +Change-Id: Id53e57f1ca140ee44f69fec46fd63bec18490c99 +Signed-off-by: James Feist +--- + src/webserver_main.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp +index ea32122..421cd1d 100644 +--- a/src/webserver_main.cpp ++++ b/src/webserver_main.cpp +@@ -116,7 +116,7 @@ int main(int argc, char** argv) + + redfish::RedfishService redfish(app); + +-#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES ++#if 0 + int rc = redfish::EventServiceManager::startEventLogMonitor(*io); + if (rc) + { +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0003-bmcweb-changes-for-setting-ApplyOptions-ClearCfg.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0003-bmcweb-changes-for-setting-ApplyOptions-ClearCfg.patch new file mode 100644 index 000000000..844a65ec9 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0003-bmcweb-changes-for-setting-ApplyOptions-ClearCfg.patch @@ -0,0 +1,245 @@ +From 4d88fcada1d95f485ea5a1dd418b31c508652712 Mon Sep 17 00:00:00 2001 +From: Vikram Bodireddy +Date: Fri, 15 May 2020 21:12:44 +0530 +Subject: [PATCH] bmcweb changes for setting ApplyOptions-ClearCfg + +ApplyOptions are used to specify firmware update specific options +such as ClearConfig which is used while activating the updated +firmware. This setting is maintained in a local static variable +when set using PATCH method. Its used in activate image as input +parameter. This attribute is added as Oem as the default +UpdateService interface doesn't specify any relevant or appropriate +attribute for this. + +Tested: Tested setting ClearConfig to true or false using PATCH + method. + Ran Redfish-Service-Validator and no new issues found. + +Signed-off-by: Vikram Bodireddy +--- + redfish-core/lib/update_service.hpp | 69 ++++++++++++++++++- + .../JsonSchemas/OemUpdateService/index.json | 69 +++++++++++++++++++ + .../redfish/v1/schema/OemUpdateService_v1.xml | 40 +++++++++++ + 3 files changed, 177 insertions(+), 1 deletion(-) + create mode 100644 static/redfish/v1/JsonSchemas/OemUpdateService/index.json + create mode 100644 static/redfish/v1/schema/OemUpdateService_v1.xml + +diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp +index a913bac..3a64e63 100644 +--- a/redfish-core/lib/update_service.hpp ++++ b/redfish-core/lib/update_service.hpp +@@ -579,6 +579,29 @@ class UpdateService : public Node + "/xyz/openbmc_project/software/apply_time", + "org.freedesktop.DBus.Properties", "Get", + "xyz.openbmc_project.Software.ApplyTime", "RequestedApplyTime"); ++ ++ // Get the ApplyOptions value ++ crow::connections::systemBus->async_method_call( ++ [aResp](const boost::system::error_code ec, ++ const std::variant applyOption) { ++ if (ec) ++ { ++ BMCWEB_LOG_DEBUG << "DBUS response error " << ec; ++ messages::internalError(aResp->res); ++ return; ++ } ++ ++ const bool *b = std::get_if(&applyOption); ++ ++ if (b) ++ { ++ aResp->res.jsonValue["Oem"]["ApplyOptions"]["ClearConfig"] = ++ *b; ++ } ++ }, ++ "xyz.openbmc_project.Software.BMC.Updater", ++ "/xyz/openbmc_project/software", "org.freedesktop.DBus.Properties", ++ "Get", "xyz.openbmc_project.Software.ApplyOptions", "ClearConfig"); + } + + void doPatch(crow::Response &res, const crow::Request &req, +@@ -591,15 +614,59 @@ class UpdateService : public Node + std::optional pushUriOptions; + std::optional> imgTargets; + std::optional imgTargetBusy; ++ std::optional oemProps; + + if (!json_util::readJson(req, res, "HttpPushUriOptions", pushUriOptions, + "HttpPushUriTargets", imgTargets, +- "HttpPushUriTargetsBusy", imgTargetBusy)) ++ "HttpPushUriTargetsBusy", imgTargetBusy, "Oem", ++ oemProps)) + { + BMCWEB_LOG_DEBUG << "UpdateService doPatch: Invalid request body"; + return; + } + ++ if (oemProps) ++ { ++ std::optional applyOptions; ++ ++ if (!json_util::readJson(*oemProps, res, "ApplyOptions", ++ applyOptions)) ++ { ++ return; ++ } ++ ++ if (applyOptions) ++ { ++ std::optional clearConfig; ++ if (!json_util::readJson(*applyOptions, res, "ClearConfig", ++ clearConfig)) ++ { ++ return; ++ } ++ ++ if (clearConfig) ++ { ++ // Set the requested image apply time value ++ crow::connections::systemBus->async_method_call( ++ [asyncResp](const boost::system::error_code ec) { ++ if (ec) ++ { ++ BMCWEB_LOG_ERROR << "D-Bus responses error: " ++ << ec; ++ messages::internalError(asyncResp->res); ++ return; ++ } ++ messages::success(asyncResp->res); ++ }, ++ "xyz.openbmc_project.Software.BMC.Updater", ++ "/xyz/openbmc_project/software", ++ "org.freedesktop.DBus.Properties", "Set", ++ "xyz.openbmc_project.Software.ApplyOptions", ++ "ClearConfig", std::variant{*clearConfig}); ++ } ++ } ++ } ++ + if (pushUriOptions) + { + std::optional pushUriApplyTime; +diff --git a/static/redfish/v1/JsonSchemas/OemUpdateService/index.json b/static/redfish/v1/JsonSchemas/OemUpdateService/index.json +new file mode 100644 +index 0000000..74e39cd +--- /dev/null ++++ b/static/redfish/v1/JsonSchemas/OemUpdateService/index.json +@@ -0,0 +1,69 @@ ++{ ++ "$id": "http://redfish.dmtf.org/schemas/v1/OemUpdateService.json", ++ "$schema": "http://redfish.dmtf.org/schemas/v1/redfish-schema-v1.json", ++ "copyright": "Copyright 2014-2019 DMTF. For the full DMTF copyright policy, see http://www.dmtf.org/about/policies/copyright", ++ "definitions": { ++ "ApplyOptions": { ++ "additionalProperties": false, ++ "description": "An indication by boolean value whether to update firmware configuration along with firmware image update.", ++ "patternProperties": { ++ "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message)\\.[a-zA-Z_][a-zA-Z0-9_]*$": { ++ "description": "This property shall specify a valid odata or Redfish property.", ++ "type": [ ++ "array", ++ "boolean", ++ "integer", ++ "number", ++ "null", ++ "object", ++ "string" ++ ] ++ } ++ }, ++ "properties": { ++ "ClearConfig": { ++ "description": "This indicates whether to update firmware configuration or not.", ++ "longDescription": "The value of this property is used to indicate the firmware configuration update.", ++ "readonly": false, ++ "type": [ ++ "boolean", ++ "null" ++ ] ++ } ++ }, ++ "type": "object" ++ }, ++ "Oem": { ++ "additionalProperties": true, ++ "description": "OemUpdateService Oem properties.", ++ "patternProperties": { ++ "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message)\\.[a-zA-Z_][a-zA-Z0-9_]*$": { ++ "description": "This property shall specify a valid odata or Redfish property.", ++ "type": [ ++ "array", ++ "boolean", ++ "integer", ++ "number", ++ "null", ++ "object", ++ "string" ++ ] ++ } ++ }, ++ "properties": { ++ "ApplyOptions": { ++ "anyOf": [ ++ { ++ "$ref": "#/definitions/ApplyOptions" ++ }, ++ { ++ "type": "null" ++ } ++ ] ++ } ++ }, ++ "type": "object" ++ } ++ }, ++ "title": "#OemUpdateService" ++} +diff --git a/static/redfish/v1/schema/OemUpdateService_v1.xml b/static/redfish/v1/schema/OemUpdateService_v1.xml +new file mode 100644 +index 0000000..cbb7aa4 +--- /dev/null ++++ b/static/redfish/v1/schema/OemUpdateService_v1.xml +@@ -0,0 +1,40 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +-- +2.17.1 + -- cgit v1.2.3