From 2a64b8ae9b952b18b4aef38cb7c41ce6dba16c50 Mon Sep 17 00:00:00 2001 From: "Jason M. Bills" Date: Mon, 24 May 2021 12:54:37 -0700 Subject: Update to internal 0.52 Signed-off-by: Jason M. Bills --- ...001-Improve-initialization-of-I2C-sensors.patch | 26 +- ...ty-manager-Add-support-to-update-assetTag.patch | 226 +------ .../0003-Add-logs-to-fwVersionIsSame.patch | 56 ++ .../configuration/entity-manager_%.bbappend | 3 +- .../console/obmc-console/obmc-console@.service | 9 +- .../dbus/phosphor-dbus-interfaces_%.bbappend | 2 +- .../fans/phosphor-pid-control_%.bbappend | 2 +- ...image-by-ID-and-inhibit-removal-of-bmc_ac.patch | 153 ----- ...image-by-ID-and-inhibit-removal-of-bmc_ac.patch | 175 ++++++ .../flash/phosphor-software-manager_%.bbappend | 1 + .../host/phosphor-host-postd_git.bbappend | 2 +- ...rtMedia-action-response-for-POST-in-proxy.patch | 30 - ...status-code-from-InsertMedia-REST-methods.patch | 182 ++++++ ...Bmcweb-handle-permission-denied-exception.patch | 44 ++ .../0005-Fix-unmounting-image-in-proxy-mode.patch | 32 + ...-Add-PhysicalContext-to-Thermal-resources.patch | 135 +++++ ...g-RedFish-event-for-Invalid-login-attempt.patch | 67 ++ ...uting-logic-into-host-console-connection-.patch | 59 ++ ...b-crashes-if-socket-directory-not-present.patch | 44 ++ ...0039-Fix-comparison-for-proxy-legacy-mode.patch | 51 ++ ...003-Move-EventService-init-to-later-stage.patch | 50 -- ...tyle-subscription-support-to-eventservice.patch | 32 +- .../0006-Add-EventService-SSE-filter-support.patch | 8 +- .../interfaces/bmcweb/eventservice/README | 3 - ...nc_ReadingUnit_with_Redfish_Sensor_Schema.patch | 227 ------- ...OST-and-DELETE-in-MetricReportDefinitions.patch | 671 --------------------- .../interfaces/bmcweb/telemetry/README | 3 - .../recipes-phosphor/interfaces/bmcweb_%.bbappend | 19 +- ...-IPv6-Router-Address-Configuration-comman.patch | 120 ---- .../ipmi/phosphor-ipmi-host_%.bbappend | 1 - .../ipmi/phosphor-ipmi-kcs_%.bbappend | 2 +- .../0009-Add-dbus-interface-for-sol-commands.patch | 317 ---------- .../ipmi/phosphor-ipmi-net_%.bbappend | 3 +- .../leds/intel-led-manager-config-native.bb | 2 +- .../recipes-phosphor/pmci/libmctp-intel_git.bb | 2 +- .../recipes-phosphor/pmci/libpldm-intel_git.bb | 2 +- .../recipes-phosphor/pmci/mctp-emulator.bb | 2 +- .../recipes-phosphor/pmci/mctp-wrapper.bb | 2 +- .../meta-common/recipes-phosphor/pmci/mctpd.bb | 2 +- .../meta-common/recipes-phosphor/pmci/mctpwplus.bb | 2 +- .../recipes-phosphor/pmci/nvmemi-daemon.bb | 2 +- .../meta-common/recipes-phosphor/pmci/pldmd.bb | 2 +- .../recipes-phosphor/pmci/pmci-launcher.bb | 2 +- .../preinit-mounts/preinit-mounts/init | 5 + .../sel-logger/phosphor-sel-logger_%.bbappend | 2 +- .../sensors/dbus-sensors_%.bbappend | 2 +- .../state/phosphor-post-code-manager_git.bbappend | 2 +- .../telemetry/telemetry_%.bbappend | 2 +- .../users/phosphor-user-manager_%.bbappend | 2 +- ...ize-phosphor-watchdog-for-Intel-platforms.patch | 38 +- .../webui/phosphor-webui_%.bbappend | 2 +- .../recipes-phosphor/webui/webui-vue_%.bbappend | 2 +- 52 files changed, 979 insertions(+), 1853 deletions(-) create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0003-Add-logs-to-fwVersionIsSame.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0015-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0018-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Change-InsertMedia-action-response-for-POST-in-proxy.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Invalid-status-code-from-InsertMedia-REST-methods.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0004-Bmcweb-handle-permission-denied-exception.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0005-Fix-unmounting-image-in-proxy-mode.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0011-bmcweb-Add-PhysicalContext-to-Thermal-resources.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0012-Log-RedFish-event-for-Invalid-login-attempt.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0013-Add-UART-routing-logic-into-host-console-connection-.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-bmcweb-crashes-if-socket-directory-not-present.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-comparison-for-proxy-legacy-mode.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0003-Move-EventService-init-to-later-stage.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0001-Sync_ReadingUnit_with_Redfish_Sensor_Schema.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Correct-the-IPv6-Router-Address-Configuration-comman.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor') diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-Improve-initialization-of-I2C-sensors.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-Improve-initialization-of-I2C-sensors.patch index fdd2ba6e3..e47111c56 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-Improve-initialization-of-I2C-sensors.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-Improve-initialization-of-I2C-sensors.patch @@ -1,4 +1,4 @@ -From 85e7b2d9ede4bb33e02f48ea1d4691d2154fc4a5 Mon Sep 17 00:00:00 2001 +From a85d4c9cf702965593ec771e57a975e30d1d5853 Mon Sep 17 00:00:00 2001 From: Johnathan Mantey Date: Tue, 13 Oct 2020 15:00:51 -0700 Subject: [PATCH] Improve initialization of I2C sensors @@ -32,15 +32,15 @@ missing after AC cycles. Change-Id: I118df674162677d66e7d211b089430fce384086b Signed-off-by: Johnathan Mantey --- - include/devices.hpp | 165 ++++++++++++++++++++----------------- + include/devices.hpp | 167 +++++++++++++++++++++----------------- src/Overlay.cpp | 192 ++++++++++++++++++++++++++++++++++---------- - 2 files changed, 239 insertions(+), 118 deletions(-) + 2 files changed, 243 insertions(+), 116 deletions(-) diff --git a/include/devices.hpp b/include/devices.hpp -index c375b1c..b7dc7d0 100644 +index 50fbe63..2e299a0 100644 --- a/include/devices.hpp +++ b/include/devices.hpp -@@ -31,105 +31,122 @@ struct CmpStr +@@ -31,107 +31,130 @@ struct CmpStr struct ExportTemplate { @@ -61,14 +61,20 @@ index c375b1c..b7dc7d0 100644 const boost::container::flat_map exportTemplates{ -- {{"24C02", ExportTemplate("24c02 $Address", -- "/sys/bus/i2c/devices/i2c-$Bus/new_device")}, -- {"24C64", ExportTemplate("24c64 $Address", -- "/sys/bus/i2c/devices/i2c-$Bus/new_device")}, + {{"EEPROM_24C02", + ExportTemplate("24c02 $Address", +- "/sys/bus/i2c/devices/i2c-$Bus/new_device")}, ++ "/sys/bus/i2c/devices/i2c-$Bus/new_device", ++ "new_device", "delete_device", false)}, + {"EEPROM_24C64", + ExportTemplate("24c64 $Address", +- "/sys/bus/i2c/devices/i2c-$Bus/new_device")}, - {"ADM1266", - ExportTemplate("adm1266 $Address", - "/sys/bus/i2c/devices/i2c-$Bus/new_device")}, -+ {{"24C02", ++ "/sys/bus/i2c/devices/i2c-$Bus/new_device", ++ "new_device", "delete_device", false)}, ++ {"24C02", + ExportTemplate("24c02 $Address", "/sys/bus/i2c/devices/i2c-$Bus", + "new_device", "delete_device", false)}, + {"24C64", diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0002-Entity-manager-Add-support-to-update-assetTag.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0002-Entity-manager-Add-support-to-update-assetTag.patch index 88e86f68c..8682e2cad 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0002-Entity-manager-Add-support-to-update-assetTag.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0002-Entity-manager-Add-support-to-update-assetTag.patch @@ -1,6 +1,6 @@ -From 1e8b3e0fe4ce9aa87a35f6c3ba6e506873d5455c Mon Sep 17 00:00:00 2001 +From ff5dbca96d12b1c2aaaec0bb891125990af3f218 Mon Sep 17 00:00:00 2001 From: mansijos -Date: Fri, 12 Feb 2021 11:26:57 +0530 +Date: Tue, 6 Apr 2021 02:12:56 +0530 Subject: [PATCH] Entity-manager: Add support to update assetTag Asset tag is an updateable property from User level interface like @@ -12,58 +12,17 @@ Successfully updated in assetTag interface as well as in fru interface while using set-property and using redfish as well. The new value is preserved after BMC resets. -Change-Id: Iab8b24344d1a27486ceafe21aa2b4496706a2944 +Change-Id: If7fbfd8325488280f500ab0e2c8b38475813cc3f Signed-off-by: mansijos --- - include/EntityManager.hpp | 15 ++-- - src/EntityManager.cpp | 148 ++++++++++++++++++++++++++++++++------ - 2 files changed, 135 insertions(+), 28 deletions(-) + src/EntityManager.cpp | 92 +++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 88 insertions(+), 4 deletions(-) -diff --git a/include/EntityManager.hpp b/include/EntityManager.hpp -index 5867556..a4e9922 100644 ---- a/include/EntityManager.hpp -+++ b/include/EntityManager.hpp -@@ -29,13 +29,16 @@ - #include - #include - --using DBusProbeObjectT = boost::container::flat_map< -- std::string, -- std::vector>>; -- - using FoundDeviceT = - std::vector>; - -+using FoundDeviceInfoT = std::vector< -+ std::tuple, -+ std::string, std::string, std::string>>; -+ -+using DBusProbeObjectT = -+ boost::container::flat_map; -+ - struct PerformScan : std::enable_shared_from_this - { - -@@ -62,12 +65,12 @@ struct PerformProbe : std::enable_shared_from_this - { - PerformProbe(const std::vector& probeCommand, - std::shared_ptr& scanPtr, -- std::function&& callback); -+ std::function&& callback); - virtual ~PerformProbe(); - - std::vector _probeCommand; - std::shared_ptr scan; -- std::function _callback; -+ std::function _callback; - }; - - inline void logDeviceAdded(const nlohmann::json& record) diff --git a/src/EntityManager.cpp b/src/EntityManager.cpp -index aa1df20..cd73675 100644 +index 932b6f9..67b8f95 100644 --- a/src/EntityManager.cpp +++ b/src/EntityManager.cpp -@@ -47,9 +47,14 @@ constexpr const char* lastConfiguration = "/tmp/configuration/last.json"; +@@ -47,9 +47,17 @@ constexpr const char* lastConfiguration = "/tmp/configuration/last.json"; constexpr const char* currentConfiguration = "/var/configuration/system.json"; constexpr const char* globalSchema = "global.json"; constexpr const int32_t MAX_MAPPER_DEPTH = 0; @@ -74,99 +33,14 @@ index aa1df20..cd73675 100644 +using foundProbeData = std::map; +static foundProbeData foundData; +static std::map mapFoundData; ++ ++constexpr const char* fruConn = "xyz.openbmc_project.FruDevice"; ++constexpr const char* fruIntf = "xyz.openbmc_project.FruDevice"; + struct cmp_str { bool operator()(const char* a, const char* b) const -@@ -169,7 +174,10 @@ void getInterfaces( - return; - } - -- scan->dbusProbeObjects[std::get<2>(call)].emplace_back(resp); -+ // Save the dbus info along with device info -+ scan->dbusProbeObjects[std::get<2>(call)].emplace_back( -+ std::make_tuple(resp, std::get<0>(call), std::get<1>(call), -+ std::get<2>(call))); - }, - std::get<0>(call), std::get<1>(call), "org.freedesktop.DBus.Properties", - "GetAll", std::get<2>(call)); -@@ -274,11 +282,10 @@ void findDbusObjects(std::vector>&& probeVector, - // probes dbus interface dictionary for a key with a value that matches a regex - bool probeDbus(const std::string& interface, - const std::map& matches, -- FoundDeviceT& devices, std::shared_ptr scan, -+ FoundDeviceInfoT& devices, std::shared_ptr scan, - bool& foundProbe) - { -- std::vector>& -- dbusObject = scan->dbusProbeObjects[interface]; -+ FoundDeviceInfoT& dbusObject = scan->dbusProbeObjects[interface]; - if (dbusObject.empty()) - { - foundProbe = false; -@@ -287,8 +294,9 @@ bool probeDbus(const std::string& interface, - foundProbe = true; - - bool foundMatch = false; -- for (auto& device : dbusObject) -+ for (auto& deviceInfo : dbusObject) - { -+ auto& device = std::get<0>(deviceInfo); - bool deviceMatches = true; - for (auto& match : matches) - { -@@ -305,7 +313,7 @@ bool probeDbus(const std::string& interface, - } - if (deviceMatches) - { -- devices.emplace_back(device); -+ devices.emplace_back(deviceInfo); - foundMatch = true; - deviceMatches = false; // for next iteration - } -@@ -315,11 +323,8 @@ bool probeDbus(const std::string& interface, - - // default probe entry point, iterates a list looking for specific types to - // call specific probe functions --bool probe( -- const std::vector& probeCommand, -- std::shared_ptr scan, -- std::vector>& -- foundDevs) -+bool probe(const std::vector& probeCommand, -+ std::shared_ptr scan, FoundDeviceInfoT& foundDevs) - { - const static std::regex command(R"(\((.*)\))"); - std::smatch match; -@@ -449,8 +454,9 @@ bool probe( - // probe passed, but empty device - if (ret && foundDevs.size() == 0) - { -- foundDevs.emplace_back( -- boost::container::flat_map{}); -+ foundDevs.emplace_back(std::make_tuple( -+ boost::container::flat_map{}, -+ std::string{}, std::string{}, std::string{})); - } - if (matchOne && ret) - { -@@ -465,13 +471,13 @@ bool probe( - - PerformProbe::PerformProbe(const std::vector& probeCommand, - std::shared_ptr& scanPtr, -- std::function&& callback) : -+ std::function&& callback) : - _probeCommand(probeCommand), - scan(scanPtr), _callback(std::move(callback)) - {} - PerformProbe::~PerformProbe() - { -- FoundDeviceT foundDevs; -+ FoundDeviceInfoT foundDevs; - if (probe(_probeCommand, scan, foundDevs)) - { - _callback(foundDevs); -@@ -556,6 +562,47 @@ void addArrayToDbus(const std::string& name, const nlohmann::json& array, +@@ -575,6 +583,43 @@ void addArrayToDbus(const std::string& name, const nlohmann::json& array, } } @@ -186,11 +60,8 @@ index aa1df20..cd73675 100644 + } + + foundProbeData& tmpMap = it->second; -+ auto foundConn = tmpMap.find("foundConn"); + auto foundPath = tmpMap.find("foundPath"); -+ auto foundIntf = tmpMap.find("foundIntf"); -+ if (foundConn == tmpMap.end() || foundPath == tmpMap.end() || -+ foundIntf == tmpMap.end()) ++ if (foundPath == tmpMap.end()) + { + std::cerr << "No prob object data is avaliable in foundProbeData" + << "\n"; @@ -205,20 +76,16 @@ index aa1df20..cd73675 100644 + << "\n"; + } + }, -+ foundConn->second, foundPath->second, "org.freedesktop.DBus.Properties", -+ "Set", foundIntf->second, "PRODUCT_ASSET_TAG", -+ std::variant(newVal)); ++ fruConn, foundPath->second, "org.freedesktop.DBus.Properties", "Set", ++ fruIntf, "PRODUCT_ASSET_TAG", std::variant(newVal)); + return true; +} + template void addProperty(const std::string& propertyName, const PropertyType& value, sdbusplus::asio::dbus_interface* iface, -@@ -568,11 +615,21 @@ void addProperty(const std::string& propertyName, const PropertyType& value, - iface->register_property(propertyName, value); - return; +@@ -589,9 +634,18 @@ void addProperty(const std::string& propertyName, const PropertyType& value, } -+ iface->register_property( propertyName, value, - [&systemConfiguration, @@ -237,19 +104,17 @@ index aa1df20..cd73675 100644 val = newVal; if (!setJsonFromPointer(jsonPointerString, val, systemConfiguration)) -@@ -970,6 +1027,11 @@ void postToDbus(const nlohmann::json& newConfiguration, +@@ -989,6 +1043,9 @@ void postToDbus(const nlohmann::json& newConfiguration, populateInterfaceFromJson(systemConfiguration, jsonPointerPath, boardIface, boardValues, objServer); jsonPointerPath += "/"; + -+ std::string foundConn; + std::string foundPath; -+ std::string foundIntf; + // iterate through board properties for (auto& boardField : boardValues.items()) { -@@ -979,9 +1041,32 @@ void postToDbus(const nlohmann::json& newConfiguration, +@@ -998,9 +1055,28 @@ void postToDbus(const nlohmann::json& newConfiguration, createInterface(objServer, boardName, boardField.key(), boardKeyOrig); @@ -258,16 +123,12 @@ index aa1df20..cd73675 100644 - iface, boardField.value(), objServer); + if (boardField.key() == "FoundProbe") + { -+ foundConn = boardField.value()["Connection"]; + foundPath = boardField.value()["Path"]; -+ foundIntf = boardField.value()["Interface"]; + } + if (boardField.key() == + "xyz.openbmc_project.Inventory.Decorator.AssetTag") + { -+ foundData["foundConn"] = foundConn; + foundData["foundPath"] = foundPath; -+ foundData["foundIntf"] = foundIntf; + mapFoundData[jsonPointerPath + boardField.key()] = + foundData; + @@ -285,63 +146,24 @@ index aa1df20..cd73675 100644 } } -@@ -1278,7 +1363,7 @@ void PerformScan::run() - auto thisRef = shared_from_this(); - auto probePointer = std::make_shared( - probeCommand, thisRef, -- [&, recordPtr, probeName](FoundDeviceT& foundDevices) { -+ [&, recordPtr, probeName](FoundDeviceInfoT& foundDevices) { - _passed = true; - - std::set usedNames; -@@ -1294,7 +1379,8 @@ void PerformScan::run() - for (auto itr = foundDevices.begin(); - itr != foundDevices.end();) - { -- std::string recordName = getRecordName(*itr, probeName); -+ std::string recordName = -+ getRecordName(std::get<0>(*itr), probeName); - - auto fromLastJson = lastJson.find(recordName); - if (fromLastJson != lastJson.end()) -@@ -1328,6 +1414,15 @@ void PerformScan::run() +@@ -1349,6 +1425,10 @@ void PerformScan::run() continue; } + nlohmann::json recordVal = *recordPtr; -+ // Save the dbus connection, path and interface info -+ // of the device -+ recordVal[foundObject]["Connection"] = -+ std::get<1>(*itr); -+ recordVal[foundObject]["Path"] = std::get<2>(*itr); -+ recordVal[foundObject]["Interface"] = -+ std::get<3>(*itr); ++ // Save the dbus path info of the device ++ recordVal[foundObject]["Path"] = std::get<1>(*itr); + int index = std::stoi( nameIt->get().substr(indexIdx), nullptr, 0); -@@ -1349,8 +1444,9 @@ void PerformScan::run() - - std::optional replaceStr; - -- for (auto& foundDevice : foundDevices) -+ for (auto& foundDeviceInfo : foundDevices) - { -+ auto& foundDevice = std::get<0>(foundDeviceInfo); - nlohmann::json record = *recordPtr; - std::string recordName = - getRecordName(foundDevice, probeName); -@@ -1382,6 +1478,14 @@ void PerformScan::run() +@@ -1421,6 +1501,10 @@ void PerformScan::run() } } -+ // Save the dbus connection, path and interface info -+ // of the device -+ record[foundObject]["Connection"] = -+ std::get<1>(foundDeviceInfo); -+ record[foundObject]["Path"] = std::get<2>(foundDeviceInfo); -+ record[foundObject]["Interface"] = -+ std::get<3>(foundDeviceInfo); ++ // Save the dbus path info of the device ++ record[foundObject]["Path"] = ++ std::get<1>(foundDeviceAndPath); + if (replaceStr) { diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0003-Add-logs-to-fwVersionIsSame.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0003-Add-logs-to-fwVersionIsSame.patch new file mode 100644 index 000000000..94af67967 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0003-Add-logs-to-fwVersionIsSame.patch @@ -0,0 +1,56 @@ +From 28525b56161e1b659e85e85c33fc00dc397758aa Mon Sep 17 00:00:00 2001 +From: Helen Huang +Date: Mon, 19 Apr 2021 16:06:15 +0800 +Subject: [PATCH] Add logs to fwVersionIsSame() + +Add logs to fwVersionIsSame() to indicate whether the firmware +version is changed or not. + +Tested: +Logs are printed as expected when firmware updating and BMC rebooting. + +Log of rebooting: +The firmware version is similiar as the last boot, +Hash value of versionFile is:3336889560 + +Log of Firmware update: +The firmware version is changed since the last boot, +hash value of current versionFile is:3336889560, +hash value of versionFile of last boot is:834871226 + +Change-Id: I5306917329d2e2e015af58cad1e9c59881f0b217 +Signed-off-by: Helen Huang +--- + include/Utils.hpp | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/include/Utils.hpp b/include/Utils.hpp +index 657af92..8238807 100644 +--- a/include/Utils.hpp ++++ b/include/Utils.hpp +@@ -116,13 +116,22 @@ inline bool fwVersionIsSame(void) + + if (expectedHash == hashString) + { ++ std::cout << "The firmware version is similiar as the last boot, " ++ "hash value of versionFile is:" ++ << hashString.c_str() << "\n"; + return true; + } ++ std::cout << "The firmware version is changed since the last boot, hash " ++ "value of current versionFile is:" ++ << expectedHash.c_str() ++ << ", hash value of versionFile of last boot is:" ++ << hashString.c_str() << "\n"; + hashFile.close(); + } + + std::ofstream output(versionHashFile); + output << expectedHash; ++ + return false; + } + +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend index 94bddf2be..9d891c620 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend @@ -1,10 +1,11 @@ # this is here just to bump faster than upstream # SRC_URI = "git://github.com/openbmc/entity-manager.git" -SRCREV = "296667f0076888f3cdf898a3f2cdf66da260853e" +SRCREV = "1694ef625a1075599e40faa695a40d61ccd91095" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += " file://0001-Improve-initialization-of-I2C-sensors.patch \ file://0002-Entity-manager-Add-support-to-update-assetTag.patch \ + file://0003-Add-logs-to-fwVersionIsSame.patch \ " diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/console/obmc-console/obmc-console@.service b/meta-openbmc-mods/meta-common/recipes-phosphor/console/obmc-console/obmc-console@.service index 7fb8f79d3..a242dba08 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/console/obmc-console/obmc-console@.service +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/console/obmc-console/obmc-console@.service @@ -5,15 +5,8 @@ After=dev-%i.device [Service] ExecStartPre=/usr/bin/sol-option-check.sh -ExecStartPre=/bin/sh -c 'echo -n "uart3" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart1' -ExecStartPre=/bin/sh -c 'echo -n "uart1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart3' -ExecStartPre=/bin/sh -c 'echo -n "io1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart4' -ExecStartPre=/bin/sh -c 'echo -n "uart4" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/io1' ExecStart=/usr/bin/env obmc-console-server --config {sysconfdir}/obmc-console.conf %i -ExecStopPost=/bin/sh -c 'echo -n "io1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart1' -ExecStopPost=/bin/sh -c 'echo -n "io3" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart3' -ExecStopPost=/bin/sh -c 'echo -n "io4" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart4' -ExecStopPost=/bin/sh -c 'echo -n "uart1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/io1' +ExecStopPost=/bin/sh -c 'echo -n "0" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/raw' SyslogIdentifier=obmc-console-server Restart=always diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend index 1aa090f54..e935531ee 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend @@ -1,7 +1,7 @@ # Keep this as a comment to enable the auto-bump script without # stomping on SRC_URI from previous .bbappend files #SRC_URI = "git://github.com/openbmc/phosphor-dbus-interfaces.git" -SRCREV = "ae956ad9efd2be24c5439a4ef6498fb5c8383719" +SRCREV = "33458d4432a8323616622881f314a73cf0b04d97" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend index d988b7c93..ab1cd3742 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend @@ -5,6 +5,6 @@ SYSTEMD_SERVICE_${PN} = "phosphor-pid-control.service" EXTRA_OECONF = "--enable-configure-dbus=yes" SRC_URI = "git://github.com/openbmc/phosphor-pid-control.git" -SRCREV = "d11a732a802cc281f4c1583275871fbc5f5ecced" +SRCREV = "cb4c1a27574a7fe121a851ae7ba67aec254a1129" FILES_${PN} = "${bindir}/swampd ${bindir}/setsensor" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0015-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0015-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch deleted file mode 100644 index 54efbee8c..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0015-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch +++ /dev/null @@ -1,153 +0,0 @@ -From f2dd5e13a0774d8683542798dd96979f9d7a6691 Mon Sep 17 00:00:00 2001 -From: Vernon Mauery -Date: Tue, 29 Sep 2020 13:38:35 -0700 -Subject: [PATCH] Fix delete image by ID and inhibit removal of bmc_active - -Delete image by ID was broken because when hitting the delete dbus -interface, it recalculated the ID from the parent version, which then -does not match because of the random number addition that was added to -the ID when the parent interface was created. This saves away the parent -interface ID and recalls it rather than recalculating it. - -Also, there was a logic error in deleting images that would delete the -active BMC image. This fixes up that error. - -Tested: run multiple back-to back updates and see that when the fwupd - script calls delete on the seamless images, the interfaces are - deleted and that the bmc_active interface is not deleted. - -Signed-off-by: Vernon Mauery ---- - item_updater.cpp | 17 +++++++++++------ - pfr_image_manager.cpp | 2 +- - version.cpp | 2 +- - version.hpp | 19 +++++++++++++++---- - 4 files changed, 28 insertions(+), 12 deletions(-) - -diff --git a/item_updater.cpp b/item_updater.cpp -index db255d6..90970d3 100644 ---- a/item_updater.cpp -+++ b/item_updater.cpp -@@ -133,7 +133,7 @@ void ItemUpdater::createActivation(sdbusplus::message::message& msg) - activationState, associations))); - - auto versionPtr = std::make_unique( -- bus, path, version, purpose, filePath, -+ bus, path, versionId, version, purpose, filePath, - std::bind(&ItemUpdater::erase, this, std::placeholders::_1)); - versionPtr->deleteObject = - std::make_unique(bus, path, -@@ -247,7 +247,7 @@ void ItemUpdater::processBMCImage() - - // Create Version instance for this version. - auto versionPtr = std::make_unique( -- bus, path, version, purpose, "", -+ bus, path, id, version, purpose, "", - std::bind(&ItemUpdater::erase, this, std::placeholders::_1)); - auto isVersionFunctional = versionPtr->isFunctional(); - if (!isVersionFunctional) -@@ -322,11 +322,11 @@ void ItemUpdater::erase(std::string entryId) - auto it = versions.find(entryId); - if (it != versions.end()) - { -- if (it->second->isFunctional() && ACTIVE_BMC_MAX_ALLOWED > 1) -+ if (it->second->isFunctional()) - { -- log("Error: Version is currently running on the BMC. " -- "Unable to remove.", -- entry("VERSIONID=%s", entryId.c_str())); -+ log("Error: Version is currently running on the BMC. " -+ "Unable to remove.", -+ entry("VERSIONID=%s", entryId.c_str())); - return; - } - } -@@ -669,6 +669,11 @@ void ItemUpdater::freeSpace(Activation& caller) - std::size_t count = 0; - for (const auto& iter : activations) - { -+ if (versions.find(iter.second->versionId)->second->isFunctional()) -+ { -+ // don't bother with function versions -+ continue; -+ } - if ((iter.second.get()->activation() == - server::Activation::Activations::Active) || - (iter.second.get()->activation() == -diff --git a/pfr_image_manager.cpp b/pfr_image_manager.cpp -index 145237e..0c6c3d8 100644 ---- a/pfr_image_manager.cpp -+++ b/pfr_image_manager.cpp -@@ -308,7 +308,7 @@ int Manager::processImage(const std::string& imgFilePath) - std::string objPath = std::string{SOFTWARE_OBJPATH} + '/' + id; - - auto versionPtr = std::make_unique( -- bus, objPath, ver, purpose, imageDirPath.string(), -+ bus, objPath, id, ver, purpose, imageDirPath.string(), - std::bind(&Manager::erase, this, std::placeholders::_1)); - versionPtr->deleteObject = - std::make_unique(bus, objPath, -diff --git a/version.cpp b/version.cpp -index 18f3f4f..e6fd481 100644 ---- a/version.cpp -+++ b/version.cpp -@@ -182,7 +182,7 @@ void Delete::delete_() - { - if (parent.eraseCallback) - { -- parent.eraseCallback(parent.getId(parent.version())); -+ parent.eraseCallback(parent.getExtId()); - } - } - -diff --git a/version.hpp b/version.hpp -index 9cf76da..ae70ea8 100644 ---- a/version.hpp -+++ b/version.hpp -@@ -74,14 +74,15 @@ class Version : public VersionInherit - * @param[in] callback - The eraseFunc callback - */ - Version(sdbusplus::bus::bus& bus, const std::string& objPath, -- const std::string& versionString, VersionPurpose versionPurpose, -- const std::string& filePath, eraseFunc callback) : -+ const std::string& extId, const std::string& versionString, -+ VersionPurpose versionPurpose, const std::string& filePath, -+ eraseFunc callback) : - VersionInherit(bus, (objPath).c_str(), true), -- eraseCallback(callback), versionStr(versionString) -+ eraseCallback(callback), extId(extId), versionStr(versionString) - { - // Set properties. - purpose(versionPurpose); -- version(versionString); -+ version(extId); - path(filePath); - // Emit deferred signal. - emit_object_added(); -@@ -134,6 +135,15 @@ class Version : public VersionInherit - */ - bool isFunctional(); - -+ /* @brief Return the extended ID of this version object -+ * -+ * @ return - returns the extended ID string -+ */ -+ std::string getExtId() -+ { -+ return extId; -+ } -+ - /** @brief Persistent Delete D-Bus object */ - std::unique_ptr deleteObject; - -@@ -143,6 +153,7 @@ class Version : public VersionInherit - private: - /** @brief This Version's version string */ - const std::string versionStr; -+ const std::string extId; - }; - - } // namespace manager --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0018-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0018-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch new file mode 100644 index 000000000..587421044 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0018-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch @@ -0,0 +1,175 @@ +From 19661c1173d9d82dfbb879f8cc89c05a0883dffa Mon Sep 17 00:00:00 2001 +From: AppaRao Puli +Date: Wed, 21 Apr 2021 21:16:47 +0000 +Subject: [PATCH] Fix delete image by ID and inhibit removal of bmc_active + +Delete image by ID was broken because when hitting the delete dbus +interface, it recalculated the ID from the parent version, which then +does not match because of the random number addition that was added +to the ID when the parent interface was created. This saves away the +parent interface ID and recalls it rather than recalculating it. + +Also, there was a logic error in deleting images that would delete the +active BMC image. This fixes up that error. + +Tested: run multiple back-to back updates and see that when the fwupd + script calls delete on the seamless images, the interfaces are + deleted and that the bmc_active interface is not deleted. + +Signed-off-by: Vernon Mauery +Signed-off-by: AppaRao Puli +--- + image_manager.cpp | 2 +- + item_updater.cpp | 20 +++++++++++++------- + pfr_image_manager.cpp | 2 +- + version.cpp | 2 +- + version.hpp | 19 +++++++++++++++---- + 5 files changed, 31 insertions(+), 14 deletions(-) + +diff --git a/image_manager.cpp b/image_manager.cpp +index 4be357f..311a63f 100644 +--- a/image_manager.cpp ++++ b/image_manager.cpp +@@ -219,7 +219,7 @@ int Manager::processImage(const std::string& tarFilePath) + { + // Create Version object + auto versionPtr = std::make_unique( +- bus, objPath, version, purpose, extendedVersion, ++ bus, objPath, id, version, purpose, extendedVersion, + imageDirPath.string(), + std::bind(&Manager::erase, this, std::placeholders::_1)); + versionPtr->deleteObject = +diff --git a/item_updater.cpp b/item_updater.cpp +index 6efd519..6685bf5 100644 +--- a/item_updater.cpp ++++ b/item_updater.cpp +@@ -145,7 +145,7 @@ void ItemUpdater::createActivation(sdbusplus::message::message& msg) + activationState, associations))); + + auto versionPtr = std::make_unique( +- bus, path, version, purpose, extendedVersion, filePath, ++ bus, path, versionId, version, purpose, extendedVersion, filePath, + std::bind(&ItemUpdater::erase, this, std::placeholders::_1)); + versionPtr->deleteObject = + std::make_unique(bus, path, +@@ -263,7 +263,7 @@ void ItemUpdater::processBMCImage() + + // Create Version instance for this version. + auto versionPtr = std::make_unique( +- bus, path, version, purpose, extendedVersion, "", ++ bus, path, id, version, purpose, extendedVersion, "", + std::bind(&ItemUpdater::erase, this, std::placeholders::_1)); + auto isVersionFunctional = versionPtr->isFunctional(); + if (!isVersionFunctional) +@@ -338,11 +338,11 @@ void ItemUpdater::erase(std::string entryId) + auto it = versions.find(entryId); + if (it != versions.end()) + { +- if (it->second->isFunctional() && ACTIVE_BMC_MAX_ALLOWED > 1) ++ if (it->second->isFunctional()) + { +- log("Error: Version is currently running on the BMC. " +- "Unable to remove.", +- entry("VERSIONID=%s", entryId.c_str())); ++ log("Error: Version is currently running on the BMC. " ++ "Unable to remove.", ++ entry("VERSIONID=%s", entryId.c_str())); + return; + } + } +@@ -681,6 +681,12 @@ void ItemUpdater::freeSpace(Activation& caller) + std::size_t count = 0; + for (const auto& iter : activations) + { ++ if (versions.find(iter.second->versionId)->second->isFunctional()) ++ { ++ // don't bother with function versions ++ continue; ++ } ++ + if ((iter.second.get()->activation() == + server::Activation::Activations::Active) || + (iter.second.get()->activation() == +@@ -775,7 +781,7 @@ void ItemUpdater::createBIOSObject() + // Do nothing; + }; + biosVersion = std::make_unique( +- bus, path, version, VersionPurpose::Host, "", "", ++ bus, path, versionId, version, VersionPurpose::Host, "", "", + std::bind(dummyErase, std::placeholders::_1)); + biosVersion->deleteObject = + std::make_unique(bus, path, +diff --git a/pfr_image_manager.cpp b/pfr_image_manager.cpp +index 55ad21f..e2dcc80 100644 +--- a/pfr_image_manager.cpp ++++ b/pfr_image_manager.cpp +@@ -399,7 +399,7 @@ int Manager::processImage(const std::string& imgFilePath) + std::string objPath = std::string{SOFTWARE_OBJPATH} + '/' + id; + + auto versionPtr = std::make_unique( +- bus, objPath, ver, purpose, extVer, imageDirPath.string(), ++ bus, objPath, id, ver, purpose, extVer, imageDirPath.string(), + std::bind(&Manager::erase, this, std::placeholders::_1)); + versionPtr->deleteObject = + std::make_unique(bus, objPath, +diff --git a/version.cpp b/version.cpp +index 04f40c4..44ef571 100644 +--- a/version.cpp ++++ b/version.cpp +@@ -206,7 +206,7 @@ void Delete::delete_() + { + if (parent.eraseCallback) + { +- parent.eraseCallback(parent.getId(parent.version())); ++ parent.eraseCallback(parent.getExtId()); + } + } + +diff --git a/version.hpp b/version.hpp +index 8a68cb5..afc589c 100644 +--- a/version.hpp ++++ b/version.hpp +@@ -77,11 +77,11 @@ class Version : public VersionInherit + * @param[in] callback - The eraseFunc callback + */ + Version(sdbusplus::bus::bus& bus, const std::string& objPath, +- const std::string& versionString, VersionPurpose versionPurpose, +- const std::string& extVersion, const std::string& filePath, +- eraseFunc callback) : ++ const std::string& extId, const std::string& versionString, ++ VersionPurpose versionPurpose, const std::string& extVersion, ++ const std::string& filePath, eraseFunc callback) : + VersionInherit(bus, (objPath).c_str(), true), +- eraseCallback(callback), versionStr(versionString) ++ eraseCallback(callback), versionStr(versionString), extId(extId) + { + // Set properties. + extendedVersion(extVersion); +@@ -150,6 +150,15 @@ class Version : public VersionInherit + */ + bool isFunctional(); + ++ /* @brief Return the extended ID of this version object ++ * ++ * @ return - returns the extended ID string ++ */ ++ std::string getExtId() ++ { ++ return extId; ++ } ++ + /** @brief Persistent Delete D-Bus object */ + std::unique_ptr deleteObject; + +@@ -159,6 +168,8 @@ class Version : public VersionInherit + private: + /** @brief This Version's version string */ + const std::string versionStr; ++ /** @brief This is extended version string */ ++ const std::string extId; + }; + + } // namespace manager +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend index c71beebad..63e0aff25 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend @@ -24,6 +24,7 @@ SRC_URI_PFR = " \ file://0014-PFR-image-verification.patch \ file://0016-Process-PLDM-image-type.patch \ file://0017-Fix-build-error.patch \ + file://0018-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch \ " SRC_URI += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', SRC_URI_PFR, '', d)}" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/host/phosphor-host-postd_git.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/host/phosphor-host-postd_git.bbappend index a294ac520..ff30bacfb 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/host/phosphor-host-postd_git.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/host/phosphor-host-postd_git.bbappend @@ -1,4 +1,4 @@ DEPENDS += " gtest" #SRC_URI = "git://github.com/openbmc/phosphor-host-postd.git" -SRCREV = "e2abf4429059b7ee3f90cc07f233a66b3022a176" +SRCREV = "2a744b2d70ce9de8519a7c716da5009cb049db17" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Change-InsertMedia-action-response-for-POST-in-proxy.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Change-InsertMedia-action-response-for-POST-in-proxy.patch deleted file mode 100644 index d04220b89..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Change-InsertMedia-action-response-for-POST-in-proxy.patch +++ /dev/null @@ -1,30 +0,0 @@ -From dcc94627aac5b8e4ad181c8548391c53d27b8896 Mon Sep 17 00:00:00 2001 -From: Karol Wachowski -Date: Tue, 16 Feb 2021 06:47:11 +0000 -Subject: [PATCH] Change InsertMedia action response for POST in proxy mode - -Set boost::beast::http::status::method_not_allowed as a response -for POST request to Virtual Media Insert Media action to keep -consistency with other non existing requests. ---- - redfish-core/lib/virtual_media.hpp | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp -index 80e7315..76e8c4a 100644 ---- a/redfish-core/lib/virtual_media.hpp -+++ b/redfish-core/lib/virtual_media.hpp -@@ -611,10 +611,9 @@ class VirtualMediaActionInsertMedia : public Node - // Not possible in proxy mode - BMCWEB_LOG_DEBUG << "InsertMedia not " - "allowed in proxy mode"; -- messages::resourceNotFound( -- aResp->res, "VirtualMedia.InsertMedia", -- resName); -- -+ aResp->res.result( -+ boost::beast::http::status:: -+ method_not_allowed); - return; - } - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Invalid-status-code-from-InsertMedia-REST-methods.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Invalid-status-code-from-InsertMedia-REST-methods.patch new file mode 100644 index 000000000..c9a4119a1 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Invalid-status-code-from-InsertMedia-REST-methods.patch @@ -0,0 +1,182 @@ + +From 1bbabe4ecdeea20da809b9f1d8e194683629517c Mon Sep 17 00:00:00 2001 +From: Alicja Rybak +Date: Tue, 20 Apr 2021 16:32:37 +0200 +Subject: [PATCH] Invalid status code from InsertMedia REST methods GET, PUT, + DELETE, PATCH in proxy mode + +Add handlers for GET, PUT, DELETE, PATCH method and function that +checks which mode is used and set suitable status code: +Not allowed for Legacy and Not found for Proxy. + +Change-Id: Ib4c0a3e9a2a8853caa74c59239d9fcfed99c5e8b +Signed-off-by: Alicja Rybak +--- + redfish-core/lib/virtual_media.hpp | 154 +++++++++++++++++++++++++++++ + 1 file changed, 154 insertions(+) + +diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp +index 8353ce7..66bf220 100644 +--- a/redfish-core/lib/virtual_media.hpp ++++ b/redfish-core/lib/virtual_media.hpp +@@ -530,6 +530,160 @@ class VirtualMediaActionInsertMedia : public Node + return true; + } + ++ /** ++ * @brief Function checks if insert media request is Legacy or Proxy type ++ * and sets suitable response code for unsupported REST method. ++ * ++ */ ++ void CheckProxyMode(crow::Response& res, ++ const crow::Request& req, ++ const std::vector& params) ++ { ++ auto aResp = std::make_shared(res); ++ ++ if (params.size() != 2) ++ { ++ messages::internalError(res); ++ return; ++ } ++ ++ // take resource name from URL ++ const std::string& resName = params[1]; ++ ++ if (params[0] != "bmc") ++ { ++ messages::resourceNotFound(res, "VirtualMedia.Insert", resName); ++ ++ return; ++ } ++ ++ crow::connections::systemBus->async_method_call( ++ [this, aResp{std::move(aResp)}, req, ++ resName](const boost::system::error_code ec, ++ const GetObjectType& getObjectType) { ++ if (ec) ++ { ++ BMCWEB_LOG_ERROR << "ObjectMapper::GetObject call failed: " ++ << ec; ++ aResp->res.result( ++ boost::beast::http::status::not_found); ++ ++ return; ++ } ++ std::string service = getObjectType.begin()->first; ++ BMCWEB_LOG_DEBUG << "GetObjectType: " << service; ++ ++ crow::connections::systemBus->async_method_call( ++ [this, service, resName, req, ++ aResp{aResp}](const boost::system::error_code ec, ++ ManagedObjectType& subtree) { ++ if (ec) ++ { ++ BMCWEB_LOG_DEBUG << "DBUS response error"; ++ ++ return; ++ } ++ ++ for (auto& item : subtree) ++ { ++ std::string thispath = item.first.filename(); ++ if (thispath.empty()) ++ { ++ continue; ++ } ++ ++ if (thispath != resName) ++ { ++ continue; ++ } ++ ++ auto mode = item.first.parent_path(); ++ auto type = mode.parent_path(); ++ if (mode.filename().empty() || ++ type.filename().empty()) ++ { ++ continue; ++ } ++ ++ if (type.filename() != "VirtualMedia") ++ { ++ continue; ++ } ++ ++ // Check if dbus path is Legacy type ++ if (mode.filename() == "Legacy") ++ { ++ BMCWEB_LOG_DEBUG << "InsertMedia only allowed " ++ "with POST method " ++ "in legacy mode"; ++ aResp->res.result( ++ boost::beast::http::status:: ++ method_not_allowed); ++ ++ return; ++ } ++ // Check if dbus path is Proxy type ++ if (mode.filename() == "Proxy") ++ { ++ // Not possible in proxy mode ++ BMCWEB_LOG_DEBUG << "InsertMedia not " ++ "allowed in proxy mode"; ++ aResp->res.result( ++ boost::beast::http::status::not_found); ++ ++ return; ++ } ++ } ++ ++ BMCWEB_LOG_DEBUG << "Parent item not found"; ++ aResp->res.result( ++ boost::beast::http::status::not_found); ++ }, ++ service, "/xyz/openbmc_project/VirtualMedia", ++ "org.freedesktop.DBus.ObjectManager", "GetManagedObjects"); ++ }, ++ "xyz.openbmc_project.ObjectMapper", ++ "/xyz/openbmc_project/object_mapper", ++ "xyz.openbmc_project.ObjectMapper", "GetObject", ++ "/xyz/openbmc_project/VirtualMedia", std::array()); ++ } ++ ++ /** ++ * @brief Function handles GET method request. ++ */ ++ void doGet(crow::Response& res, const crow::Request& req, ++ const std::vector& params) override ++ { ++ CheckProxyMode(res, req, params); ++ } ++ ++ /** ++ * @brief Function handles PATCH method request. ++ */ ++ void doPatch(crow::Response& res, const crow::Request& req, ++ const std::vector& params) override ++ { ++ CheckProxyMode(res, req, params); ++ } ++ ++ /** ++ * @brief Function handles PUT method request. ++ */ ++ void doPut(crow::Response& res, const crow::Request& req, ++ const std::vector& params) override ++ { ++ CheckProxyMode(res, req, params); ++ } ++ ++ /** ++ * @brief Function handles DELETE method request. ++ */ ++ void doDelete(crow::Response& res, const crow::Request& req, ++ const std::vector& params) override ++ { ++ CheckProxyMode(res, req, params); ++ } ++ + /** + * @brief Function handles POST method request. + * diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0004-Bmcweb-handle-permission-denied-exception.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0004-Bmcweb-handle-permission-denied-exception.patch new file mode 100644 index 000000000..074718349 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0004-Bmcweb-handle-permission-denied-exception.patch @@ -0,0 +1,44 @@ +From 81f2c022b22ef75990f30e5ba5bfd4ba5bd41754 Mon Sep 17 00:00:00 2001 +From: Alicja Rybak +Date: Wed, 14 Apr 2021 16:26:59 +0200 +Subject: [PATCH] Bmcweb handle permission denied exception + +Add handling of permission denied exception (EPERM) that +can be thrown by VirtualMedia service during Mount/Unmount dbus operations. + +Tested: +Verified that after mounting/unmounting HTTPS resource twice in a row in legacy mode, +VirtualMedia returns EPERM, which bmcweb handles as 403 status code. + +Change-Id: Ibc18d5ec822c5072605b1fc4651389982002798b +Signed-off-by: Alicja Rybak +--- + redfish-core/lib/virtual_media.hpp | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp +index 365290b..bbdc91b 100644 +--- a/redfish-core/lib/virtual_media.hpp ++++ b/redfish-core/lib/virtual_media.hpp +@@ -900,6 +900,10 @@ class VirtualMediaActionInsertMedia : public Node + { + messages::resourceInUse(asyncResp->res); + } ++ else if (ec == boost::system::errc::permission_denied) ++ { ++ messages::accessDenied(asyncResp->res, "VirtualMedia.Insert"); ++ } + else + { + messages::internalError(asyncResp->res); +@@ -1092,6 +1096,10 @@ class VirtualMediaActionEjectMedia : public Node + { + messages::resourceInUse(asyncResp->res); + } ++ else if (ec == boost::system::errc::permission_denied) ++ { ++ messages::accessDenied(asyncResp->res, "VirtualMedia.Eject"); ++ } + else + { + messages::internalError(asyncResp->res); diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0005-Fix-unmounting-image-in-proxy-mode.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0005-Fix-unmounting-image-in-proxy-mode.patch new file mode 100644 index 000000000..acfd9225b --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0005-Fix-unmounting-image-in-proxy-mode.patch @@ -0,0 +1,32 @@ +From 9493bb8e2f5c708e187313c86e6033de5f103c51 Mon Sep 17 00:00:00 2001 +From: Alicja Rybak +Date: Fri, 23 Apr 2021 17:35:52 +0200 +Subject: [PATCH] Fix unmounting image in proxy mode. + +Sometimes Slot0 got higher key than Slot1 and erase function for Slot1 +invalidates elements with keys not less than the erased element. +In that case invalid slot0 will be unmounted. +Change order of calling close() and erase() functions to +unmount correct device. + +Change-Id: I7a40a4518982f697d3eed635cde6d06978149cf0 +Signed-off-by: Alicja Rybak +--- + include/nbd_proxy.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/nbd_proxy.hpp b/include/nbd_proxy.hpp +index 7b90e90..fa7f647 100644 +--- a/include/nbd_proxy.hpp ++++ b/include/nbd_proxy.hpp +@@ -428,9 +428,9 @@ inline void requestRoutes(App& app) + BMCWEB_LOG_DEBUG << "No session to close"; + return; + } ++ session->second->close(); + // Remove reference to session in global map + sessions.erase(session); +- session->second->close(); + }) + .onmessage([](crow::websocket::Connection& conn, + const std::string& data, bool) { diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0011-bmcweb-Add-PhysicalContext-to-Thermal-resources.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0011-bmcweb-Add-PhysicalContext-to-Thermal-resources.patch new file mode 100644 index 000000000..e52dff3f4 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0011-bmcweb-Add-PhysicalContext-to-Thermal-resources.patch @@ -0,0 +1,135 @@ +From b9747ecfce682f15dce0bb6e41e0c894f29419f3 Mon Sep 17 00:00:00 2001 +From: Snehalatha Venkatesh +Date: Thu, 8 Apr 2021 14:42:07 +0000 +Subject: [PATCH] bmcweb: Add PhysicalContext to Thermal resources + +Adding PhysicalContext to make redfish data compliance with OCP +Server Mgmt Interface v0.2.1.pdf and specific to Thermal resources. +https://github.com/opencomputeproject/OCP-Profiles/blob/master/ +OCPServerHardwareManagement.v0_2_4.json + +Tested: +1. Redfish validator - passed for this new change +2. GET - https:///redfish/v1/Chassis//Thermal +Response: +{ + "@odata.id": "/redfish/v1/Chassis//Thermal#/Temperatures/0", + "@odata.type": "#Thermal.v1_3_0.Temperature", + "LowerThresholdCritical": 0.0, + "LowerThresholdNonCritical": 5.0, + "MaxReadingRangeTemp": 127.0, + "MemberId": "BMC_Temp", + "MinReadingRangeTemp": -128.0, + "Name": "BMC Temp", + "PhysicalContext": "SystemBoard", + "ReadingCelsius": 25.75, + "Status": { + "Health": "OK", + "State": "Enabled" + }, + "UpperThresholdCritical": 115.0, + "UpperThresholdNonCritical": 110.0 +}, +{ + "@odata.id": "/redfish/v1/Chassis//Thermal#/Temperatures/1", + "@odata.type": "#Thermal.v1_3_0.Temperature", + "LowerThresholdCritical": 0.0, + "LowerThresholdNonCritical": 5.0, + "MaxReadingRangeTemp": 255.0, + "MemberId": "CPU1_P12V_PVCCIN_VR_Temp", + "MinReadingRangeTemp": 0.0, + "Name": "CPU1 P12V PVCCIN VR Temp", + "PhysicalContext": "CPU", + "ReadingCelsius": 41.0, + "Status": { + "Health": "OK", + "State": "Enabled" + }, + "UpperThresholdCritical": 115.0, + "UpperThresholdNonCritical": 110.0 +}, +{ + "@odata.id": "/redfish/v1/Chassis//Thermal#/Temperatures/28", + "@odata.type": "#Thermal.v1_3_0.Temperature", + "LowerThresholdCritical": 0.0, + "LowerThresholdNonCritical": 5.0, + "MaxReadingRangeTemp": 127.0, + "MemberId": "Inlet_BRD_Temp", + "MinReadingRangeTemp": -128.0, + "Name": "Inlet BRD Temp", + "PhysicalContext": "Intake", + "ReadingCelsius": 23.187, + "Status": { + "Health": "OK", + "State": "Enabled" + }, + "UpperThresholdCritical": 115.0, + "UpperThresholdNonCritical": 110.0 +} +3. GET - https:///redfish/v1/Chassis//Power +Response: +{ + "@odata.id": "/redfish/v1/Chassis//Power#/Voltages/3", + "@odata.type": "#Power.v1_0_0.Voltage", + "LowerThresholdCritical": 1.648, + "LowerThresholdNonCritical": 1.699, + "MaxReadingRange": 2.3984009912875566, + "MemberId": "P1V8_PCH", + "MinReadingRange": 0.0, + "Name": "P1V8 PCH", + "ReadingVolts": 1.8055, + "Status": { + "Health": "OK", + "State": "Enabled" + }, + "UpperThresholdCritical": 1.961, + "UpperThresholdNonCritical": 1.904 +} +4. GET - https:///redfish/v1/Chassis//Sensors/PSU1_Input_Current +Response: +{ + "@odata.id": "/redfish/v1/Chassis//Sensors/PSU1_Input_Current", + "@odata.type": "#Sensor.v1_0_0.Sensor", + "Id": "PSU1_Input_Current", + "Name": "PSU1 Input Current", + "Reading": 0.947, + "ReadingRangeMax": 12.0, + "ReadingRangeMin": 0.0, + "ReadingType": "Current", + "ReadingUnits": "A", + "Status": { + "Health": "OK", + "State": "Enabled" + } +} +Signed-off-by: Snehalatha Venkatesh +--- + redfish-core/lib/sensors.hpp | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp +index 9f06d2f..40fcdf8 100644 +--- a/redfish-core/lib/sensors.hpp ++++ b/redfish-core/lib/sensors.hpp +@@ -964,6 +964,18 @@ inline void objectInterfacesToJson( + { + unit = "/ReadingCelsius"_json_pointer; + sensorJson["@odata.type"] = "#Thermal.v1_3_0.Temperature"; ++ if (sensorName.find("CPU") != std::string::npos) ++ { ++ sensorJson["PhysicalContext"] = "CPU"; ++ } ++ else if (sensorName.find("Inlet") != std::string::npos) ++ { ++ sensorJson["PhysicalContext"] = "Intake"; ++ } ++ else ++ { ++ sensorJson["PhysicalContext"] = "SystemBoard"; ++ } + // TODO(ed) Documentation says that path should be type fan_tach, + // implementation seems to implement fan + } +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0012-Log-RedFish-event-for-Invalid-login-attempt.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0012-Log-RedFish-event-for-Invalid-login-attempt.patch new file mode 100644 index 000000000..3ef4ee2de --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0012-Log-RedFish-event-for-Invalid-login-attempt.patch @@ -0,0 +1,67 @@ +From 1f572a1991fc8d9b08689aa6e3470080467977a7 Mon Sep 17 00:00:00 2001 +From: Jayaprakash Mutyala +Date: Thu, 15 Apr 2021 10:59:42 +0000 +Subject: [PATCH] Log RedFish event for Invalid login attempt + +This commit adds support for logging RedFish event log while user tries +to attempt login with invalid credentials. +When user trying to login with invalid credentials on HTTPS interface +like WebUI and RedFish, event should be logged in RedFish event log. +This event log is useful for further analysis to debug the root-cause +for failure. + +Tested: +1. Verified RedFish validator passed +2. Login with wrong credentials on HTTPS interface. +3. Verified for RedFish/WebUI events. RedFish event logged successfully. +GET: https://BMC-IP/redfish/v1/Systems/system/LogServices/ + EventLog/Entries +Response: +"Members": [ +{ + "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/ + Entries/1618466128", + "@odata.type": "#LogEntry.v1_4_0.LogEntry", + "Created": "2021-04-15T05:55:28+00:00", + "EntryType": "Event", + "Id": "1618466128", + "Message": "Invalid username or password attempted on HTTPS.", + "MessageArgs": [ + "HTTPS" + ], + "MessageId": "OpenBMC.0.1.InvalidLoginAttempted", + "Name": "System Event Log Entry", + "Severity": "Warning" +} + +Signed-off-by: Jayaprakash Mutyala +--- + include/pam_authenticate.hpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/include/pam_authenticate.hpp b/include/pam_authenticate.hpp +index 12f19c0..01bf301 100644 +--- a/include/pam_authenticate.hpp ++++ b/include/pam_authenticate.hpp +@@ -1,6 +1,7 @@ + #pragma once + + #include ++#include + + #include + +@@ -75,6 +76,10 @@ inline int pamAuthenticateUser(const std::string_view username, + PAM_SILENT | PAM_DISALLOW_NULL_AUTHTOK); + if (retval != PAM_SUCCESS) + { ++ sd_journal_send("MESSAGE= %s", "Invalid login attempted on HTTPS", ++ "PRIORITY=%i", LOG_WARNING, "REDFISH_MESSAGE_ID=%s", ++ "OpenBMC.0.1.InvalidLoginAttempted", ++ "REDFISH_MESSAGE_ARGS=%s", "HTTPS", NULL); + pam_end(localAuthHandle, PAM_SUCCESS); // ignore retval + return retval; + } +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0013-Add-UART-routing-logic-into-host-console-connection-.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0013-Add-UART-routing-logic-into-host-console-connection-.patch new file mode 100644 index 000000000..8b0d90fe0 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0013-Add-UART-routing-logic-into-host-console-connection-.patch @@ -0,0 +1,59 @@ +From 6c10adb53d3247f65e5d9399290e6b8e7962cdef Mon Sep 17 00:00:00 2001 +From: Jae Hyun Yoo +Date: Wed, 28 Apr 2021 17:19:50 -0700 +Subject: [PATCH] Add UART routing logic into host console connection flow + +Switching UART routing when starting obmc-service introduces garbled +character printing out on physical host serial output and it's +inevitable so this commit moves the routing logic into host console +connection flow in bmcweb to avoid the issue until SOL is actually +activated. + +Tested: The garbled character printing out was not observed during +BMC booting. SOL worked well. + +Signed-off-by: Jae Hyun Yoo +--- + include/obmc_console.hpp | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/include/obmc_console.hpp b/include/obmc_console.hpp +index cdb19901e82d..9c4ae8821074 100644 +--- a/include/obmc_console.hpp ++++ b/include/obmc_console.hpp +@@ -22,6 +22,9 @@ static boost::container::flat_set sessions; + + static bool doingWrite = false; + ++constexpr char const* uartMuxCtrlPath = "/sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/raw"; ++constexpr char const* uartMuxCtrlVal = "0x03450003"; ++ + inline void doWrite() + { + if (doingWrite) +@@ -110,6 +113,22 @@ inline void connectHandler(const boost::system::error_code& ec) + return; + } + ++ FILE* file = fopen(uartMuxCtrlPath, "w"); ++ if (file != nullptr) ++ { ++ int rc = fputs(uartMuxCtrlVal, file); ++ fclose(file); ++ if (rc < 0) ++ { ++ BMCWEB_LOG_ERROR << "Couldn't change UART routing: " << rc; ++ for (crow::websocket::Connection* session : sessions) ++ { ++ session->close("Error in connecting to host port"); ++ } ++ return; ++ } ++ } ++ + doWrite(); + doRead(); + } +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-bmcweb-crashes-if-socket-directory-not-present.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-bmcweb-crashes-if-socket-directory-not-present.patch new file mode 100644 index 000000000..bc023839f --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-bmcweb-crashes-if-socket-directory-not-present.patch @@ -0,0 +1,44 @@ +From 48fe2a68d634970795f9ff13903afbedca801088 Mon Sep 17 00:00:00 2001 +From: Nidhin MS +Date: Wed, 14 Apr 2021 11:28:44 +0530 +Subject: [PATCH] Fix: bmcweb crashes if socket directory not present + +When trying to mount virtual media image bmcweb tries to create unix +socket and if the parent directory does not exist +stream_protocol::acceptor throws error and bmcweb crashes. Fix the same + +Tested: +Removed directory and mounted the vm image. bmcweb crash was not +observed + +Change-Id: I3aea1d8e197c06238f425a97435c01d3c80552a9 +Signed-off-by: Nidhin MS +--- + include/nbd_proxy.hpp | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/include/nbd_proxy.hpp b/include/nbd_proxy.hpp +index 7b90e90..3b28823 100644 +--- a/include/nbd_proxy.hpp ++++ b/include/nbd_proxy.hpp +@@ -397,6 +397,17 @@ inline void requestRoutes(App& app) + // If the socket file exists (i.e. after bmcweb crash), + // we cannot reuse it. + std::remove((*socketValue).c_str()); ++ std::filesystem::path socketPath(*socketValue); ++ std::error_code fsErr; ++ if (!std::filesystem::exists(socketPath.parent_path(), ++ fsErr)) ++ { ++ BMCWEB_LOG_ERROR ++ << "VirtualMedia socket directory not present. " ++ << socketPath.parent_path(); ++ conn.close("Unable to create unix socket"); ++ return; ++ } + + sessions[&conn] = std::make_shared( + conn, *socketValue, *endpointValue, +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-comparison-for-proxy-legacy-mode.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-comparison-for-proxy-legacy-mode.patch new file mode 100644 index 000000000..f02e5e1a4 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-comparison-for-proxy-legacy-mode.patch @@ -0,0 +1,51 @@ +From 7cde56820505a4f750cc67caa0dc9300688f3fd9 Mon Sep 17 00:00:00 2001 +From: Przemyslaw Czarnowski +Date: Tue, 13 Apr 2021 15:16:43 +0200 +Subject: [PATCH] Fix comparison for proxy/legacy mode + +After sdbusplus made available string path wrapper VM code has been +updated to use it. This makes legacy mode unusable as appropriate +change introduced a problem with comparison of DBus object path, which +is now fixed. + +Tested: +After applying this fix, legacy mode has InsertMedia action enabled +again. + +Change-Id: I062994f23b77cb7ab9c4421f296a65a80b9ce896 +Signed-off-by: Przemyslaw Czarnowski +--- + redfish-core/lib/virtual_media.hpp | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp +index 365290b..dda73d8 100644 +--- a/redfish-core/lib/virtual_media.hpp ++++ b/redfish-core/lib/virtual_media.hpp +@@ -274,10 +274,22 @@ static void getVmData(const std::shared_ptr& aResp, + continue; + } + ++ auto mode = item.first.parent_path(); ++ auto type = mode.parent_path(); ++ if (mode.filename().empty() || type.filename().empty()) ++ { ++ continue; ++ } ++ ++ if (type.filename() != "VirtualMedia") ++ { ++ continue; ++ } ++ + aResp->res.jsonValue = vmItemTemplate(name, resName); + + // Check if dbus path is Legacy type +- if (thispath.find("VirtualMedia/Legacy") != std::string::npos) ++ if (mode.filename() == "Legacy") + { + aResp->res.jsonValue["Actions"]["#VirtualMedia.InsertMedia"] + ["target"] = +-- +2.26.2 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0003-Move-EventService-init-to-later-stage.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0003-Move-EventService-init-to-later-stage.patch deleted file mode 100644 index f910915ce..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0003-Move-EventService-init-to-later-stage.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 2dcfef0170ca5ba1f934de6934db64b545ab3b55 Mon Sep 17 00:00:00 2001 -From: AppaRao Puli -Date: Tue, 23 Mar 2021 23:36:40 +0000 -Subject: [PATCH] Move EventService init to later stage - -The bmcweb crash issue seen when there is eventservice -config with subscriptions in persistent file. - -During EventService instantiation, it uses the "get_io_context()" -from systemBus, so it should be called after systemBus init. So -moved the EventService instantiation after systemBus initialization. - -Tested: - - bmcweb crash issue resolved. - -Signed-off-by: AppaRao Puli -Change-Id: Iab52f0e89478e306af475066fb5691153a05677d ---- - src/webserver_main.cpp | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp -index 3b9631a..f0e2207 100644 ---- a/src/webserver_main.cpp -+++ b/src/webserver_main.cpp -@@ -80,9 +80,6 @@ int main(int /*argc*/, char** /*argv*/) - #ifdef BMCWEB_ENABLE_REDFISH - crow::redfish::requestRoutes(app); - redfish::RedfishService redfish(app); -- -- // Create EventServiceManager instance and initialize Config -- redfish::EventServiceManager::getInstance(); - #endif - - #ifdef BMCWEB_ENABLE_DBUS_REST -@@ -116,6 +113,11 @@ int main(int /*argc*/, char** /*argv*/) - crow::connections::systemBus = - std::make_shared(*io); - -+#ifdef BMCWEB_ENABLE_REDFISH -+ // Create EventServiceManager instance and initialize Config -+ redfish::EventServiceManager::getInstance(); -+#endif -+ - #ifdef BMCWEB_ENABLE_VM_NBDPROXY - crow::nbd_proxy::requestRoutes(app); - #endif --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0005-Add-SSE-style-subscription-support-to-eventservice.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0005-Add-SSE-style-subscription-support-to-eventservice.patch index e2eaf1761..02d28833f 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0005-Add-SSE-style-subscription-support-to-eventservice.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0005-Add-SSE-style-subscription-support-to-eventservice.patch @@ -1,4 +1,4 @@ -From dbaf8c1dc402da97fec723d050e063cd283d8736 Mon Sep 17 00:00:00 2001 +From 698d2615c5bc30ab7f89f11ed5659df8bf248ea0 Mon Sep 17 00:00:00 2001 From: AppaRao Puli Date: Tue, 16 Mar 2021 15:37:24 +0000 Subject: [PATCH 5/6] Add SSE style subscription support to eventservice @@ -126,10 +126,10 @@ index 0000000..6c98e6e +} // namespace eventservice_sse +} // namespace redfish diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp -index 148c703..e3eba86 100644 +index 5821e2e..f4d57c2 100644 --- a/redfish-core/include/event_service_manager.hpp +++ b/redfish-core/include/event_service_manager.hpp -@@ -22,13 +22,15 @@ +@@ -23,13 +23,15 @@ #include #include @@ -146,7 +146,7 @@ index 148c703..e3eba86 100644 #include #include #include -@@ -45,9 +47,13 @@ using EventServiceConfig = std::tuple; +@@ -46,9 +48,13 @@ using EventServiceConfig = std::tuple; static constexpr const char* eventFormatType = "Event"; static constexpr const char* metricReportFormatType = "MetricReport"; @@ -160,8 +160,8 @@ index 148c703..e3eba86 100644 #ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES static std::optional inotifyConn; static constexpr const char* redfishEventLogDir = "/var/log"; -@@ -390,11 +396,9 @@ class Subscription - path); +@@ -391,11 +397,9 @@ class Subscription + path, uriProto); } - Subscription(const std::shared_ptr& adaptor) : @@ -175,7 +175,7 @@ index 148c703..e3eba86 100644 ~Subscription() = default; -@@ -419,7 +423,7 @@ class Subscription +@@ -420,7 +424,7 @@ class Subscription if (sseConn != nullptr) { @@ -184,7 +184,7 @@ index 148c703..e3eba86 100644 } } -@@ -509,6 +513,7 @@ class Subscription +@@ -510,6 +514,7 @@ class Subscription this->sendEvent( msg.dump(2, ' ', true, nlohmann::json::error_handler_t::replace)); @@ -192,7 +192,7 @@ index 148c703..e3eba86 100644 } #endif -@@ -579,14 +584,39 @@ class Subscription +@@ -565,14 +570,39 @@ class Subscription return eventSeqNum; } @@ -233,7 +233,7 @@ index 148c703..e3eba86 100644 }; static constexpr const bool defaultEnabledState = true; -@@ -977,6 +1007,8 @@ class EventServiceManager +@@ -963,6 +993,8 @@ class EventServiceManager subValue->updateRetryConfig(retryAttempts, retryTimeoutInterval); subValue->updateRetryPolicy(); @@ -242,7 +242,7 @@ index 148c703..e3eba86 100644 return id; } -@@ -1001,11 +1033,40 @@ class EventServiceManager +@@ -987,11 +1019,40 @@ class EventServiceManager } } @@ -603,7 +603,7 @@ index be6f04d..1875ec9 100644 {{"@odata.id", "/redfish/v1/EventService/Subscriptions"}}}, {"Actions", diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp -index 3b9631a..bf8e705 100644 +index 902c32b..c871faa 100644 --- a/src/webserver_main.cpp +++ b/src/webserver_main.cpp @@ -5,6 +5,7 @@ @@ -614,14 +614,14 @@ index 3b9631a..bf8e705 100644 #include #include #include -@@ -79,6 +80,7 @@ int main(int /*argc*/, char** /*argv*/) - +@@ -83,6 +84,7 @@ int main(int /*argc*/, char** /*argv*/) #ifdef BMCWEB_ENABLE_REDFISH - crow::redfish::requestRoutes(app); -+ redfish::eventservice_sse::requestRoutes(app); + redfish::requestRoutes(app); redfish::RedfishService redfish(app); ++ redfish::eventservice_sse::requestRoutes(app); // Create EventServiceManager instance and initialize Config + redfish::EventServiceManager::getInstance(); -- 2.17.1 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0006-Add-EventService-SSE-filter-support.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0006-Add-EventService-SSE-filter-support.patch index e83e05c96..4d99b2754 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0006-Add-EventService-SSE-filter-support.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0006-Add-EventService-SSE-filter-support.patch @@ -1,4 +1,4 @@ -From 693de7b901e7618585e0e8d848fc37fa0cccd18e Mon Sep 17 00:00:00 2001 +From 82185c52ae6e27cc1e086654a3b7d10e63ecc783 Mon Sep 17 00:00:00 2001 From: AppaRao Puli Date: Wed, 17 Mar 2021 01:16:50 +0000 Subject: [PATCH 6/6] Add EventService SSE filter support @@ -171,10 +171,10 @@ index 7dfdc80..922dae9 100644 } // namespace redfish diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp -index e3eba86..8f120b1 100644 +index f4d57c2..567fb9c 100644 --- a/redfish-core/include/event_service_manager.hpp +++ b/redfish-core/include/event_service_manager.hpp -@@ -54,6 +54,11 @@ static constexpr const char* eventServiceFile = +@@ -55,6 +55,11 @@ static constexpr const char* eventServiceFile = static constexpr const uint8_t maxNoOfSubscriptions = 20; static constexpr const uint8_t maxNoOfSSESubscriptions = 10; @@ -202,7 +202,7 @@ index 1875ec9..4d1ac9f 100644 "TerminateAfterRetries", "SuspendRetries", "RetryForever"}; diff --git a/redfish-core/src/error_messages.cpp b/redfish-core/src/error_messages.cpp -index cfbc9c2..3493132 100644 +index 7059a38..1e3ef2f 100644 --- a/redfish-core/src/error_messages.cpp +++ b/redfish-core/src/error_messages.cpp @@ -2147,6 +2147,32 @@ void mutualExclusiveProperties(crow::Response& res, const std::string& arg1, diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/README b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/README index 55340bb5c..3954e89c1 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/README +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/README @@ -9,9 +9,6 @@ Upstream revision information: - EventService: https client support https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/31735/38 - - Move EventService init to later stage - https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/41516 - - Add Server-Sent-Events support https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/41258/5 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0001-Sync_ReadingUnit_with_Redfish_Sensor_Schema.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0001-Sync_ReadingUnit_with_Redfish_Sensor_Schema.patch deleted file mode 100644 index e3b25da90..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0001-Sync_ReadingUnit_with_Redfish_Sensor_Schema.patch +++ /dev/null @@ -1,227 +0,0 @@ -From 4b7e67d7200c0aba1b27478968d4f71449f1406a Mon Sep 17 00:00:00 2001 -From: "Wludzik, Jozef" -Date: Mon, 8 Mar 2021 14:35:54 +0000 -Subject: [PATCH] Sync ReadingUnit with Redfish Sensor Schema - -Actual attribute "ReadingUnits" does not match with Redfish Sensor -Schema. This change match "ReadingUnits" with Redfish Sensor Scheme -1.0.0 and add missing "ReadingType" attribute. This change affect all -users that depends on old units that does not match with Redfish -standard. Added toReadingType and toReadingUnit function that uses -values taken from Redfish Sensor Scheme 1.0.0. Latest version 1.2.0 of -Sensor scheme defines units same units. - -Tested: - - RedfishServiceValidator pass - -Change-Id: I0c8820eba7271022c427cd25dec321db36aa0176 -Signed-off-by: Wludzik, Jozef -Signed-off-by: Krzysztof Grobelny ---- - redfish-core/lib/power.hpp | 4 +- - redfish-core/lib/sensors.hpp | 107 +++++++++++++++++++++++++++++------ - redfish-core/lib/thermal.hpp | 4 +- - 3 files changed, 94 insertions(+), 21 deletions(-) - -diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp -index 1c7a009..99c45ef 100644 ---- a/redfish-core/lib/power.hpp -+++ b/redfish-core/lib/power.hpp -@@ -153,7 +153,7 @@ class Power : public Node - res.jsonValue["PowerControl"] = nlohmann::json::array(); - - auto sensorAsyncResp = std::make_shared( -- res, chassisName, sensors::dbus::types.at(sensors::node::power), -+ res, chassisName, sensors::dbus::paths.at(sensors::node::power), - sensors::node::power); - - getChassisData(sensorAsyncResp); -@@ -336,7 +336,7 @@ class Power : public Node - - const std::string& chassisName = params[0]; - auto asyncResp = std::make_shared( -- res, chassisName, sensors::dbus::types.at(sensors::node::power), -+ res, chassisName, sensors::dbus::paths.at(sensors::node::power), - sensors::node::power); - - std::optional> voltageCollections; -diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp -index 35114bf..af030f0 100644 ---- a/redfish-core/lib/sensors.hpp -+++ b/redfish-core/lib/sensors.hpp -@@ -54,9 +54,10 @@ static constexpr std::string_view thermal = "Thermal"; - - namespace dbus - { -+ - static const boost::container::flat_map> -- types = {{node::power, -+ paths = {{node::power, - {"/xyz/openbmc_project/sensors/voltage", - "/xyz/openbmc_project/sensors/power"}}, - {node::sensors, -@@ -67,6 +68,88 @@ static const boost::container::flat_mapchassisSubNode == sensors::node::sensors) - { - sensorJson["@odata.type"] = "#Sensor.v1_0_0.Sensor"; -- if (sensorType == "power") -- { -- sensorJson["ReadingUnits"] = "Watts"; -- } -- else if (sensorType == "current") -- { -- sensorJson["ReadingUnits"] = "Amperes"; -- } -- else if (sensorType == "utilization") -- { -- sensorJson["ReadingUnits"] = "Percent"; -- } -+ sensorJson["ReadingType"] = sensors::toReadingType(sensorType); -+ sensorJson["ReadingUnits"] = sensors::toReadingUnits(sensorType); - } - else if (sensorType == "temperature") - { -@@ -2979,8 +3052,8 @@ inline void retrieveUriToDbusMap(const std::string& chassis, - const std::string& node, - SensorsAsyncResp::DataCompleteCb&& mapComplete) - { -- auto typesIt = sensors::dbus::types.find(node); -- if (typesIt == sensors::dbus::types.end()) -+ auto pathIt = sensors::dbus::paths.find(node); -+ if (pathIt == sensors::dbus::paths.end()) - { - BMCWEB_LOG_ERROR << "Wrong node provided : " << node; - mapComplete(boost::beast::http::status::bad_request, {}); -@@ -2995,7 +3068,7 @@ inline void retrieveUriToDbusMap(const std::string& chassis, - uriToDbus) { mapCompleteCb(status, uriToDbus); }; - - auto resp = std::make_shared( -- *respBuffer, chassis, typesIt->second, node, std::move(callback)); -+ *respBuffer, chassis, pathIt->second, node, std::move(callback)); - getChassisData(resp); - } - -@@ -3030,7 +3103,7 @@ class SensorCollection : public Node - const std::string& chassisId = params[0]; - std::shared_ptr asyncResp = - std::make_shared( -- res, chassisId, sensors::dbus::types.at(sensors::node::sensors), -+ res, chassisId, sensors::dbus::paths.at(sensors::node::sensors), - sensors::node::sensors); - - auto getChassisCb = -diff --git a/redfish-core/lib/thermal.hpp b/redfish-core/lib/thermal.hpp -index 8e01bee..00acdf9 100644 ---- a/redfish-core/lib/thermal.hpp -+++ b/redfish-core/lib/thermal.hpp -@@ -48,7 +48,7 @@ class Thermal : public Node - } - const std::string& chassisName = params[0]; - auto sensorAsyncResp = std::make_shared( -- res, chassisName, sensors::dbus::types.at(sensors::node::thermal), -+ res, chassisName, sensors::dbus::paths.at(sensors::node::thermal), - sensors::node::thermal); - - // TODO Need to get Chassis Redundancy information. -@@ -71,7 +71,7 @@ class Thermal : public Node - allCollections; - - auto asyncResp = std::make_shared( -- res, chassisName, sensors::dbus::types.at(sensors::node::thermal), -+ res, chassisName, sensors::dbus::paths.at(sensors::node::thermal), - sensors::node::thermal); - - if (!json_util::readJson(req, asyncResp->res, "Temperatures", --- -2.25.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch deleted file mode 100644 index aaf3f17c7..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch +++ /dev/null @@ -1,671 +0,0 @@ -From 03c4ece83b58b954323111a1a7b2bf2b61402d7e Mon Sep 17 00:00:00 2001 -From: "Wludzik, Jozef" -Date: Mon, 18 May 2020 11:56:57 +0200 -Subject: [PATCH 2/4] Add POST and DELETE in MetricReportDefinitions - -Added POST action in MetricReportDefinitions node to allow user -to add new MetricReportDefinition. Using minimal set of -MetricReportDefinition parameters from user bmcweb converts it to -DBus call "AddReport" to Telemetry that serves as a backend -for Redfish TelemetryService. -Added DELETE request in MetricReportDefinitions node to allow user -to remove report from Telemetry. -Added conversion from string that represents duration format into -its numeric equivalent. -Added unit tests for conversion from and to Duration format. - -Tested: - - Tested using witherspoon image on QEMU - - Verified POST action in different cases: - - all parameters are provided, new report is added to collection - - some parameters are missing or invalid, user gets response with - description of the issue - - Verified that reports are removed on DELETE request - - Verified that on invalid DELETE request user receives response - with error - - Verified time_utils::fromDurationString() - - Succesfully passed RedfishServiceValidator.py - -Signed-off-by: Wludzik, Jozef -Signed-off-by: Krzysztof Grobelny -Change-Id: I2fed96848594451e22fde686f8c066d7770cc65a ---- - meson.build | 1 + - .../include/utils/telemetry_utils.hpp | 2 + - redfish-core/include/utils/time_utils.hpp | 138 +++++++- - redfish-core/lib/metric_report_definition.hpp | 328 ++++++++++++++++++ - redfish-core/ut/time_utils_test.cpp | 63 ++++ - 5 files changed, 530 insertions(+), 2 deletions(-) - create mode 100644 redfish-core/ut/time_utils_test.cpp - -diff --git a/meson.build b/meson.build -index 66a066b..22a8c4a 100644 ---- a/meson.build -+++ b/meson.build -@@ -345,6 +345,7 @@ srcfiles_unittest = ['include/ut/dbus_utility_test.cpp', - 'redfish-core/ut/privileges_test.cpp', - 'redfish-core/ut/lock_test.cpp', - 'redfish-core/ut/configfile_test.cpp', -+ 'redfish-core/ut/time_utils_test.cpp', - 'http/ut/utility_test.cpp'] - - # Gather the Configuration data -diff --git a/redfish-core/include/utils/telemetry_utils.hpp b/redfish-core/include/utils/telemetry_utils.hpp -index a3a8156..0a3af5f 100644 ---- a/redfish-core/include/utils/telemetry_utils.hpp -+++ b/redfish-core/include/utils/telemetry_utils.hpp -@@ -1,5 +1,7 @@ - #pragma once - -+#include "dbus_utility.hpp" -+ - namespace redfish - { - -diff --git a/redfish-core/include/utils/time_utils.hpp b/redfish-core/include/utils/time_utils.hpp -index 4a87ba0..9965d4d 100644 ---- a/redfish-core/include/utils/time_utils.hpp -+++ b/redfish-core/include/utils/time_utils.hpp -@@ -1,7 +1,13 @@ - #pragma once - -+#include "logging.hpp" -+ -+#include - #include -+#include -+#include - #include -+#include - - namespace redfish - { -@@ -12,6 +18,8 @@ namespace time_utils - namespace details - { - -+using Days = std::chrono::duration>; -+ - inline void leftZeroPadding(std::string& str, const std::size_t padding) - { - if (str.size() < padding) -@@ -19,8 +27,135 @@ inline void leftZeroPadding(std::string& str, const std::size_t padding) - str.insert(0, padding - str.size(), '0'); - } - } -+ -+template -+bool fromDurationItem(std::string_view& fmt, const char postfix, -+ std::chrono::milliseconds& out) -+{ -+ const size_t pos = fmt.find(postfix); -+ if (pos == std::string::npos) -+ { -+ return true; -+ } -+ if ((pos + 1U) > fmt.size()) -+ { -+ return false; -+ } -+ -+ const char* end; -+ std::chrono::milliseconds::rep ticks = 0; -+ if constexpr (std::is_same_v) -+ { -+ end = fmt.data() + std::min(pos, 3U); -+ } -+ else -+ { -+ end = fmt.data() + pos; -+ } -+ -+ auto [ptr, ec] = std::from_chars(fmt.data(), end, ticks); -+ if (ptr != end || ec != std::errc()) -+ { -+ BMCWEB_LOG_ERROR << "Failed to convert string to decimal with err: " -+ << static_cast(ec) << "(" -+ << std::make_error_code(ec).message() << "), ptr{" -+ << static_cast(ptr) << "} != end{" -+ << static_cast(end) << "})"; -+ return false; -+ } -+ -+ if constexpr (std::is_same_v) -+ { -+ ticks *= static_cast( -+ std::pow(10, 3 - std::min(pos, 3U))); -+ } -+ if (ticks < 0) -+ { -+ return false; -+ } -+ -+ out += FromTime(ticks); -+ const auto maxConversionRange = -+ std::chrono::duration_cast(std::chrono::milliseconds::max()) -+ .count(); -+ if (out < FromTime(ticks) || maxConversionRange < ticks) -+ { -+ return false; -+ } -+ -+ fmt.remove_prefix(pos + 1U); -+ return true; -+} - } // namespace details - -+/** -+ * @brief Convert string that represents value in Duration Format to its numeric -+ * equivalent. -+ */ -+std::optional -+ fromDurationString(const std::string& str) -+{ -+ std::chrono::milliseconds out = std::chrono::milliseconds::zero(); -+ std::string_view v = str; -+ -+ if (v.empty()) -+ { -+ return out; -+ } -+ if (v.front() != 'P') -+ { -+ BMCWEB_LOG_ERROR << "Invalid duration format: " << str; -+ return std::nullopt; -+ } -+ -+ v.remove_prefix(1); -+ if (!details::fromDurationItem(v, 'D', out)) -+ { -+ BMCWEB_LOG_ERROR << "Invalid duration format: " << str; -+ return std::nullopt; -+ } -+ -+ if (v.empty()) -+ { -+ return out; -+ } -+ if (v.front() != 'T') -+ { -+ BMCWEB_LOG_ERROR << "Invalid duration format: " << str; -+ return std::nullopt; -+ } -+ -+ v.remove_prefix(1); -+ if (!details::fromDurationItem(v, 'H', out) || -+ !details::fromDurationItem(v, 'M', out)) -+ { -+ BMCWEB_LOG_ERROR << "Invalid duration format: " << str; -+ return std::nullopt; -+ } -+ -+ if (v.find('.') != std::string::npos && v.find('S') != std::string::npos) -+ { -+ if (!details::fromDurationItem(v, '.', out) || -+ !details::fromDurationItem(v, 'S', out)) -+ { -+ BMCWEB_LOG_ERROR << "Invalid duration format: " << str; -+ return std::nullopt; -+ } -+ } -+ else if (!details::fromDurationItem(v, 'S', out)) -+ { -+ BMCWEB_LOG_ERROR << "Invalid duration format: " << str; -+ return std::nullopt; -+ } -+ -+ if (!v.empty()) -+ { -+ BMCWEB_LOG_ERROR << "Invalid duration format: " << str; -+ return std::nullopt; -+ } -+ return out; -+} -+ - /** - * @brief Convert time value into duration format that is based on ISO 8601. - * Example output: "P12DT1M5.5S" -@@ -36,8 +171,7 @@ inline std::string toDurationString(std::chrono::milliseconds ms) - std::string fmt; - fmt.reserve(sizeof("PxxxxxxxxxxxxDTxxHxxMxx.xxxxxxS")); - -- using Days = std::chrono::duration>; -- Days days = std::chrono::floor(ms); -+ details::Days days = std::chrono::floor(ms); - ms -= days; - - std::chrono::hours hours = std::chrono::floor(ms); -diff --git a/redfish-core/lib/metric_report_definition.hpp b/redfish-core/lib/metric_report_definition.hpp -index 59025d9..fcbc99c 100644 ---- a/redfish-core/lib/metric_report_definition.hpp -+++ b/redfish-core/lib/metric_report_definition.hpp -@@ -1,9 +1,12 @@ - #pragma once - - #include "node.hpp" -+#include "sensors.hpp" - #include "utils/telemetry_utils.hpp" - #include "utils/time_utils.hpp" - -+#include -+ - #include - #include - -@@ -95,6 +98,252 @@ inline void fillReportDefinition( - asyncResp->res.jsonValue["Schedule"]["RecurrenceInterval"] = - time_utils::toDurationString(std::chrono::milliseconds(*interval)); - } -+ -+struct AddReportArgs -+{ -+ std::string name; -+ std::string reportingType; -+ bool emitsReadingsUpdate = false; -+ bool logToMetricReportsCollection = false; -+ uint64_t interval = 0; -+ std::vector>> metrics; -+}; -+ -+inline bool toDbusReportActions(crow::Response& res, -+ std::vector& actions, -+ AddReportArgs& args) -+{ -+ size_t index = 0; -+ for (auto& action : actions) -+ { -+ if (action == "RedfishEvent") -+ { -+ args.emitsReadingsUpdate = true; -+ } -+ else if (action == "LogToMetricReportsCollection") -+ { -+ args.logToMetricReportsCollection = true; -+ } -+ else -+ { -+ messages::propertyValueNotInList( -+ res, action, "ReportActions/" + std::to_string(index)); -+ return false; -+ } -+ index++; -+ } -+ return true; -+} -+ -+inline bool getUserParameters(crow::Response& res, const crow::Request& req, -+ AddReportArgs& args) -+{ -+ std::vector metrics; -+ std::vector reportActions; -+ std::optional schedule; -+ if (!json_util::readJson(req, res, "Id", args.name, "Metrics", metrics, -+ "MetricReportDefinitionType", args.reportingType, -+ "ReportActions", reportActions, "Schedule", -+ schedule)) -+ { -+ return false; -+ } -+ -+ constexpr const char* allowedCharactersInName = -+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"; -+ if (args.name.empty() || args.name.find_first_not_of( -+ allowedCharactersInName) != std::string::npos) -+ { -+ BMCWEB_LOG_ERROR << "Failed to match " << args.name -+ << " with allowed character " -+ << allowedCharactersInName; -+ messages::propertyValueIncorrect(res, "Id", args.name); -+ return false; -+ } -+ -+ if (args.reportingType != "Periodic" && args.reportingType != "OnRequest") -+ { -+ messages::propertyValueNotInList(res, args.reportingType, -+ "MetricReportDefinitionType"); -+ return false; -+ } -+ -+ if (!toDbusReportActions(res, reportActions, args)) -+ { -+ return false; -+ } -+ -+ if (args.reportingType == "Periodic") -+ { -+ if (!schedule) -+ { -+ messages::createFailedMissingReqProperties(res, "Schedule"); -+ return false; -+ } -+ -+ std::string durationStr; -+ if (!json_util::readJson(*schedule, res, "RecurrenceInterval", -+ durationStr)) -+ { -+ return false; -+ } -+ -+ std::optional durationNum = -+ time_utils::fromDurationString(durationStr); -+ if (!durationNum) -+ { -+ messages::propertyValueIncorrect(res, "RecurrenceInterval", -+ durationStr); -+ return false; -+ } -+ args.interval = static_cast(durationNum->count()); -+ } -+ -+ args.metrics.reserve(metrics.size()); -+ for (auto& m : metrics) -+ { -+ std::string id; -+ std::vector uris; -+ if (!json_util::readJson(m, res, "MetricId", id, "MetricProperties", -+ uris)) -+ { -+ return false; -+ } -+ -+ args.metrics.emplace_back(std::move(id), std::move(uris)); -+ } -+ -+ return true; -+} -+ -+inline bool getChassisSensorNode( -+ const std::shared_ptr& asyncResp, -+ const std::vector>>& -+ metrics, -+ boost::container::flat_set>& matched) -+{ -+ for (const auto& [id, uris] : metrics) -+ { -+ for (size_t i = 0; i < uris.size(); i++) -+ { -+ const std::string& uri = uris[i]; -+ std::string chassis; -+ std::string node; -+ -+ if (!boost::starts_with(uri, "/redfish/v1/Chassis/") || -+ !dbus::utility::getNthStringFromPath(uri, 3, chassis) || -+ !dbus::utility::getNthStringFromPath(uri, 4, node)) -+ { -+ BMCWEB_LOG_ERROR << "Failed to get chassis and sensor Node " -+ "from " -+ << uri; -+ messages::propertyValueIncorrect(asyncResp->res, uri, -+ "MetricProperties/" + -+ std::to_string(i)); -+ return false; -+ } -+ -+ if (boost::ends_with(node, "#")) -+ { -+ node.pop_back(); -+ } -+ -+ matched.emplace(std::move(chassis), std::move(node)); -+ } -+ } -+ return true; -+} -+ -+class AddReport -+{ -+ public: -+ AddReport(AddReportArgs argsIn, std::shared_ptr asyncResp) : -+ asyncResp{std::move(asyncResp)}, args{std::move(argsIn)} -+ {} -+ ~AddReport() -+ { -+ if (asyncResp->res.result() != boost::beast::http::status::ok) -+ { -+ return; -+ } -+ -+ telemetry::ReadingParameters readingParams; -+ readingParams.reserve(args.metrics.size()); -+ -+ for (const auto& [id, uris] : args.metrics) -+ { -+ for (size_t i = 0; i < uris.size(); i++) -+ { -+ const std::string& uri = uris[i]; -+ auto el = uriToDbus.find(uri); -+ if (el == uriToDbus.end()) -+ { -+ BMCWEB_LOG_ERROR << "Failed to find DBus sensor " -+ "corresponding to URI " -+ << uri; -+ messages::propertyValueNotInList(asyncResp->res, uri, -+ "MetricProperties/" + -+ std::to_string(i)); -+ return; -+ } -+ -+ const std::string& dbusPath = el->second; -+ readingParams.emplace_back(dbusPath, "SINGLE", id, uri); -+ } -+ } -+ -+ crow::connections::systemBus->async_method_call( -+ [asyncResp = std::move(asyncResp), name = args.name, -+ uriToDbus = std::move(uriToDbus)]( -+ const boost::system::error_code ec, const std::string&) { -+ if (ec == boost::system::errc::file_exists) -+ { -+ messages::resourceAlreadyExists( -+ asyncResp->res, "MetricReportDefinition", "Id", name); -+ return; -+ } -+ if (ec == boost::system::errc::too_many_files_open) -+ { -+ messages::createLimitReachedForResource(asyncResp->res); -+ return; -+ } -+ if (ec == boost::system::errc::argument_list_too_long) -+ { -+ nlohmann::json metricProperties = nlohmann::json::array(); -+ for (const auto& [uri, _] : uriToDbus) -+ { -+ metricProperties.emplace_back(uri); -+ } -+ messages::propertyValueIncorrect( -+ asyncResp->res, metricProperties, "MetricProperties"); -+ return; -+ } -+ if (ec) -+ { -+ messages::internalError(asyncResp->res); -+ BMCWEB_LOG_ERROR << "respHandler DBus error " << ec; -+ return; -+ } -+ -+ messages::created(asyncResp->res); -+ }, -+ telemetry::service, "/xyz/openbmc_project/Telemetry/Reports", -+ "xyz.openbmc_project.Telemetry.ReportManager", "AddReport", -+ "TelemetryService/" + args.name, args.reportingType, -+ args.emitsReadingsUpdate, args.logToMetricReportsCollection, -+ args.interval, readingParams); -+ } -+ -+ void insert(const boost::container::flat_map& el) -+ { -+ uriToDbus.insert(el.begin(), el.end()); -+ } -+ -+ private: -+ std::shared_ptr asyncResp; -+ AddReportArgs args; -+ boost::container::flat_map uriToDbus{}; -+}; - } // namespace telemetry - - class MetricReportDefinitionCollection : public Node -@@ -126,6 +375,46 @@ class MetricReportDefinitionCollection : public Node - telemetry::getReportCollection(asyncResp, - telemetry::metricReportDefinitionUri); - } -+ -+ void doPost(crow::Response& res, const crow::Request& req, -+ const std::vector&) override -+ { -+ auto asyncResp = std::make_shared(res); -+ telemetry::AddReportArgs args; -+ if (!telemetry::getUserParameters(res, req, args)) -+ { -+ return; -+ } -+ -+ boost::container::flat_set> -+ chassisSensors; -+ if (!telemetry::getChassisSensorNode(asyncResp, args.metrics, -+ chassisSensors)) -+ { -+ return; -+ } -+ -+ auto addReportReq = -+ std::make_shared(std::move(args), asyncResp); -+ for (const auto& [chassis, sensorType] : chassisSensors) -+ { -+ retrieveUriToDbusMap( -+ chassis, sensorType, -+ [asyncResp, addReportReq]( -+ const boost::beast::http::status status, -+ const boost::container::flat_map& -+ uriToDbus) { -+ if (status != boost::beast::http::status::ok) -+ { -+ BMCWEB_LOG_ERROR << "Failed to retrieve URI to dbus " -+ "sensors map with err " -+ << static_cast(status); -+ return; -+ } -+ addReportReq->insert(uriToDbus); -+ }); -+ } -+ } - }; - - class MetricReportDefinition : public Node -@@ -184,5 +473,44 @@ class MetricReportDefinition : public Node - "org.freedesktop.DBus.Properties", "GetAll", - telemetry::reportInterface); - } -+ -+ void doDelete(crow::Response& res, const crow::Request&, -+ const std::vector& params) override -+ { -+ auto asyncResp = std::make_shared(res); -+ if (params.size() != 1) -+ { -+ messages::internalError(asyncResp->res); -+ return; -+ } -+ -+ const std::string& id = params[0]; -+ const std::string reportPath = telemetry::getDbusReportPath(id); -+ -+ crow::connections::systemBus->async_method_call( -+ [asyncResp, id](const boost::system::error_code ec) { -+ /* -+ * boost::system::errc and std::errc are missing value for -+ * EBADR error that is defined in Linux. -+ */ -+ if (ec.value() == EBADR) -+ { -+ messages::resourceNotFound(asyncResp->res, -+ "MetricReportDefinition", id); -+ return; -+ } -+ -+ if (ec) -+ { -+ BMCWEB_LOG_ERROR << "respHandler DBus error " << ec; -+ messages::internalError(asyncResp->res); -+ return; -+ } -+ -+ asyncResp->res.result(boost::beast::http::status::no_content); -+ }, -+ telemetry::service, reportPath, "xyz.openbmc_project.Object.Delete", -+ "Delete"); -+ } - }; - } // namespace redfish -diff --git a/redfish-core/ut/time_utils_test.cpp b/redfish-core/ut/time_utils_test.cpp -new file mode 100644 -index 0000000..70999ce ---- /dev/null -+++ b/redfish-core/ut/time_utils_test.cpp -@@ -0,0 +1,63 @@ -+#include "utils/time_utils.hpp" -+ -+#include -+ -+using namespace testing; -+ -+class FromDurationTest : -+ public Test, -+ public WithParamInterface< -+ std::pair>> -+{}; -+ -+INSTANTIATE_TEST_SUITE_P( -+ _, FromDurationTest, -+ Values(std::make_pair("PT12S", std::chrono::milliseconds(12000)), -+ std::make_pair("PT0.204S", std::chrono::milliseconds(204)), -+ std::make_pair("PT0.2S", std::chrono::milliseconds(200)), -+ std::make_pair("PT50M", std::chrono::milliseconds(3000000)), -+ std::make_pair("PT23H", std::chrono::milliseconds(82800000)), -+ std::make_pair("P51D", std::chrono::milliseconds(4406400000)), -+ std::make_pair("PT2H40M10.1S", std::chrono::milliseconds(9610100)), -+ std::make_pair("P20DT2H40M10.1S", -+ std::chrono::milliseconds(1737610100)), -+ std::make_pair("", std::chrono::milliseconds(0)), -+ std::make_pair("PTS", std::nullopt), -+ std::make_pair("P1T", std::nullopt), -+ std::make_pair("PT100M1000S100", std::nullopt), -+ std::make_pair("PDTHMS", std::nullopt), -+ std::make_pair("P99999999999999999DT", std::nullopt), -+ std::make_pair("PD222T222H222M222.222S", std::nullopt), -+ std::make_pair("PT99999H9999999999999999999999M99999999999S", -+ std::nullopt), -+ std::make_pair("PT-9H", std::nullopt))); -+ -+TEST_P(FromDurationTest, convertToMilliseconds) -+{ -+ const auto& [str, expected] = GetParam(); -+ EXPECT_THAT(redfish::time_utils::fromDurationString(str), Eq(expected)); -+} -+ -+class ToDurationTest : -+ public Test, -+ public WithParamInterface> -+{}; -+ -+INSTANTIATE_TEST_SUITE_P( -+ _, ToDurationTest, -+ Values(std::make_pair(std::chrono::milliseconds(12000), "PT12.000S"), -+ std::make_pair(std::chrono::milliseconds(204), "PT0.204S"), -+ std::make_pair(std::chrono::milliseconds(200), "PT0.200S"), -+ std::make_pair(std::chrono::milliseconds(3000000), "PT50M"), -+ std::make_pair(std::chrono::milliseconds(82800000), "PT23H"), -+ std::make_pair(std::chrono::milliseconds(4406400000), "P51DT"), -+ std::make_pair(std::chrono::milliseconds(9610100), "PT2H40M10.100S"), -+ std::make_pair(std::chrono::milliseconds(1737610100), -+ "P20DT2H40M10.100S"), -+ std::make_pair(std::chrono::milliseconds(-250), ""))); -+ -+TEST_P(ToDurationTest, convertToDuration) -+{ -+ const auto& [ms, expected] = GetParam(); -+ EXPECT_THAT(redfish::time_utils::toDurationString(ms), Eq(expected)); -+} --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README index cfb47a49b..46128f7ae 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README @@ -2,9 +2,6 @@ These patches are mirror of upstream TelemetryService implementation. Until change is integrated they will be manually merged here to enable feature in Intel builds. Current revisions: -- Add POST and DELETE in MetricReportDefinitions - https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/32536/63 - - Add support for MetricDefinition scheme https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/33363/60 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend index d42618b78..d9b32f5ae 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend @@ -1,5 +1,5 @@ SRC_URI = "git://github.com/openbmc/bmcweb.git" -SRCREV = "8e6c099ac8d4b4b3163a26b58fa0f9abb987979a" +SRCREV = "dab0604af234bdd5010407031a01343d6c242edf" DEPENDS += "boost-url" RDEPENDS_${PN} += "phosphor-nslcd-authority-cert-config" @@ -21,6 +21,9 @@ SRC_URI += "file://0001-Firmware-update-configuration-changes.patch \ file://0009-Add-support-to-ChangePassword-action.patch \ file://0010-managers-add-attributes-for-Manager.CommandShell.patch \ file://0034-recommended-fixes-by-crypto-review-team.patch \ + file://0011-bmcweb-Add-PhysicalContext-to-Thermal-resources.patch \ + file://0012-Log-RedFish-event-for-Invalid-login-attempt.patch \ + file://0013-Add-UART-routing-logic-into-host-console-connection-.patch \ " # Temporary downstream mirror of upstream patch to enable feature in Intel builds. @@ -30,25 +33,29 @@ SRC_URI += "file://0037-Add-state-sensor-messages-to-the-registry.patch \ # EventService: Temporary pulled to downstream. See eventservice\README for details SRC_URI += "file://eventservice/0001-EventService-Fix-retry-handling-for-http-client.patch \ file://eventservice/0002-EventService-https-client-support.patch \ - file://eventservice/0003-Move-EventService-init-to-later-stage.patch \ file://eventservice/0004-Add-Server-Sent-Events-support.patch \ file://eventservice/0005-Add-SSE-style-subscription-support-to-eventservice.patch \ file://eventservice/0006-Add-EventService-SSE-filter-support.patch \ " # Temporary downstream mirror of upstream patches, see telemetry\README for details -SRC_URI += "file://telemetry/0001-Sync_ReadingUnit_with_Redfish_Sensor_Schema.patch \ - file://telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch \ - file://telemetry/0003-Add-support-for-MetricDefinition-scheme.patch \ +SRC_URI += "file://telemetry/0003-Add-support-for-MetricDefinition-scheme.patch \ file://telemetry/0004-Sync-Telmetry-service-with-EventService.patch \ " SRC_URI += "file://0001-Add-ConnectedVia-property-to-virtual-media-item-temp.patch \ - file://0002-Change-InsertMedia-action-response-for-POST-in-proxy.patch \ + file://0002-Invalid-status-code-from-InsertMedia-REST-methods.patch \ file://0003-Set-Inserted-redfish-property-for-not-inserted-resou.patch \ + file://0004-Bmcweb-handle-permission-denied-exception.patch \ + file://0005-Fix-unmounting-image-in-proxy-mode.patch \ " SRC_URI += "file://0038-Revert-Disable-nbd-proxy-from-the-build.patch \ + file://0039-Fix-comparison-for-proxy-legacy-mode.patch \ +" + +# Fix to avoid bmcweb crash on VM mount +SRC_URI += "file://0039-Fix-bmcweb-crashes-if-socket-directory-not-present.patch \ " # Temporary fix: Move it to service file diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Correct-the-IPv6-Router-Address-Configuration-comman.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Correct-the-IPv6-Router-Address-Configuration-comman.patch deleted file mode 100644 index 658f0d8b7..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Correct-the-IPv6-Router-Address-Configuration-comman.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 4d7c0f704df21912fa447caca4dbba246d1b80f6 Mon Sep 17 00:00:00 2001 -From: Johnathan Mantey -Date: Tue, 26 Jan 2021 14:24:53 -0800 -Subject: [PATCH] Correct the IPv6 Router Address Configuration command - -The IPv6 Router Address Configuration Get/Set LAN command was not -reporting or modifying the correct portion of the networking -system. This command is intended to configure the Routing -Advertisement feature of IPv6. It is not a direct reflection of the -DHCP state. - -Systemd-networkd manages the Routing Advertisement via the -IPv6AcceptRA parameter, which according to the networkd documentaion, -enables/disables IPv6 DHCP functionality. - -Tested: -Issued "ipmitool raw 12 2 3 64 0 0" and was able to read the current -state of the IPv6AcceptRA variable. -Issued "ipmitool raw 12 1 3 64 2" and saw the configuration file for -the channel change, and the addition of a new IPv6 address to the -network device. -Issued "ipmitool raw 12 1 3 64 0" and saw that configuration file for -the channel change, and the removal of the IPv6 address from the -network device. - -Change-Id: Id01441f88ccc9d56449ab8115f4855de74e80cfc -Signed-off-by: Johnathan Mantey ---- - transporthandler.cpp | 61 ++++++++++++++++++++++++-------------------- - 1 file changed, 34 insertions(+), 27 deletions(-) - -diff --git a/transporthandler.cpp b/transporthandler.cpp -index b81e0d5..50343c7 100644 ---- a/transporthandler.cpp -+++ b/transporthandler.cpp -@@ -1260,6 +1260,35 @@ SetStatus& getSetStatus(uint8_t channel) - return setStatus[channel] = SetStatus::Complete; - } - -+/** @brief Gets the IPv6 Router Advertisement value -+ * -+ * @param[in] bus - The bus object used for lookups -+ * @param[in] params - The parameters for the channel -+ * @return networkd IPV6AcceptRA value -+ */ -+static bool getIPv6AcceptRA(sdbusplus::bus::bus& bus, -+ const ChannelParams& params) -+{ -+ auto raEnabled = -+ std::get(getDbusProperty(bus, params.service, params.logicalPath, -+ INTF_ETHERNET, "IPv6AcceptRA")); -+ return raEnabled; -+} -+ -+/** @brief Sets the IPv6AcceptRA flag -+ * -+ * @param[in] bus - The bus object used for lookups -+ * @param[in] params - The parameters for the channel -+ * @param[in] ipv6AcceptRA - boolean to enable/disable IPv6 Routing -+ * Advertisement -+ */ -+void setIPv6AcceptRA(sdbusplus::bus::bus& bus, const ChannelParams& params, -+ const bool ipv6AcceptRA) -+{ -+ setDbusProperty(bus, params.service, params.logicalPath, INTF_ETHERNET, -+ "IPv6AcceptRA", ipv6AcceptRA); -+} -+ - /** - * Define placeholder command handlers for the OEM Extension bytes for the Set - * LAN Configuration Parameters and Get LAN Configuration Parameters -@@ -1629,22 +1658,8 @@ RspType<> setLan(Context::ptr ctx, uint4_t channelBits, uint4_t reserved1, - { - return responseReqDataLenInvalid(); - } -- std::bitset<8> expected; -- EthernetInterface::DHCPConf dhcp = -- channelCall(channel); -- if ((dhcp == EthernetInterface::DHCPConf::both) | -- (dhcp == EthernetInterface::DHCPConf::v6)) -- { -- expected[IPv6RouterControlFlag::Dynamic] = 1; -- } -- else -- { -- expected[IPv6RouterControlFlag::Static] = 1; -- } -- if (expected != control) -- { -- return responseInvalidFieldRequest(); -- } -+ bool enableRA = control[IPv6RouterControlFlag::Dynamic]; -+ channelCall(channel, enableRA); - return responseSuccess(); - } - case LanParam::IPv6StaticRouter1IP: -@@ -1948,17 +1963,9 @@ RspType getLan(Context::ptr ctx, uint4_t channelBits, - case LanParam::IPv6RouterControl: - { - std::bitset<8> control; -- EthernetInterface::DHCPConf dhcp = -- channelCall(channel); -- if ((dhcp == EthernetInterface::DHCPConf::both) || -- (dhcp == EthernetInterface::DHCPConf::v6)) -- { -- control[IPv6RouterControlFlag::Dynamic] = 1; -- } -- else -- { -- control[IPv6RouterControlFlag::Static] = 1; -- } -+ control[IPv6RouterControlFlag::Dynamic] = -+ channelCall(channel); -+ control[IPv6RouterControlFlag::Static] = 0; - ret.pack(control); - return responseSuccess(std::move(ret)); - } --- -2.26.2 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend index 81cb43ebe..677641faf 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend @@ -8,7 +8,6 @@ SRC_URI += "file://phosphor-ipmi-host.service \ file://0060-Move-Get-SOL-config-parameter-to-host-ipmid.patch \ file://0062-Update-IPMI-Chassis-Control-command.patch \ file://0063-Save-the-pre-timeout-interrupt-in-dbus-property.patch \ - file://0064-Correct-the-IPv6-Router-Address-Configuration-comman.patch \ " EXTRA_OECONF_append = " --disable-i2c-whitelist-check" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend index 0aa63ca03..cc9f2d025 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend @@ -11,7 +11,7 @@ SMM_DEVICE = "ipmi_kcs4" SYSTEMD_SERVICE_${PN}_append = " ${PN}@${SMM_DEVICE}.service " SRC_URI = "git://github.com/openbmc/kcsbridge.git" -SRCREV = "4a4d1d03d99fabe089e649aa226ad4c61e71684e" +SRCREV = "3b170152ddc967f270939f4c351be987c451f0ca" SRC_URI += "file://99-ipmi-kcs.rules" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch deleted file mode 100644 index 5f749af45..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch +++ /dev/null @@ -1,317 +0,0 @@ -From e5ab844259f569656e95f5324f7428229dd811a7 Mon Sep 17 00:00:00 2001 -From: Cheng C Yang -Date: Wed, 3 Jul 2019 07:39:47 +0800 -Subject: [PATCH] Add dbus interface for sol commands - -Add dbus interface for sol config parameters so that after move set/get -sol config parameter command from net-ipmid to host-ipmid, the command -can send config parameters to net-ipmid sol service through the dbus -interface. - -Tested by: -busctl introspect xyz.openbmc_project.Settings /xyz/openbmc_project -/network/host0/sol can show correct dbus properties of sol parameters. -ipmitool -I lanplus -H x -U x -P x raw 0x0c 0x21 0x0e 0x00 0x01 -ipmitool -I lanplus -H x -U x -P x raw 0x0c 0x21 0x0e 0x01 0x00 -ipmitool -I lanplus -H x -U x -P x raw 0x0c 0x21 0x0e 0x02 0x83 -ipmitool -I lanplus -H x -U x -P x raw 0x0c 0x21 0x0e 0x03 0x5 0x03 -ipmitool -I lanplus -H x -U x -P x raw 0x0c 0x21 0x0e 0x04 0x5 0x03 -all these commands can change the dbus properties as the value in -above commands. -Before and after run these commands, ipmitool -I lanplus -H x -U x --P x sol activate can start sol session correctly. -After reboot BMC, "Progress" property in dbus interface change back -to 0 and other properties will not reset to default value. - -Signed-off-by: Cheng C Yang ---- - command/payload_cmds.cpp | 3 + - command/sol_cmds.cpp | 84 -------------------------- - sol/sol_manager.cpp | 124 +++++++++++++++++++++++++++++++++++++++ - sol/sol_manager.hpp | 1 + - sol_module.cpp | 6 -- - 5 files changed, 128 insertions(+), 90 deletions(-) - -diff --git a/command/payload_cmds.cpp b/command/payload_cmds.cpp -index c8e682e..bc987c5 100644 ---- a/command/payload_cmds.cpp -+++ b/command/payload_cmds.cpp -@@ -41,6 +41,9 @@ std::vector activatePayload(const std::vector& inPayload, - return outPayload; - } - -+ std::get(singletonPool) -+ .updateSOLParameter(ipmi::convertCurrentChannelNum( -+ ipmi::currentChNum, getInterfaceIndex())); - if (!std::get(singletonPool).enable) - { - response->completionCode = IPMI_CC_PAYLOAD_TYPE_DISABLED; -diff --git a/command/sol_cmds.cpp b/command/sol_cmds.cpp -index fda3e91..a1e820f 100644 ---- a/command/sol_cmds.cpp -+++ b/command/sol_cmds.cpp -@@ -71,90 +71,6 @@ void activating(uint8_t payloadInstance, uint32_t sessionID) - outPayload); - } - --std::vector setConfParams(const std::vector& inPayload, -- const message::Handler& handler) --{ -- std::vector outPayload(sizeof(SetConfParamsResponse)); -- auto request = -- reinterpret_cast(inPayload.data()); -- auto response = reinterpret_cast(outPayload.data()); -- response->completionCode = IPMI_CC_OK; -- -- switch (static_cast(request->paramSelector)) -- { -- case Parameter::PROGRESS: -- { -- uint8_t progress = request->value & progressMask; -- std::get(singletonPool).progress = progress; -- break; -- } -- case Parameter::ENABLE: -- { -- bool enable = request->value & enableMask; -- std::get(singletonPool).enable = enable; -- break; -- } -- case Parameter::AUTHENTICATION: -- { -- if (!request->auth.auth || !request->auth.encrypt) -- { -- response->completionCode = ipmiCCWriteReadParameter; -- } -- else if (request->auth.privilege < -- static_cast(session::Privilege::USER) || -- request->auth.privilege > -- static_cast(session::Privilege::OEM)) -- { -- response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST; -- } -- else -- { -- std::get(singletonPool).solMinPrivilege = -- static_cast(request->auth.privilege); -- } -- break; -- } -- case Parameter::ACCUMULATE: -- { -- using namespace std::chrono_literals; -- -- if (request->acc.threshold == 0) -- { -- response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST; -- break; -- } -- -- std::get(singletonPool).accumulateInterval = -- request->acc.interval * sol::accIntervalFactor * 1ms; -- std::get(singletonPool).sendThreshold = -- request->acc.threshold; -- break; -- } -- case Parameter::RETRY: -- { -- using namespace std::chrono_literals; -- -- std::get(singletonPool).retryCount = -- request->retry.count; -- std::get(singletonPool).retryInterval = -- request->retry.interval * sol::retryIntervalFactor * 1ms; -- break; -- } -- case Parameter::PORT: -- { -- response->completionCode = ipmiCCWriteReadParameter; -- break; -- } -- case Parameter::NVBITRATE: -- case Parameter::VBITRATE: -- case Parameter::CHANNEL: -- default: -- response->completionCode = ipmiCCParamNotSupported; -- } -- -- return outPayload; --} -- - std::vector getConfParams(const std::vector& inPayload, - const message::Handler& handler) - { -diff --git a/sol/sol_manager.cpp b/sol/sol_manager.cpp -index a118457..55d269a 100644 ---- a/sol/sol_manager.cpp -+++ b/sol/sol_manager.cpp -@@ -14,6 +14,11 @@ - #include - #include - #include -+#include -+ -+constexpr const char* solInterface = "xyz.openbmc_project.Ipmi.SOL"; -+constexpr const char* solPath = "/xyz/openbmc_project/ipmi/sol/"; -+constexpr const char* PROP_INTF = "org.freedesktop.DBus.Properties"; - - namespace sol - { -@@ -103,6 +108,125 @@ void Manager::stopHostConsole() - } - } - -+std::string getService(sdbusplus::bus::bus& bus, const std::string& intf, -+ const std::string& path) -+{ -+ auto mapperCall = -+ bus.new_method_call("xyz.openbmc_project.ObjectMapper", -+ "/xyz/openbmc_project/object_mapper", -+ "xyz.openbmc_project.ObjectMapper", "GetObject"); -+ -+ mapperCall.append(path); -+ mapperCall.append(std::vector({intf})); -+ -+ std::map> mapperResponse; -+ -+ try -+ { -+ auto mapperResponseMsg = bus.call(mapperCall); -+ mapperResponseMsg.read(mapperResponse); -+ } -+ catch (sdbusplus::exception_t&) -+ { -+ throw std::runtime_error("ERROR in mapper call"); -+ } -+ -+ if (mapperResponse.begin() == mapperResponse.end()) -+ { -+ throw std::runtime_error("ERROR in reading the mapper response"); -+ } -+ -+ return mapperResponse.begin()->first; -+} -+ -+ipmi::PropertyMap getAllDbusProperties(sdbusplus::bus::bus& bus, -+ const std::string& service, -+ const std::string& objPath, -+ const std::string& interface) -+{ -+ ipmi::PropertyMap properties; -+ -+ sdbusplus::message::message method = bus.new_method_call( -+ service.c_str(), objPath.c_str(), PROP_INTF, "GetAll"); -+ -+ method.append(interface); -+ -+ try -+ { -+ sdbusplus::message::message reply = bus.call(method); -+ reply.read(properties); -+ } -+ catch (sdbusplus::exception_t&) -+ { -+ phosphor::logging::log( -+ "Failed to get all properties", -+ phosphor::logging::entry("PATH=%s", objPath.c_str()), -+ phosphor::logging::entry("INTERFACE=%s", interface.c_str())); -+ throw std::runtime_error("ERROR in reading proerties"); -+ } -+ -+ return properties; -+} -+ -+void Manager::updateSOLParameter(uint8_t channelNum) -+{ -+ std::variant value; -+ sdbusplus::bus::bus dbus(ipmid_get_sd_bus_connection()); -+ static std::string solService{}; -+ ipmi::PropertyMap properties; -+ std::string ethdevice = ipmi::getChannelName(channelNum); -+ std::string solPathWitheEthName = solPath + ethdevice; -+ if (solService.empty()) -+ { -+ try -+ { -+ solService = getService(dbus, solInterface, solPathWitheEthName); -+ } -+ catch (const std::runtime_error& e) -+ { -+ solService.clear(); -+ phosphor::logging::log( -+ "Error: get SOL service failed"); -+ return; -+ } -+ } -+ try -+ { -+ properties = getAllDbusProperties(dbus, solService, solPathWitheEthName, -+ solInterface); -+ } -+ catch (const std::runtime_error&) -+ { -+ phosphor::logging::log( -+ "Error setting sol parameter"); -+ return; -+ } -+ -+ progress = std::get(properties["Progress"]); -+ -+ enable = std::get(properties["Enable"]); -+ -+ forceEncrypt = std::get(properties["ForceEncryption"]); -+ -+ forceAuth = std::get(properties["ForceAuthentication"]); -+ -+ solMinPrivilege = static_cast( -+ std::get(properties["Privilege"])); -+ -+ accumulateInterval = -+ std::get((properties["AccumulateIntervalMS"])) * -+ sol::accIntervalFactor * 1ms; -+ -+ sendThreshold = std::get(properties["Threshold"]); -+ -+ retryCount = std::get(properties["RetryCount"]); -+ -+ retryInterval = std::get(properties["RetryIntervalMS"]) * -+ sol::retryIntervalFactor * 1ms; -+ -+ return; -+} -+ - void Manager::startPayloadInstance(uint8_t payloadInstance, - session::SessionID sessionID) - { -diff --git a/sol/sol_manager.hpp b/sol/sol_manager.hpp -index 5b48add..4e797d4 100644 ---- a/sol/sol_manager.hpp -+++ b/sol/sol_manager.hpp -@@ -252,6 +252,7 @@ class Manager - * @return 0 on success and errno on failure. - */ - int writeConsoleSocket(const std::vector& input) const; -+ void updateSOLParameter(uint8_t channelNum); - - private: - SOLPayloadMap payloadMap; -diff --git a/sol_module.cpp b/sol_module.cpp -index 8200e74..2b1fb46 100644 ---- a/sol_module.cpp -+++ b/sol_module.cpp -@@ -42,12 +42,6 @@ void registerCommands() - &getPayloadInfo, - session::Privilege::USER, - false}, -- // Set SOL Configuration Parameters -- {{(static_cast(message::PayloadType::IPMI) << 16) | -- static_cast(::command::NetFns::TRANSPORT) | 0x21}, -- &setConfParams, -- session::Privilege::ADMIN, -- false}, - // Get SOL Configuration Parameters - {{(static_cast(message::PayloadType::IPMI) << 16) | - static_cast(::command::NetFns::TRANSPORT) | 0x22}, --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend index 9b76a8fa4..7fe91fd1f 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend @@ -3,7 +3,7 @@ inherit useradd # TODO: This should be removed, once up-stream bump up # issue is resolved SRC_URI += "git://github.com/openbmc/phosphor-net-ipmid" -SRCREV = "de7dd5ce3133a0201e149b6fdf3d3458fb7f06a5" +SRCREV = "d4a4bed525f79c39705fa526b20ab663bb2c2069" USERADD_PACKAGES = "${PN}" # add a group called ipmi @@ -21,7 +21,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += " file://10-nice-rules.conf \ file://0006-Modify-dbus-namespace-of-chassis-control-for-guid.patch \ - file://0009-Add-dbus-interface-for-sol-commands.patch \ file://0011-Remove-Get-SOL-Config-Command-from-Netipmid.patch \ " diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/leds/intel-led-manager-config-native.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/leds/intel-led-manager-config-native.bb index dd48df0c6..47c66ccb8 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/leds/intel-led-manager-config-native.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/leds/intel-led-manager-config-native.bb @@ -1,8 +1,8 @@ SUMMARY = "Phosphor LED Group Management for Intel" PR = "r1" -inherit native inherit obmc-phosphor-utils +inherit native LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb index ae498beb8..6c930876f 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb @@ -2,7 +2,7 @@ SUMMARY = "libmctp_intel" DESCRIPTION = "Implementation of MCTP(DMTF DSP0236)" SRC_URI = "git://github.com/Intel-BMC/libmctp.git;protocol=ssh" -SRCREV = "dca36d524d22d6efab3f7bfd6adda69dbebb1bf3" +SRCREV = "37ea118aa8653cc6220c4fd6da0224f0797f4bdc" S = "${WORKDIR}/git" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libpldm-intel_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libpldm-intel_git.bb index 0ed7add07..ee6fd12ee 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libpldm-intel_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libpldm-intel_git.bb @@ -2,7 +2,7 @@ SUMMARY = "libpldm_intel" DESCRIPTION = "Provides encode/decode APIs for PLDM specifications" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "07adfb357cdb679bf9bbcf2eaff7406cfb5fd52b" +SRCREV = "196f057fe8efea8080ec71ad4159df0675dd6a4c" S = "${WORKDIR}/git/libpldm_intel" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb index 6a418c330..b9d3c0ca4 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=bcd9ada3a943f58551867d72893cc9ab" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "07adfb357cdb679bf9bbcf2eaff7406cfb5fd52b" +SRCREV = "196f057fe8efea8080ec71ad4159df0675dd6a4c" S = "${WORKDIR}/git/mctp_emulator" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb index 3e8119c66..afe199192 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=bcd9ada3a943f58551867d72893cc9ab" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "07adfb357cdb679bf9bbcf2eaff7406cfb5fd52b" +SRCREV = "196f057fe8efea8080ec71ad4159df0675dd6a4c" S = "${WORKDIR}/git/mctp_wrapper" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb index c152eef70..96582c76e 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${PN}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "07adfb357cdb679bf9bbcf2eaff7406cfb5fd52b" +SRCREV = "196f057fe8efea8080ec71ad4159df0675dd6a4c" S = "${WORKDIR}/git" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb index 1fbeefced..c36c0d926 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=615045c30a05cde5c0e924854d43c327" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "07adfb357cdb679bf9bbcf2eaff7406cfb5fd52b" +SRCREV = "196f057fe8efea8080ec71ad4159df0675dd6a4c" S = "${WORKDIR}/git/mctpwplus" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/nvmemi-daemon.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/nvmemi-daemon.bb index d53ac712e..8a73394e5 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/nvmemi-daemon.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/nvmemi-daemon.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" SRC_URI = "git://github.com/Intel-BMC/nvme-mi.git;protocol=ssh" -SRCREV = "63e1cf7f8b950d37fdb035745bf740ec87ede6ae" +SRCREV = "832c63d3db86788859f4afb911840f5ba100d230" S = "${WORKDIR}/git" PV = "1.0+git${SRCPV}" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb index 08571570b..4a2a33878 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" SRC_URI += "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "07adfb357cdb679bf9bbcf2eaff7406cfb5fd52b" +SRCREV = "196f057fe8efea8080ec71ad4159df0675dd6a4c" S = "${WORKDIR}/git/pldmd" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb index 8b4ee807a..134cd9fdd 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "07adfb357cdb679bf9bbcf2eaff7406cfb5fd52b" +SRCREV = "196f057fe8efea8080ec71ad4159df0675dd6a4c" S = "${WORKDIR}/git/pmci_launcher" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init b/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init index 245dabe6c..2065f94ee 100755 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init @@ -149,6 +149,11 @@ RESTORE_FLAG=$RWFS_MNT/.restore_op if [ -f "$RESTORE_FLAG" ]; then mount -o remount,rw "$RWFS_MNT" restore_op=$(cat $RESTORE_FLAG) # read from NV + modified_on=$(stat -c %y $RESTORE_FLAG) # get last modified time + log "restore_op: $restore_op modified on: $modified_on" + # To rule out stale file mounted, Write unique, unused value 0x10 + # (last 2-bits are b00) before removing the file. + echo 16 > $RESTORE_FLAG # set default value 0 if RESTORE_FLAG file was empty restore_op=${restore_op:-0} restore_op=$((restore_op & 3)) # mask off 2 bits diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend index cb4a74a0b..e5c229ac7 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend @@ -1,4 +1,4 @@ # Enable downstream autobump SRC_URI = "git://github.com/openbmc/phosphor-sel-logger.git" -SRCREV = "aaffc124b6f49d9bc267e65565bdd5d4c1db1aaf" +SRCREV = "486e42e9db215070d631b7ac1f8f32537cb3bfe7" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend index d0370ba00..c00b5d4cf 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend @@ -1,7 +1,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" PROJECT_SRC_DIR := "${THISDIR}/${PN}" -SRCREV = "0947d7c1cb9dc5ae4bc740d18aff059cb896c309" +SRCREV = "6b6891c52e550c42507d4b413cbc4c6a09235535" #SRC_URI = "git://github.com/openbmc/dbus-sensors.git" SRC_URI += "\ diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-post-code-manager_git.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-post-code-manager_git.bbappend index f767cda73..ebb498866 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-post-code-manager_git.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-post-code-manager_git.bbappend @@ -1,2 +1,2 @@ #SRC_URI = "git://github.com/openbmc/phosphor-post-code-manager.git" -SRCREV = "84a4c19c48ad28b537cfcce15df39e841e1ed565" +SRCREV = "0171dd6bce9004e187c957f160809b729322f37d" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/telemetry/telemetry_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/telemetry/telemetry_%.bbappend index dcbe656b1..42f23dd9e 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/telemetry/telemetry_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/telemetry/telemetry_%.bbappend @@ -1,5 +1,5 @@ SRC_URI = "git://github.com/openbmc/telemetry.git" -SRCREV = "d7cebdd37fade28b0efd34bb9d641135bff758a0" +SRCREV = "f763c9e3bbe0f86a4a41e7bb0dc70bffde0af9b2" EXTRA_OEMESON += " -Dmax-reports=5" EXTRA_OEMESON += " -Dmax-reading-parameters=200" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager_%.bbappend index 0b3d54986..c9f14f54c 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager_%.bbappend @@ -1,7 +1,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI = "git://github.com/openbmc/phosphor-user-manager" -SRCREV = "9638afb9aa848aa0e696c2447e0fbc70a0aa5eed" +SRCREV = "18c1b42c1612e0e8d8f5cd9973bba09b447c7185" EXTRA_OECONF += "${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'allow-root-login' ], '', '--disable-root_user_mgmt', d)}" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Customize-phosphor-watchdog-for-Intel-platforms.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Customize-phosphor-watchdog-for-Intel-platforms.patch index d137f6971..a634b1588 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Customize-phosphor-watchdog-for-Intel-platforms.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Customize-phosphor-watchdog-for-Intel-platforms.patch @@ -1,4 +1,4 @@ -From 0e426ce8bcde3b6fb131405ef265250a96aa7e0a Mon Sep 17 00:00:00 2001 +From 67797d726b6eb6fa8e1dad063c7d2021cec47ab3 Mon Sep 17 00:00:00 2001 From: James Feist Date: Mon, 17 Jun 2019 12:00:58 -0700 Subject: [PATCH] Customize phosphor-watchdog for Intel platforms @@ -11,19 +11,23 @@ required for compatibility with Intel platforms. 3. Use host status to enable/disable watchdog 4. Set preTimeoutInterruptOccurFlag 5. Assign watchdog cause for correct reset cause reporting + 6. Add NMI Pre-Interrupt support for IPMI watchdog timer. Signed-off-by: James Feist Signed-off-by: Ren Yu Signed-off-by: Yong Li Signed-off-by: Jason M. Bills Signed-off-by: Johnathan Mantey +Signed-off-by: Sunita Kumari + +%% original patch: 0001-Customize-phosphor-watchdog-for-Intel-platforms.patch --- - watchdog.cpp | 212 ++++++++++++++++++++++++++++++++++++++++++++++++--- + watchdog.cpp | 230 ++++++++++++++++++++++++++++++++++++++++++++++++--- watchdog.hpp | 23 +++++- - 2 files changed, 224 insertions(+), 11 deletions(-) + 2 files changed, 242 insertions(+), 11 deletions(-) diff --git a/watchdog.cpp b/watchdog.cpp -index 9090760..2685401 100644 +index 57e9050..1204db4 100644 --- a/watchdog.cpp +++ b/watchdog.cpp @@ -1,11 +1,14 @@ @@ -41,7 +45,7 @@ index 9090760..2685401 100644 namespace phosphor { -@@ -18,10 +21,77 @@ using namespace phosphor::logging; +@@ -18,10 +21,86 @@ using namespace phosphor::logging; using sdbusplus::exception::SdBusError; using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure; @@ -104,6 +108,15 @@ index 9090760..2685401 100644 +static constexpr const char* request = "RequestedHostTransition"; +} // namespace host + ++namespace nmi ++{ ++static constexpr const char* busName = "xyz.openbmc_project.Control.Host.NMI"; ++static constexpr const char* path = "/xyz/openbmc_project/control/host0/nmi"; ++static constexpr const char* interface = "xyz.openbmc_project.Control.Host.NMI"; ++static constexpr const char* request = "NMI"; ++ ++} // namespace nmi ++ +void Watchdog::powerStateChangedHandler( + const std::map>& props) +{ @@ -123,7 +136,7 @@ index 9090760..2685401 100644 void Watchdog::resetTimeRemaining(bool enableWatchdog) { -@@ -102,13 +172,102 @@ uint64_t Watchdog::interval(uint64_t value) +@@ -107,13 +186,111 @@ uint64_t Watchdog::interval(uint64_t value) // Optional callback function on timer expiration void Watchdog::timeOutHandler() { @@ -223,11 +236,20 @@ index 9090760..2685401 100644 + "Watchdog timeout. timer use: %s", + preInterruptActionMessageArgs.c_str(), + timeUserMessage.c_str(), NULL); ++ ++ if (preTimeoutInterruptAction == ++ Watchdog::PreTimeoutInterruptAction::NMI) ++ { ++ sdbusplus::message::message preTimeoutInterruptHandler; ++ preTimeoutInterruptHandler = bus.new_method_call( ++ nmi::busName, nmi::path, nmi::interface, nmi::request); ++ bus.call_noreply(preTimeoutInterruptHandler); ++ } + } auto target = actionTargetMap.find(action); if (target == actionTargetMap.end()) -@@ -128,12 +287,45 @@ void Watchdog::timeOutHandler() +@@ -133,12 +310,45 @@ void Watchdog::timeOutHandler() try { @@ -327,5 +349,5 @@ index 7de9bb3..b004b7a 100644 void timeOutHandler(); -- -2.29.2 +2.17.1 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend index 5ef57447d..244af18dc 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend @@ -1,4 +1,4 @@ SRC_URI = "git://github.com/Intel-BMC/phosphor-webui;protocol=ssh;branch=intel2" FILESEXTRAPATHS_prepend_intel := "${THISDIR}/${PN}:" -SRCREV = "f0e37253951a4a32e4929c660232e17961f97bb8" +SRCREV = "40dd78bd5fe1dfcadd22bba9eee8e402b634b40d" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/webui-vue_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/webui-vue_%.bbappend index bdb411121..7ebf1d4d6 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/webui-vue_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/webui-vue_%.bbappend @@ -1,6 +1,6 @@ # Enable downstream autobump SRC_URI = "git://github.com/openbmc/webui-vue.git" -SRCREV = "1915d8c4992c1a4165e8ae108e4d799b3b4ce86a" +SRCREV = "5ed21f2d1e8b82be699a623bfdef550dfd598dbb" do_compile_prepend() { cp -vf ${S}/.env.intel ${S}/.env -- cgit v1.2.3