summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Alekseev (IBS Group) <ealekseev@ibs.sila.ru>2022-09-16 08:29:52 +0300
committerEvgeny Alekseev (IBS Group) <ealekseev@ibs.sila.ru>2022-09-16 08:29:52 +0300
commitef1a13fc17b86cc48fe53c1236373d26e8b31c6a (patch)
treeb7e10687788df7920643504c8f342c058daec2f9
parentc20181b0404e1d9eded013fc5599b7cb368d64b7 (diff)
parent2c25c9b256149c06e6549e160bbe4d1658c78515 (diff)
downloadopenbmc-ef1a13fc17b86cc48fe53c1236373d26e8b31c6a.tar.xz
Merge branch 'sila-64MiB-rebase' of git.sila.ru:pub/openbmc/openbmc into sila-64MiB-rebase
-rw-r--r--meta-ibs/meta-cp2-5422/recipes-ibs/ipmi/intel-ipmi-oem/0005-Allow-additional-non-whitelisted-commands.patch41
-rw-r--r--meta-ibs/meta-cp2-5422/recipes-ibs/ipmi/intel-ipmi-oem_%.bbappend1
-rw-r--r--meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb/0016-Redfish-implement-Syslog-config.patch225
-rw-r--r--meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb_%.bbappend1
4 files changed, 268 insertions, 0 deletions
diff --git a/meta-ibs/meta-cp2-5422/recipes-ibs/ipmi/intel-ipmi-oem/0005-Allow-additional-non-whitelisted-commands.patch b/meta-ibs/meta-cp2-5422/recipes-ibs/ipmi/intel-ipmi-oem/0005-Allow-additional-non-whitelisted-commands.patch
new file mode 100644
index 0000000000..8d9005d292
--- /dev/null
+++ b/meta-ibs/meta-cp2-5422/recipes-ibs/ipmi/intel-ipmi-oem/0005-Allow-additional-non-whitelisted-commands.patch
@@ -0,0 +1,41 @@
+From e3038d5a1d2d41595ebda920e82de94ecef0bbee Mon Sep 17 00:00:00 2001
+From: Nikita Kosenkov <NKosenkov@IBS.RU>
+Date: Wed, 14 Sep 2022 16:22:04 +0300
+Subject: [PATCH] Allow additional non-whitelisted commands
+
+---
+ ipmi-whitelist.conf | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/ipmi-whitelist.conf b/ipmi-whitelist.conf
+index 4dea509..6b65561 100644
+--- a/ipmi-whitelist.conf
++++ b/ipmi-whitelist.conf
+@@ -7,8 +7,8 @@
+ 0x00:0x05:0x7f7f //<Chassis>:<Set Chassis Capabilities>
+ 0x00:0x06:0x7f7f //<Chassis>:<Set Power Restore Policy>
+ 0x00:0x07:0xff7f //<Chassis>:<Get System Restart Cause>
+-0x00:0x08:0x7f7f //<Chassis>:<Set System Boot Options>
+-0x00:0x09:0xff7f //<Chassis>:<Get System Boot Options>
++0x00:0x08:0xffff //<Chassis>:<Set System Boot Options>
++0x00:0x09:0xffff //<Chassis>:<Get System Boot Options>
+ 0x00:0x0a:0xff7f //<Chassis>:<Set Front Panel Enables>
+ 0x00:0x0f:0xff7f //<Chassis>:<Get POH Counter>
+ 0x04:0x00:0x7f7f //<Sensor/Event>:<Set Event Receiver>
+@@ -43,11 +43,11 @@
+ 0x06:0x05:0x7f7f //<App>:<Manufacturing Test Mode>
+ 0x06:0x06:0xffff //<App>:<Set ACPI Power State>
+ 0x06:0x07:0xffff //<App>:<Get ACPI Power State>
+-0x06:0x08:0xff7f //<App>:<Get Device GUID>
++0x06:0x08:0xffff //<App>:<Get Device GUID>
+ 0x06:0x22:0xff7f //<App>:<Reset Watchdog Timer>
+ 0x06:0x24:0xff7f //<App>:<Set Watchdog Timer>
+ 0x06:0x25:0xff7f //<App>:<Get Watchdog Timer>
+-0x06:0x2e:0x0000 //<App>:<Set BMC Global Enables>
++0x06:0x2e:0xffff //<App>:<Set BMC Global Enables>
+ 0x06:0x2f:0xffff //<App>:<Get BMC Global Enables>
+ 0x06:0x30:0x8080 //<App>:<Clear Message Flags>
+ 0x06:0x31:0x8080 //<App>:<Get Message Flags>
+--
+2.35.1
+
diff --git a/meta-ibs/meta-cp2-5422/recipes-ibs/ipmi/intel-ipmi-oem_%.bbappend b/meta-ibs/meta-cp2-5422/recipes-ibs/ipmi/intel-ipmi-oem_%.bbappend
index a8a86e2995..6f5aa453cd 100644
--- a/meta-ibs/meta-cp2-5422/recipes-ibs/ipmi/intel-ipmi-oem_%.bbappend
+++ b/meta-ibs/meta-cp2-5422/recipes-ibs/ipmi/intel-ipmi-oem_%.bbappend
@@ -7,4 +7,5 @@ SRC_URI += "\
file://0002-Additional-chenges-for-support-Rikor-BIOS.patch \
file://0003-Allow-Sensor-Commands.patch \
file://0004-Allow-System-IPMI-Interface-Network-Mgmt.patch \
+ file://0005-Allow-additional-non-whitelisted-commands.patch \
"
diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb/0016-Redfish-implement-Syslog-config.patch b/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb/0016-Redfish-implement-Syslog-config.patch
new file mode 100644
index 0000000000..d07a6cb3b7
--- /dev/null
+++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb/0016-Redfish-implement-Syslog-config.patch
@@ -0,0 +1,225 @@
+From fce8aebcb0c307a7a797708a26dd39e2b173b1cd Mon Sep 17 00:00:00 2001
+From: Nikita Kosenkov <NKosenkov@IBS.RU>
+Date: Thu, 15 Sep 2022 18:22:26 +0300
+Subject: [PATCH] Redfish: implement Syslog config
+
+1. Get config:
+ curl -u <Login>:<Password> -k -s -X GET https://<BMC>/redfish/v1/Syslog
+
+2. Update config:
+ curl -u <Login>:<Password> -k -s -X POST https://<BMC>/redfish/v1/Syslog/Actions/Syslog.UpdateConfig -d '{"Address": "10.0.0.10", "Port": 777}'
+---
+ redfish-core/include/redfish.hpp | 5 +
+ .../include/registries/privilege_registry.hpp | 8 +
+ redfish-core/lib/service_root.hpp | 1 +
+ redfish-core/lib/syslog.hpp | 143 ++++++++++++++++++
+ 4 files changed, 157 insertions(+)
+ create mode 100644 redfish-core/lib/syslog.hpp
+
+diff --git a/redfish-core/include/redfish.hpp b/redfish-core/include/redfish.hpp
+index 9db3a2b8..ebaabdfa 100644
+--- a/redfish-core/include/redfish.hpp
++++ b/redfish-core/include/redfish.hpp
+@@ -49,6 +49,7 @@
+ #include "../lib/update_service.hpp"
+ #include "../lib/virtual_media.hpp"
+ #include "../lib/smtp.hpp"
++#include "../lib/syslog.hpp"
+
+ namespace redfish
+ {
+@@ -229,6 +230,10 @@ class RedfishService
+ requestRoutesTrigger(app);
+ requestRoutesSmtp(app);
+ requestSmtpFunctions(app);
++
++ requestRoutesSyslog(app);
++ requestRoutesSyslogUpdateConfig(app);
++
+ // Note, this must be the last route registered
+ requestRoutesRedfish(app);
+ }
+diff --git a/redfish-core/include/registries/privilege_registry.hpp b/redfish-core/include/registries/privilege_registry.hpp
+index 5ec62749..95dba316 100644
+--- a/redfish-core/include/registries/privilege_registry.hpp
++++ b/redfish-core/include/registries/privilege_registry.hpp
+@@ -1435,6 +1435,14 @@ const static auto& postSwitchCollection = privilegeSetConfigureComponents;
+ const static auto& putSwitchCollection = privilegeSetConfigureComponents;
+ const static auto& deleteSwitchCollection = privilegeSetConfigureComponents;
+
++// Syslog
++const static auto& getSyslog = privilegeSetLogin;
++const static auto& headSyslog = privilegeSetLogin;
++const static auto& patchSyslog = privilegeSetConfigureComponents;
++const static auto& postSyslog = privilegeSetConfigureComponents;
++const static auto& putSyslog = privilegeSetConfigureComponents;
++const static auto& deleteSyslog = privilegeSetConfigureComponents;
++
+ // Task
+ const static auto& getTask = privilegeSetLogin;
+ const static auto& headTask = privilegeSetLogin;
+diff --git a/redfish-core/lib/service_root.hpp b/redfish-core/lib/service_root.hpp
+index 1904e8e3..b6eea99b 100644
+--- a/redfish-core/lib/service_root.hpp
++++ b/redfish-core/lib/service_root.hpp
+@@ -78,6 +78,7 @@ inline void handleServiceRootGetImpl(
+ "/redfish/v1/TelemetryService";
+ asyncResp->res.jsonValue["Cables"]["@odata.id"] = "/redfish/v1/Cables";
+ asyncResp->res.jsonValue["Smtp"]["@odata.id"] = "/redfish/v1/Smtp";
++ asyncResp->res.jsonValue["Syslog"]["@odata.id"] = "/redfish/v1/Syslog";
+
+ nlohmann::json& protocolFeatures =
+ asyncResp->res.jsonValue["ProtocolFeaturesSupported"];
+diff --git a/redfish-core/lib/syslog.hpp b/redfish-core/lib/syslog.hpp
+new file mode 100644
+index 00000000..bf7c0073
+--- /dev/null
++++ b/redfish-core/lib/syslog.hpp
+@@ -0,0 +1,143 @@
++#pragma once
++
++#include <app.hpp>
++#include <registries/privilege_registry.hpp>
++#include <query.hpp>
++
++
++namespace redfish
++{
++ constexpr const char* SYSLOG_SERVICE_PATH = "xyz.openbmc_project.Syslog.Config";
++ constexpr const char* SYSLOG_OBJECT_PATH = "/xyz/openbmc_project/logging/config/remote";
++ constexpr const char* SYSLOG_INTERFACE_PATH = "xyz.openbmc_project.Network.Client";
++
++ namespace syslog
++ {
++ inline void updateSyslogProperties(std::shared_ptr<bmcweb::AsyncResp> asyncResp,
++ const std::string& address,
++ const uint16_t& port)
++ {
++ auto errorHandler = [asyncResp](const boost::system::error_code ec) {
++ if (ec)
++ {
++ BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec;
++ messages::internalError(asyncResp->res);
++ }
++ };
++
++ crow::connections::systemBus->async_method_call(
++ errorHandler,
++ SYSLOG_SERVICE_PATH, SYSLOG_OBJECT_PATH,
++ "org.freedesktop.DBus.Properties", "Set",
++ SYSLOG_INTERFACE_PATH,
++ "Address", dbus::utility::DbusVariantType(address));
++
++ crow::connections::systemBus->async_method_call(
++ errorHandler,
++ SYSLOG_SERVICE_PATH, SYSLOG_OBJECT_PATH,
++ "org.freedesktop.DBus.Properties", "Set",
++ SYSLOG_INTERFACE_PATH,
++ "Port", dbus::utility::DbusVariantType(port));
++ }
++ }
++
++ inline void requestRoutesSyslogUpdateConfig(App& app)
++ {
++ BMCWEB_ROUTE(app, "/redfish/v1/Syslog/Actions/Syslog.UpdateConfig")
++ .privileges(redfish::privileges::postSyslog)
++ .methods(boost::beast::http::verb::post)(
++ [&app](const crow::Request& req,
++ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
++ {
++ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
++ {
++ return;
++ }
++
++ std::optional<std::string> address;
++ std::optional<uint16_t> port;
++ if (!json_util::readJsonAction(req, asyncResp->res,
++ "Address", address,
++ "Port", port))
++ {
++ return;
++ }
++
++ if(!address)
++ {
++ messages::propertyMissing(asyncResp->res, "Address");
++ return;
++ }
++
++ if(!port)
++ {
++ messages::propertyMissing(asyncResp->res, "Port");
++ return;
++ }
++
++ syslog::updateSyslogProperties(asyncResp, *address, *port);
++ });
++ }
++
++ inline void requestRoutesSyslog(App& app)
++ {
++ BMCWEB_ROUTE(app, "/redfish/v1/Syslog/")
++ .privileges(redfish::privileges::getSyslog)
++ .methods(boost::beast::http::verb::get)(
++ [&app](const crow::Request& req,
++ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
++ {
++ if (!redfish::setUpRedfishRoute(app, req, asyncResp))
++ {
++ return;
++ }
++
++ sdbusplus::asio::getAllProperties(
++ *crow::connections::systemBus,
++ SYSLOG_SERVICE_PATH,
++ SYSLOG_OBJECT_PATH,
++ SYSLOG_INTERFACE_PATH,
++ [asyncResp](const boost::system::error_code ec,
++ const dbus::utility::DBusPropertiesMap& propertiesList) {
++ if (ec)
++ {
++ BMCWEB_LOG_ERROR << "D-Bus response error on GetSubTree " << ec;
++ messages::internalError(asyncResp->res);
++ return;
++ }
++
++ const std::string* address = nullptr;
++ const uint16_t* port = nullptr;
++
++ const bool success = sdbusplus::unpackPropertiesNoThrow(
++ dbus_utils::UnpackErrorPrinter(),
++ propertiesList,
++ "Address", address,
++ "Port", port);
++
++ if (!success)
++ {
++ messages::internalError(asyncResp->res);
++ return;
++ }
++
++ if (address != nullptr && port != nullptr)
++ {
++ nlohmann::json& configuration =
++ asyncResp->res.jsonValue["Configuration"];
++ configuration["Address"] = *address;
++ configuration["Port"] = *port;
++ }
++ }
++ );
++
++ asyncResp->res.jsonValue["@odata.type"] ="#Syslog";
++ asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/Syslog";
++ asyncResp->res.jsonValue["Name"] = "Syslog";
++ asyncResp->res.jsonValue["Description"] = "Remote Syslog destination";
++ asyncResp->res.jsonValue["Actions"]["#Syslog.UpdateConfig"] = {
++ {"target", "/redfish/v1/Syslog/Actions/Syslog.UpdateConfig"}
++ };
++ });
++ }
++}
+\ No newline at end of file
+--
+2.35.1
+
diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb_%.bbappend b/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb_%.bbappend
index 72aa017f07..f9ba2e4e22 100644
--- a/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb_%.bbappend
+++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb_%.bbappend
@@ -12,6 +12,7 @@ SRC_URI += "\
file://0013-bugfix-telemetry-circular-buffer.patch \
file://0014-Additional-details-about-errors-when-change-user-pw.patch \
file://0015-Redfish-Implement-SNMP-Trap.patch \
+ file://0016-Redfish-implement-Syslog-config.patch \
"
#SRC_URI += "\