From 225376f0a37ee9b6f20626e5f377d8833ea1727f Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Mon, 18 Mar 2019 13:46:22 -0700 Subject: Update to internal Signed-off-by: Ed Tanous --- .../configuration/entity-manager_%.bbappend | 2 +- ...ng-the-Session-interface-for-Host-and-LAN.patch | 126 ++++++ ...20-Create-dbus-interface-for-SOL-commands.patch | 76 ++++ .../dbus/phosphor-dbus-interfaces_%.bbappend | 2 + .../fans/phosphor-pid-control_%.bbappend | 2 +- ...mage_verify-Add-support-for-OpenSSL-1.1.0.patch | 130 ------ .../flash/phosphor-software-manager_%.bbappend | 2 +- .../recipes-phosphor/gpiodaemon/gpiodaemon.bb | 2 +- .../ipmi/phosphor-ipmi-channel-inventory%.bbappend | 4 - .../phosphor-ipmi-channel-inventory%/channel.yaml | 8 - ...x-User-commands-require-channel-layer-lib.patch | 37 ++ ...nt-set-front-panel-button-enables-command.patch | 185 ++++++++ .../ipmi/phosphor-ipmi-host_%.bbappend | 2 + .../ipmi/phosphor-ipmi-node-manager-proxy_git.bb | 19 - .../ipmi/phosphor-node-manager-proxy_git.bb | 4 +- .../leds/intel-led-manager-config/led.yaml | 8 + .../sensors/dbus-sensors_%.bbappend | 6 +- .../srvcfg-manager/srvcfg-manager_git.bb | 2 +- .../0002-Capture-host-restart-cause.patch | 68 ++- ...boot-for-the-Reboot-host-state-transition.patch | 71 +++ .../state/phosphor-state-manager_%.bbappend | 1 + .../0001-Implement-post-code-manager.patch | 499 +++++++++++++++++++++ .../state/post-code-manager_git.bb | 34 ++ .../recipes-phosphor/system/callback-manager.bb | 4 +- .../system/obmc-mgr-system%.bbappend | 2 - ...suport-for-multiple-user-manager-services.patch | 63 +-- .../0007-Fix-some-page-keeps-loading-on-IE11.patch | 68 +++ .../webui/phosphor-webui/config.json | 8 + .../webui/phosphor-webui_%.bbappend | 9 +- 29 files changed, 1222 insertions(+), 222 deletions(-) create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0019-Creating-the-Session-interface-for-Host-and-LAN.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0020-Create-dbus-interface-for-SOL-commands.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0001-image_verify-Add-support-for-OpenSSL-1.1.0.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-channel-inventory%.bbappend delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-channel-inventory%/channel.yaml create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0054-Fix-User-commands-require-channel-layer-lib.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0055-Implement-set-front-panel-button-enables-command.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-node-manager-proxy_git.bb create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0003-Use-warm-reboot-for-the-Reboot-host-state-transition.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/state/post-code-manager/0001-Implement-post-code-manager.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/state/post-code-manager_git.bb delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/system/obmc-mgr-system%.bbappend create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0007-Fix-some-page-keeps-loading-on-IE11.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/config.json (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor') 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 2ae5eeb64..c4d5ba9ae 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,6 +1,6 @@ # this is here just to bump faster than upstream SRC_URI = "git://github.com/openbmc/entity-manager.git" -SRCREV = "9945ddffc67a9e564a92a3c0bddf2a2d7dc70b97" +SRCREV = "623de6cbb49070085bb97b98ba379206bac98a7a" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0019-Creating-the-Session-interface-for-Host-and-LAN.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0019-Creating-the-Session-interface-for-Host-and-LAN.patch new file mode 100644 index 000000000..e1208cf5b --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0019-Creating-the-Session-interface-for-Host-and-LAN.patch @@ -0,0 +1,126 @@ +From f805522921d69eb4ea70248fe7e54557363aacea Mon Sep 17 00:00:00 2001 +From: Suryakanth Sekar +Date: Sat, 2 Mar 2019 03:31:09 +0530 +Subject: [PATCH] Creating the Session interface- for Host and LAN + +Defined all needed session properites to manage the session in +host and also in LAN + +Change-Id: Ic7cccfc3333a602ee07fcd60077ec58fd8f06304 +Signed-off-by: Suryakanth Sekar +--- + xyz/openbmc_project/Session/Info.interface.yaml | 56 +++++++++++++++++++++++++ + xyz/openbmc_project/Session/README.md | 38 +++++++++++++++++ + 2 files changed, 94 insertions(+) + create mode 100644 xyz/openbmc_project/Session/Info.interface.yaml + create mode 100644 xyz/openbmc_project/Session/README.md + +diff --git a/xyz/openbmc_project/Session/Info.interface.yaml b/xyz/openbmc_project/Session/Info.interface.yaml +new file mode 100644 +index 0000000..fbb5a45 +--- /dev/null ++++ b/xyz/openbmc_project/Session/Info.interface.yaml +@@ -0,0 +1,56 @@ ++description: > ++ Provides properties for session objects. ++ As communication to this service is done through authenticated ++ & authorized session, there won't be any validation for the both. ++ ++properties: ++ - name: SessionHandle ++ type: byte ++ description: > ++ Session Handle,unique number to locate the session. ++ errors: ++ - xyz.openbmc_project.Common.Error.InternalFailure ++ - name: ChannelNum ++ type: byte ++ description: > ++ channelnumber which session is created. ++ errors: ++ - xyz.openbmc_project.Common.Error.InternalFailure ++ - name: CurrentPrivilege ++ type: byte ++ description: > ++ Privilege of the session. ++ errors: ++ - xyz.openbmc_project.Common.Error.InternalFailure ++ - name: RemoteIPAddr ++ type: uint32 ++ description: > ++ Remote IP address. ++ errors: ++ - xyz.openbmc_project.Common.Error.InternalFailure ++ - name: RemotePort ++ type: uint16 ++ description: > ++ Remote IP Port. ++ errors: ++ - xyz.openbmc_project.Common.Error.InternalFailure ++ - name: RemoteMACAddress ++ type: array[byte] ++ description: > ++ Remote MAC address. ++ errors: ++ - xyz.openbmc_project.Common.Error.InternalFailure ++ - name: UserID ++ type: byte ++ description: > ++ Session created by given user ID. ++ errors: ++ - xyz.openbmc_project.Common.Error.InternalFailure ++ - name: State ++ type: byte ++ description: > ++ Session state. ++ errors: ++ - xyz.openbmc_project.Common.Error.InternalFailure ++ ++# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 +diff --git a/xyz/openbmc_project/Session/README.md b/xyz/openbmc_project/Session/README.md +new file mode 100644 +index 0000000..f220885 +--- /dev/null ++++ b/xyz/openbmc_project/Session/README.md +@@ -0,0 +1,38 @@ ++# Session Management ++ ++## Overview ++Session Manager service exposes D-Bus methods for session management operations. ++ ++### Session Manager Interface ++Session manager interface `xyz.openbmc_project.Session.Manager` provides following ++methods, properties and signals. ++ ++#### xyz.openbmc_project.Session.Manager interface ++##### methods ++* CreateSession - To create new session object to the system. ++ ++##### properties ++* MaxSessionSupported - To list all the groups supported in the system. ++* ActiveSessionCount - To hold the no of active sessions. ++ ++Session manager service will create session objects for every session ++in the system under object path `/xyz/openbmc_project/session/`. ++Each session object can be handled through 'org.freedesktop.DBus.ObjectManager'. ++session object will expose following properties and methods. ++ ++#### xyz.openbmc_project.Session.Info interface ++##### properties ++* SessionID - Session ID,random unique number to locate the session. ++* Channel - Session created Channel. ++* SessionPrivilege - Privilege of the session. ++* RemoteIPAddr – Remote IP address. ++* RemotePort - Remote Port address. ++* RemoteMACAddress -Remote MAC Address. ++* UserID - Session created by given user id. ++ ++ ++ ++#### xyz.openbmc_project.Object.Delete ++#### methods ++* Delete - To delete the session object in the system. ++ +-- +2.7.4 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0020-Create-dbus-interface-for-SOL-commands.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0020-Create-dbus-interface-for-SOL-commands.patch new file mode 100644 index 000000000..68d2c92b7 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0020-Create-dbus-interface-for-SOL-commands.patch @@ -0,0 +1,76 @@ +From 2820ca36ab21c52341cdbde477756f960eaeb68b Mon Sep 17 00:00:00 2001 +From: Cheng C Yang +Date: Wed, 13 Mar 2019 11:19:07 +0800 +Subject: [PATCH] Create dbus interface for SOL commands + +Create dbus properties for Set/Get SOL config parameter command. +Some platforms need to call Set/Get SOL config parameter command +through KCS, and since sol manager in net-ipmid cannot be accessed +by commands in host-ipmid, need to create a dbus interface in +phospher-settings to transfer properties from host-ipmid to +net-ipmid. + +TestedBy: +With the related code change in net-ipmid, busctl introspect +xyz.openbmc_project.Ipmi.SOL /xyz/openbmc_project/SOL +can show all the properties needed. + +Signed-off-by: Cheng C Yang +--- + xyz/openbmc_project/Ipmi/SOL.interface.yaml | 44 ++++++++++++++++++++++++++ + 1 file changed, 44 insertions(+) + create mode 100644 xyz/openbmc_project/Ipmi/SOL.interface.yaml + +diff --git a/xyz/openbmc_project/Ipmi/SOL.interface.yaml b/xyz/openbmc_project/Ipmi/SOL.interface.yaml +new file mode 100644 +index 0000000..94db59f +--- /dev/null ++++ b/xyz/openbmc_project/Ipmi/SOL.interface.yaml +@@ -0,0 +1,44 @@ ++description: > ++ SOL properties use for Get/Set SOL config parameter command in host-ipmid ++ sending config to SOL process in net-ipmid. ++ Since some platforms need to access Get/Set SOL config parameter command ++ through KCS, and current sol manager is implemented in net-ipmid and ++ cannot be accessed by host-ipmid, add a dbus interface for host-ipmid ++ command to transfer properties to net-ipmid. ++ This interface will be implemented in phosphor-settings. ++properties: ++ - name: Progress ++ type: byte ++ description: > ++ Set In Progress property, indicate when any parameters are being ++ updated. ++ - name: Enable ++ type: boolean ++ description: > ++ SOL Enable property, this controls whether the SOL payload type ++ can be activated. ++ - name: Authentication ++ type: byte ++ description: > ++ If SOL enable Force Payload Encryption and Authenticaton. ++ And the minimun operating privilege level SOL required. ++ - name: AccumulateIntervalMS ++ type: byte ++ description: > ++ Character Accumulate Interval in 5ms increments. ++ BMC will wait this time before transmitting a packet. ++ - name: Threshold ++ type: byte ++ description: > ++ BMC will automatically send an SOL character data packet containing ++ this number of characters as soon as this number of characters ++ (or greater) has been accepted from the baseboard serial controller. ++ - name: RetryCount ++ type: byte ++ description: > ++ Packet will be dropped if no ACK/NACK received by time retries ++ expire. ++ - name: RetryIntervalMS ++ type: byte ++ description: > ++ Retry Interval in 10ms increments. +-- +2.16.2 + 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 2449d9225..d32650a3a 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 @@ -13,4 +13,6 @@ SRC_URI += "file://0002-Modify-Dbus-for-IPv6.patch \ file://0016-Add-DBUS-interface-of-SMBIOS-MDR-V2.patch \ file://0017-Add-shutdown-policy-interface-for-get-set-shutdown-p.patch \ file://0018-Define-post-code-interfaces-for-post-code-manager.patch \ + file://0019-Creating-the-Session-interface-for-Host-and-LAN.patch \ + file://0020-Create-dbus-interface-for-SOL-commands.patch \ " 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 3ea7b96b1..e085d244e 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,4 +5,4 @@ SYSTEMD_SERVICE_${PN} = "phosphor-pid-control.service" EXTRA_OECONF = "--enable-configure-dbus=yes" SRC_URI = "git://github.com/openbmc/phosphor-pid-control.git" -SRCREV = "f42741197ec807e0436a5e519ccff18519c67248" +SRCREV = "e6e6f62680cf77c0a742ca806609d10103273b07" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0001-image_verify-Add-support-for-OpenSSL-1.1.0.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0001-image_verify-Add-support-for-OpenSSL-1.1.0.patch deleted file mode 100644 index c5850473c..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0001-image_verify-Add-support-for-OpenSSL-1.1.0.patch +++ /dev/null @@ -1,130 +0,0 @@ -From fa124c7944088624d40d6b265bac0651bd8235bb Mon Sep 17 00:00:00 2001 -From: Adriana Kobylak -Date: Thu, 6 Sep 2018 13:15:34 -0500 -Subject: [PATCH] image_verify: Add support for OpenSSL 1.1.0 - -With OpenSSL 1.1.0, some of the functions were renamed, for -example EVP_MD_CTX_create() and EVP_MD_CTX_destroy() were -renamed to EVP_MD_CTX_new() and EVP_MD_CTX_free(). -Reference: https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes -Abstract them to support old and new APIs. - -Resolves openbmc/openbmc#3136 - -Tested: Verified the signature verification was successful. - -Change-Id: I2297243fdd652055fe9ea88f26eb2dcf473d24e6 -Signed-off-by: Adriana Kobylak - -%% original patch: 0001-image_verify-Add-support-for-OpenSSL-1.1.0.patch ---- - Makefile.am | 8 ++++++-- - image_verify.cpp | 2 +- - image_verify.hpp | 1 + - utils.cpp | 29 +++++++++++++++++++++++++++++ - utils.hpp | 15 +++++++++++++++ - 5 files changed, 52 insertions(+), 3 deletions(-) - create mode 100644 utils.cpp - create mode 100644 utils.hpp - -diff --git a/Makefile.am b/Makefile.am -index adba0e4..21b556f 100755 ---- a/Makefile.am -+++ b/Makefile.am -@@ -42,8 +42,12 @@ phosphor_image_updater_SOURCES = \ - include ubi/Makefile.am.include - - if WANT_SIGNATURE_VERIFY_BUILD --noinst_HEADERS += image_verify.hpp --phosphor_image_updater_SOURCES += image_verify.cpp -+noinst_HEADERS += \ -+ image_verify.hpp \ -+ utils.hpp -+phosphor_image_updater_SOURCES += \ -+ image_verify.cpp \ -+ utils.cpp - endif - - if WANT_SYNC -diff --git a/image_verify.cpp b/image_verify.cpp -index 7d59910..ba6b24d 100644 ---- a/image_verify.cpp -+++ b/image_verify.cpp -@@ -216,7 +216,7 @@ bool Signature::verifyFile(const fs::path& file, const fs::path& sigFile, - EVP_PKEY_assign_RSA(pKeyPtr.get(), publicRSA); - - // Initializes a digest context. -- EVP_MD_CTX_Ptr rsaVerifyCtx(EVP_MD_CTX_create(), ::EVP_MD_CTX_destroy); -+ EVP_MD_CTX_Ptr rsaVerifyCtx(EVP_MD_CTX_new(), ::EVP_MD_CTX_free); - - // Adds all digest algorithms to the internal table - OpenSSL_add_all_digests(); -diff --git a/image_verify.hpp b/image_verify.hpp -index cbd0e39..22ee5f9 100644 ---- a/image_verify.hpp -+++ b/image_verify.hpp -@@ -1,4 +1,5 @@ - #pragma once -+#include "utils.hpp" - #include - #include - #include -diff --git a/utils.cpp b/utils.cpp -new file mode 100644 -index 0000000..95fc2e0 ---- /dev/null -+++ b/utils.cpp -@@ -0,0 +1,29 @@ -+#include "utils.hpp" -+ -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+ -+#include -+ -+static void* OPENSSL_zalloc(size_t num) -+{ -+ void* ret = OPENSSL_malloc(num); -+ -+ if (ret != NULL) -+ { -+ memset(ret, 0, num); -+ } -+ return ret; -+} -+ -+EVP_MD_CTX* EVP_MD_CTX_new(void) -+{ -+ return (EVP_MD_CTX*)OPENSSL_zalloc(sizeof(EVP_MD_CTX)); -+} -+ -+void EVP_MD_CTX_free(EVP_MD_CTX* ctx) -+{ -+ EVP_MD_CTX_cleanup(ctx); -+ OPENSSL_free(ctx); -+} -+ -+#endif // OPENSSL_VERSION_NUMBER < 0x10100000L -diff --git a/utils.hpp b/utils.hpp -new file mode 100644 -index 0000000..90569bf ---- /dev/null -+++ b/utils.hpp -@@ -0,0 +1,15 @@ -+#pragma once -+ -+// With OpenSSL 1.1.0, some functions were deprecated. Need to abstract them -+// to make the code backward compatible with older OpenSSL veresions. -+// Reference: https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+ -+#include -+ -+extern "C" { -+EVP_MD_CTX* EVP_MD_CTX_new(void); -+void EVP_MD_CTX_free(EVP_MD_CTX* ctx); -+} -+ -+#endif // OPENSSL_VERSION_NUMBER < 0x10100000L --- -2.7.4 - 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 d19da526e..80c5ea9d3 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 @@ -4,7 +4,7 @@ EXTRA_OECONF += "--enable-fwupd_script" SYSTEMD_SERVICE_${PN}-updater += "fwupd@.service" SRC_URI_remove = "git://github.com/openbmc/phosphor-bmc-code-mgmt" -SRC_URI += "git://git@github.com/Intel-BMC/phosphor-bmc-code-mgmt.git;protocol=ssh" +SRC_URI += "git://git@github.com/Intel-BMC/phosphor-bmc-code-mgmt;protocol=ssh" SRCREV = "f8f76c29dbe2806a6eacd15847563cdf7f7567f4" #Currently enforcing image signature validation only for PFR images diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/gpiodaemon/gpiodaemon.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/gpiodaemon/gpiodaemon.bb index 6d6762fc9..0ff44cf73 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/gpiodaemon/gpiodaemon.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/gpiodaemon/gpiodaemon.bb @@ -10,7 +10,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh" -SRCREV = "3cc86d6c536b4c5ee7afb5447837b83ce8b3d149" +SRCREV = "c927781ad3ca1408cd7fb0b7cc2538ea10ded76b" inherit cmake systemd SYSTEMD_SERVICE_${PN} = "gpiodaemon.service" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-channel-inventory%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-channel-inventory%.bbappend deleted file mode 100644 index d79704ec6..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-channel-inventory%.bbappend +++ /dev/null @@ -1,4 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -SRC_URI += " file://channel.yaml \ - " diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-channel-inventory%/channel.yaml b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-channel-inventory%/channel.yaml deleted file mode 100644 index 032e05127..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-channel-inventory%/channel.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Channel Number (must be unique) is the key -1: - # ifName the ethernet device name (used in the dbus path) - ifName: eth0 -2: - ifName: eth1 -3: - ifName: eth1 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0054-Fix-User-commands-require-channel-layer-lib.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0054-Fix-User-commands-require-channel-layer-lib.patch new file mode 100644 index 000000000..bf6f672cf --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0054-Fix-User-commands-require-channel-layer-lib.patch @@ -0,0 +1,37 @@ +From 5d0c9d2217dbe369daffb8a92d7b5e7d7d34d566 Mon Sep 17 00:00:00 2001 +From: Richard Marian Thomaiyar +Date: Sat, 2 Mar 2019 20:08:32 +0530 +Subject: [PATCH] Fix: User commands require channel layer lib + +As channel layer is separated out from user layer lib, it +has to be manually included in libusercommands, as user +command handlers use channel layer API's + +Tested-by: +1. Made sure that libusercommands are loaded on it's own +without any undefined symbol error. +2. ipmitool user list 1 works on host interface + +Change-Id: I6652ad248e01afc1349e3a9612754dbdb84b96ad +Signed-off-by: Richard Marian Thomaiyar +--- + Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index bb7bdbf..4e9101e 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -120,7 +120,8 @@ libipmi20_la_CXXFLAGS = $(COMMON_CXX) + providers_LTLIBRARIES += libusercmds.la + libusercmds_la_LIBADD = \ + libipmid/libipmid.la \ +- user_channel/libuserlayer.la ++ user_channel/libuserlayer.la \ ++ user_channel/libchannellayer.la + libusercmds_la_SOURCES = \ + user_channel/usercommands.cpp + libusercmds_la_LDFLAGS = \ +-- +2.7.4 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0055-Implement-set-front-panel-button-enables-command.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0055-Implement-set-front-panel-button-enables-command.patch new file mode 100644 index 000000000..170e530f9 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0055-Implement-set-front-panel-button-enables-command.patch @@ -0,0 +1,185 @@ +From b8b88a5c0f9e9cb6023cb8d5453e5cfadaa1a375 Mon Sep 17 00:00:00 2001 +From: Kuiying Wang +Date: Fri, 4 Jan 2019 10:50:21 +0800 +Subject: [PATCH] Implement set front panel button enables command + +Through modify buttons' property "Enabled" to disable/enable +corresponding button. +Currently support power and reset button. + +Test-By: ipmitool raw 0x0 0xa 0x2 //disable reset button + ipmitool raw 0x0 0xa 0x1 //disable power button + ipmitool raw 0x0 0xa 0x0 //enable all buttons + +Change-Id: Ice6f58edb898689f7a7fa08ad078d25fccaab27e +Signed-off-by: Kuiying Wang +--- + chassishandler.cpp | 98 +++++++++++++++++++++++++++++++++++++++ + chassishandler.hpp | 1 + + host-ipmid-whitelist.conf | 1 + + 3 files changed, 100 insertions(+) + +diff --git a/chassishandler.cpp b/chassishandler.cpp +index 4b42b3c..1a5b805 100644 +--- a/chassishandler.cpp ++++ b/chassishandler.cpp +@@ -112,6 +112,8 @@ const static constexpr char chassisSMDevAddrProp[] = "SMDeviceAddress"; + const static constexpr char chassisBridgeDevAddrProp[] = "BridgeDeviceAddress"; + static constexpr uint8_t chassisCapFlagMask = 0x0f; + static constexpr uint8_t chassisCapAddrMask = 0xfe; ++static constexpr uint8_t disableResetButton = 0x2; ++static constexpr uint8_t disablePowerButton = 0x1; + + typedef struct + { +@@ -140,6 +142,19 @@ struct GetPOHCountResponse + uint8_t counterReading[4]; ///< Counter reading + } __attribute__((packed)); + ++typedef struct ++{ ++ uint8_t disables; // Front Panel Button Enables ++ //[7:4] - reserved ++ //[3] - 1b = disable Standby (sleep) button for entering standby (sleep) ++ //(control can still be used to wake the system) ++ //[2] - 1b = disable Diagnostic Interrupt button ++ //[1] - 1b = disable Reset button ++ //[0] - 1b = disable Power off button for power off only (in the case there ++ // is a single combined power/standby (sleep) button, then this also ++ // disables sleep requests via that button) ++} __attribute__((packed)) IPMISetFrontPanelButtonEnablesReq; ++ + // Phosphor Host State manager + namespace State = sdbusplus::xyz::openbmc_project::State::server; + +@@ -948,6 +963,8 @@ ipmi_ret_t ipmi_get_chassis_status(ipmi_netfn_t netfn, ipmi_cmd_t cmd, + + // Front Panel Button Capabilities and disable/enable status(Optional) + // set to 0, for we don't support them. ++ // TODO, it is tracked by an issue: ++ // https://github.com/openbmc/phosphor-host-ipmid/issues/122 + chassis_status.front_panel_button_cap_status = 0; + + // Pack the actual response +@@ -1721,6 +1738,82 @@ ipmi_ret_t ipmi_chassis_set_power_restore_policy( + return IPMI_CC_OK; + } + ++ipmi_ret_t ipmiSetFrontPanelButtonEnables(ipmi_netfn_t netfn, ipmi_cmd_t cmd, ++ ipmi_request_t request, ++ ipmi_response_t response, ++ ipmi_data_len_t data_len, ++ ipmi_context_t context) ++{ ++ bool enable = false; ++ constexpr const char* powerButtonIntf = ++ "xyz.openbmc_project.Chassis.Buttons.Power"; ++ constexpr const char* powerButtonPath = ++ "/xyz/openbmc_project/Chassis/Buttons/Power0"; ++ constexpr const char* resetButtonIntf = ++ "xyz.openbmc_project.Chassis.Buttons.Reset"; ++ constexpr const char* resetButtonPath = ++ "/xyz/openbmc_project/Chassis/Buttons/Reset0"; ++ using namespace chassis::internal; ++ ++ IPMISetFrontPanelButtonEnablesReq* req = ++ static_cast(request); ++ if (*data_len != 1) ++ { ++ *data_len = 0; ++ log("IPMI request len is invalid"); ++ return IPMI_CC_REQ_DATA_LEN_INVALID; ++ } ++ *data_len = 0; ++ if (req->disables & disablePowerButton) ++ { ++ // Disable power button ++ enable = false; ++ } ++ else ++ { ++ // Enable power button ++ enable = true; ++ } ++ // set power button Enabled property ++ try ++ { ++ auto service = ipmi::getService(dbus, powerButtonIntf, powerButtonPath); ++ ipmi::setDbusProperty(dbus, service, powerButtonPath, powerButtonIntf, ++ "Enabled", enable); ++ } ++ catch (sdbusplus::exception::SdBusError& e) ++ { ++ log(e.what()); ++ log("Fail to set power button Enabled property"); ++ return IPMI_CC_UNSPECIFIED_ERROR; ++ } ++ ++ if (req->disables & disableResetButton) ++ { ++ // disable reset button ++ enable = false; ++ } ++ else ++ { ++ // enable reset button ++ enable = true; ++ } ++ // set reset button Enabled property ++ try ++ { ++ auto service = ipmi::getService(dbus, resetButtonIntf, resetButtonPath); ++ ipmi::setDbusProperty(dbus, service, resetButtonPath, resetButtonIntf, ++ "Enabled", enable); ++ } ++ catch (sdbusplus::exception::SdBusError& e) ++ { ++ log(e.what()); ++ log("Fail to set reset button Enabled property"); ++ return IPMI_CC_UNSPECIFIED_ERROR; ++ } ++ return IPMI_CC_OK; ++} ++ + void register_netfn_chassis_functions() + { + createIdentifyTimer(); +@@ -1733,6 +1826,11 @@ void register_netfn_chassis_functions() + ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_GET_CHASSIS_CAP, NULL, + ipmi_get_chassis_cap, PRIVILEGE_USER); + ++ // Set Front Panel Button Enables ++ ipmi_register_callback(NETFUN_CHASSIS, ++ IPMI_CMD_SET_FRONT_PANEL_BUTTON_ENABLES, NULL, ++ ipmiSetFrontPanelButtonEnables, PRIVILEGE_ADMIN); ++ + // Set Chassis Capabilities + ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_SET_CHASSIS_CAP, NULL, + ipmi_set_chassis_cap, PRIVILEGE_USER); +diff --git a/chassishandler.hpp b/chassishandler.hpp +index 49b5ef8..f4a6bff 100644 +--- a/chassishandler.hpp ++++ b/chassishandler.hpp +@@ -19,6 +19,7 @@ enum ipmi_netfn_chassis_cmds + // Get capability bits + IPMI_CMD_SET_SYS_BOOT_OPTIONS = 0x08, + IPMI_CMD_GET_SYS_BOOT_OPTIONS = 0x09, ++ IPMI_CMD_SET_FRONT_PANEL_BUTTON_ENABLES = 0x0A, + IPMI_CMD_GET_POH_COUNTER = 0x0F, + }; + +diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf +index e5cd0b5..d96d9ed 100644 +--- a/host-ipmid-whitelist.conf ++++ b/host-ipmid-whitelist.conf +@@ -6,6 +6,7 @@ + 0x00:0x06 //: + 0x00:0x08 //: + 0x00:0x09 //: ++0x00:0x0A //: + 0x00:0x0F //: + 0x04:0x2D //: + 0x04:0x2F //: +-- +2.19.1 + 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 a92fc833b..56f90ec24 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 @@ -17,6 +17,8 @@ SRC_URI += "file://phosphor-ipmi-host.service \ file://0050-enable-6-oem-commands.patch \ file://0051-Fix-Set-LAN-Config-to-work-without-SetInProgress.patch \ file://0053-Fix-keep-looping-issue-when-entering-OS.patch \ + file://0054-Fix-User-commands-require-channel-layer-lib.patch \ + file://0055-Implement-set-front-panel-button-enables-command.patch \ " do_install_append(){ diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-node-manager-proxy_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-node-manager-proxy_git.bb deleted file mode 100644 index 24b1dd2a0..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-node-manager-proxy_git.bb +++ /dev/null @@ -1,19 +0,0 @@ -SUMMARY = "Node Manager Proxy" -DESCRIPTION = "The Node Manager Proxy provides a simple interface for communicating \ -with Management Engine via IPMB" - -SRC_URI = "git://git@github.com/openbmc-intel/node-manager;protocol=ssh" -SRCREV = "596cd421d4749c8b6d672fb410eccf9f2da08b3a" -PV = "0.1+git${SRCPV}" - -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" - -SYSTEMD_SERVICE_${PN} = "node-manager-proxy.service" - -DEPENDS = "sdbusplus \ - phosphor-logging \ - boost" - -S = "${WORKDIR}/git/" -inherit cmake systemd diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-node-manager-proxy_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-node-manager-proxy_git.bb index ead7a92aa..09d2f9c41 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-node-manager-proxy_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-node-manager-proxy_git.bb @@ -2,8 +2,8 @@ SUMMARY = "Node Manager Proxy" DESCRIPTION = "The Node Manager Proxy provides a simple interface for communicating \ with Management Engine via IPMB" -SRC_URI = "git://git@github.com/Intel-BMC/node-manager.git;protocol=ssh" -SRCREV = "e5a5f6189ce357438f40116717b995bab82c50ae" +SRC_URI = "git://git@github.com/Intel-BMC/node-manager;protocol=ssh" +SRCREV = "81133dd32bd0337aec9e026d1c9c2788028c7bdd" PV = "0.1+git${SRCPV}" LICENSE = "Apache-2.0" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/leds/intel-led-manager-config/led.yaml b/meta-openbmc-mods/meta-common/recipes-phosphor/leds/intel-led-manager-config/led.yaml index 813ffbfd4..7b193f85b 100755 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/leds/intel-led-manager-config/led.yaml +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/leds/intel-led-manager-config/led.yaml @@ -34,3 +34,11 @@ enclosure_identify: identify: Action: 'On' +cpu0_fault: + cpu0fault: + Action: 'On' + +cpu1_fault: + cpu1fault: + Action: 'On' + 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 56fb8531d..dff1647e8 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,8 +1,4 @@ -SRCREV = "46342ec359c8e0ed543ebb352cfba8f26ce85afe" +SRCREV = "209ec56cca898725213140fd0d1205a4d2f1c6a4" SRC_URI = "git://github.com/openbmc/dbus-sensors.git" DEPENDS_append = " i2c-tools" - -# turn this back on when we have a need, but disable it now -# as no shipping platforms use it and it will take cpu cycles -EXTRA_OECMAKE_append = " -DDISABLE_INTRUSION=ON" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/srvcfg-manager/srvcfg-manager_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/srvcfg-manager/srvcfg-manager_git.bb index 184b539a9..de2c0a106 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/srvcfg-manager/srvcfg-manager_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/srvcfg-manager/srvcfg-manager_git.bb @@ -9,7 +9,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh" -SRCREV = "3cc86d6c536b4c5ee7afb5447837b83ce8b3d149" +SRCREV = "c927781ad3ca1408cd7fb0b7cc2538ea10ded76b" inherit cmake systemd SYSTEMD_SERVICE_${PN} = "srvcfg-manager.service" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0002-Capture-host-restart-cause.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0002-Capture-host-restart-cause.patch index 7c6f684ca..7d70b29fa 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0002-Capture-host-restart-cause.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0002-Capture-host-restart-cause.patch @@ -1,24 +1,27 @@ -From 8dea573181c4455e144335e14cac9f54ebbf7208 Mon Sep 17 00:00:00 2001 +From c0f01261572cb527cf9dc62fa732b28c658ff013 Mon Sep 17 00:00:00 2001 From: Kuiying Wang Date: Tue, 7 Aug 2018 16:43:00 +0800 Subject: [PATCH] Capture host restart cause -Capture host restart cause on power/reset button pressed. +Capture host restart cause on power/reset button pressed, +and power restore policy settings. Save the restart cause into file system. And restort it when BMC boot up. Signed-off-by: Kuiying Wang +Signed-off-by: Yong Li --- - configure.ac | 4 +-- - host_state_manager.cpp | 16 ++++++++++++ - host_state_manager.hpp | 56 +++++++++++++++++++++++++++++++++++++++--- - 3 files changed, 71 insertions(+), 5 deletions(-) + configure.ac | 4 ++-- + discover_system_state.cpp | 14 ++++++++++++ + host_state_manager.cpp | 16 ++++++++++++++ + host_state_manager.hpp | 56 ++++++++++++++++++++++++++++++++++++++++++++--- + 4 files changed, 85 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac -index 838aaf2..5879e2f 100644 +index e985a95..b9e64c8 100644 --- a/configure.ac +++ b/configure.ac -@@ -54,9 +54,9 @@ AC_ARG_VAR(HOST_RUNNING_FILE, [File to create if host is running]) +@@ -56,9 +56,9 @@ AC_ARG_VAR(HOST_RUNNING_FILE, [File to create if host is running]) AS_IF([test "x$HOST_RUNNING_FILE" == "x"], [HOST_RUNNING_FILE="/run/openbmc/host@%u-on"]) AC_DEFINE_UNQUOTED([HOST_RUNNING_FILE], ["$HOST_RUNNING_FILE"], [File to create if host is running]) @@ -30,11 +33,50 @@ index 838aaf2..5879e2f 100644 AC_DEFINE_UNQUOTED([HOST_STATE_PERSIST_PATH], ["$HOST_STATE_PERSIST_PATH"], \ [Path of file for storing requested host state.]) +diff --git a/discover_system_state.cpp b/discover_system_state.cpp +index 3a38152..0b5798a 100644 +--- a/discover_system_state.cpp ++++ b/discover_system_state.cpp +@@ -12,6 +12,7 @@ + #include "settings.hpp" + #include "xyz/openbmc_project/Common/error.hpp" + #include "xyz/openbmc_project/Control/Power/RestorePolicy/server.hpp" ++#include + + namespace phosphor + { +@@ -181,6 +182,10 @@ int main(int argc, char** argv) + log("power_policy=ALWAYS_POWER_ON, powering host on"); + setProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition", + convertForMessage(server::Host::Transition::On)); ++ ++ setProperty( ++ bus, hostPath, HOST_BUSNAME, "HostRestartCause", ++ convertForMessage(server::Host::RestartCause::PowerPolicyAlwaysOn)); + } + else if (RestorePolicy::Policy::Restore == + RestorePolicy::convertPolicyFromString(powerPolicy)) +@@ -192,6 +197,15 @@ int main(int argc, char** argv) + getProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition"); + setProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition", + hostReqState); ++ ++ if (server::Host::convertTransitionFromString(hostReqState) == ++ server::Host::Transition::On) ++ { ++ setProperty( ++ bus, hostPath, HOST_BUSNAME, "HostRestartCause", ++ convertForMessage( ++ server::Host::RestartCause::PowerPolicyPreviousState)); ++ } + } + + return 0; diff --git a/host_state_manager.cpp b/host_state_manager.cpp -index ec1f95f..8573d00 100644 +index 7d661dd..03d210d 100644 --- a/host_state_manager.cpp +++ b/host_state_manager.cpp -@@ -304,6 +304,15 @@ bool Host::deserialize(const fs::path& path) +@@ -308,6 +308,15 @@ bool Host::deserialize(const fs::path& path) } } @@ -50,7 +92,7 @@ index ec1f95f..8573d00 100644 Host::Transition Host::requestedHostTransition(Transition value) { log("Host State transaction request", -@@ -349,6 +358,13 @@ Host::HostState Host::currentHostState(HostState value) +@@ -353,6 +362,13 @@ Host::HostState Host::currentHostState(HostState value) return server::Host::currentHostState(value); } @@ -63,7 +105,7 @@ index ec1f95f..8573d00 100644 + } // namespace manager } // namespace state - } // namepsace phosphor + } // namespace phosphor diff --git a/host_state_manager.hpp b/host_state_manager.hpp index 2b00777..e74fab7 100644 --- a/host_state_manager.hpp @@ -188,5 +230,5 @@ index 2b00777..e74fab7 100644 } // namespace manager -- -2.17.0 +2.7.4 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0003-Use-warm-reboot-for-the-Reboot-host-state-transition.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0003-Use-warm-reboot-for-the-Reboot-host-state-transition.patch new file mode 100644 index 000000000..40722c3c9 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0003-Use-warm-reboot-for-the-Reboot-host-state-transition.patch @@ -0,0 +1,71 @@ +From 8a7f73a0688524c71023da89e8cb5578dac16f5d Mon Sep 17 00:00:00 2001 +From: Yong Li +Date: Fri, 8 Mar 2019 17:21:49 +0800 +Subject: [PATCH] Use warm-reboot for the Reboot host state transition + +The same as reset button pressing, the pgood signal will keep on during the reboot + +Tested By: +ipmitool chassis power reset +The pgood(gpio219) will be keep high during the reset process + +Signed-off-by: Yong Li +--- + host_state_manager.cpp | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +diff --git a/host_state_manager.cpp b/host_state_manager.cpp +index 03d210d..8fac348 100644 +--- a/host_state_manager.cpp ++++ b/host_state_manager.cpp +@@ -44,8 +44,9 @@ constexpr auto HOST_STATE_SOFT_POWEROFF_TGT = "obmc-host-shutdown@0.target"; + constexpr auto HOST_STATE_POWEROFF_TGT = "obmc-host-stop@0.target"; + constexpr auto HOST_STATE_POWERON_TGT = "obmc-host-start@0.target"; + constexpr auto HOST_STATE_POWERON_MIN_TGT = "obmc-host-startmin@0.target"; +-constexpr auto HOST_STATE_REBOOT_TGT = "obmc-host-reboot@0.target"; ++constexpr auto HOST_STATE_REBOOT_TGT = "obmc-host-warm-reset@0.target"; + constexpr auto HOST_STATE_QUIESCE_TGT = "obmc-host-quiesce@0.target"; ++constexpr auto hostStateRebootService = "intel-power-warm-reset@0.service"; + + constexpr auto ACTIVE_STATE = "active"; + constexpr auto ACTIVATING_STATE = "activating"; +@@ -168,6 +169,7 @@ bool Host::stateActive(const std::string& target) + + const auto& currentStateStr = + sdbusplus::message::variant_ns::get(currentState); ++ + return currentStateStr == ACTIVE_STATE || + currentStateStr == ACTIVATING_STATE; + } +@@ -236,18 +238,22 @@ void Host::sysStateChange(sdbusplus::message::message& msg) + // Read the msg and populate each variable + msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult); + +- if ((newStateUnit == HOST_STATE_POWEROFF_TGT) && +- (newStateResult == "done") && +- (!stateActive(HOST_STATE_POWERON_MIN_TGT))) ++ if (((newStateUnit == HOST_STATE_POWEROFF_TGT) && ++ (newStateResult == "done") && ++ (!stateActive(HOST_STATE_POWERON_MIN_TGT))) || ++ ((newStateUnit == hostStateRebootService) && ++ (newStateResult == "done"))) + { + log("Received signal that host is off"); + this->currentHostState(server::Host::HostState::Off); + this->bootProgress(bootprogress::Progress::ProgressStages::Unspecified); + this->operatingSystemState(osstatus::Status::OSStatus::Inactive); + } +- else if ((newStateUnit == HOST_STATE_POWERON_MIN_TGT) && +- (newStateResult == "done") && +- (stateActive(HOST_STATE_POWERON_MIN_TGT))) ++ else if (((newStateUnit == HOST_STATE_POWERON_MIN_TGT) && ++ (newStateResult == "done") && ++ (stateActive(HOST_STATE_POWERON_MIN_TGT))) || ++ ((newStateUnit == HOST_STATE_REBOOT_TGT) && ++ (newStateResult == "done"))) + { + log("Received signal that host is running"); + this->currentHostState(server::Host::HostState::Running); +-- +2.7.4 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend index 92f5e530c..4c50ecf5e 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend @@ -5,4 +5,5 @@ SRC_URI += "file://0001-Modify-dbus-interface-for-power-control.patch \ file://phosphor-reset-host-reboot-attempts@.service \ file://phosphor-reset-host-check@.service \ file://0002-Capture-host-restart-cause.patch \ + file://0003-Use-warm-reboot-for-the-Reboot-host-state-transition.patch \ " diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/post-code-manager/0001-Implement-post-code-manager.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/state/post-code-manager/0001-Implement-post-code-manager.patch new file mode 100644 index 000000000..8915484cd --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/state/post-code-manager/0001-Implement-post-code-manager.patch @@ -0,0 +1,499 @@ +From 7d78e70735e1bce51ef34cfe128be68758de3447 Mon Sep 17 00:00:00 2001 +From: Kuiying Wang +Date: Tue, 19 Feb 2019 15:00:11 +0800 +Subject: [PATCH] Implement post code manager + +Implement method and properties defined in PostCode.interface.yaml +under phosphor-dbus-interfaces/xyz/openbmc_project/State/Boot +1. Method: std::vector PostCode::getPostCodes(uint16_t index) +2. Properties: CurrentBootCycleIndex/MaxBootCycleNum + +Test-By: + Every cycle post codes is saved in "/var/lib/phosphor-post-code-manager" + "1" file is saved all post codes for cycle 1 + "2" file is saved all post codes for cycle 2 + "CurrentBootCycleIndex" file is saved the current boot cycle number. + root@wolfpass:/var/lib/phosphor-post-code-manager# ls + 1 2 CurrentBootCycleIndex + +Change-Id: Ia89b9121983261fef5573092d890beb84626ceeb +Signed-off-by: Kuiying Wang +--- + CMakeLists.txt | 45 ++++++ + MAINTAINERS | 45 ++++++ + inc/post_code.hpp | 152 ++++++++++++++++++ + ...penbmc_project.State.Boot.PostCode.service | 11 ++ + src/main.cpp | 61 +++++++ + src/post_code.cpp | 109 +++++++++++++ + 6 files changed, 423 insertions(+) + create mode 100644 CMakeLists.txt + create mode 100644 MAINTAINERS + create mode 100644 inc/post_code.hpp + create mode 100644 service_files/xyz.openbmc_project.State.Boot.PostCode.service + create mode 100644 src/main.cpp + create mode 100644 src/post_code.cpp + +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..594d839 +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,45 @@ ++cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) ++project(post-code-manager CXX) ++set(CMAKE_CXX_STANDARD 17) ++set(CMAKE_CXX_STANDARD_REQUIRED ON) ++ ++set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) ++include(GNUInstallDirs) ++include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc) ++include_directories(${CMAKE_CURRENT_BINARY_DIR}) ++ ++set(DBUS_OBJECT_NAME "xyz/openbmc_project/State/Boot/PostCode") ++set(DBUS_INTF_NAME "xyz.openbmc_project.State.Boot.PostCode") ++ ++add_definitions(-DDBUS_OBJECT_NAME="/${DBUS_OBJECT_NAME}") ++add_definitions(-DDBUS_INTF_NAME="${DBUS_INTF_NAME}") ++set(SRC_FILES src/post_code.cpp ++ src/main.cpp ) ++set ( SERVICE_FILES ++ service_files/xyz.openbmc_project.State.Boot.PostCode.service ) ++ ++# import sdbusplus ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(SDBUSPLUSPLUS sdbusplus REQUIRED) ++include_directories(${SDBUSPLUSPLUS_INCLUDE_DIRS}) ++link_directories(${SDBUSPLUSPLUS_LIBRARY_DIRS}) ++find_program(SDBUSPLUSPLUS sdbus++) ++ ++# import phosphor-logging ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(LOGGING phosphor-logging REQUIRED) ++include_directories(${LOGGING_INCLUDE_DIRS}) ++link_directories(${LOGGING_LIBRARY_DIRS}) ++ ++# phosphor-dbus-interfaces ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(DBUSINTERFACE phosphor-dbus-interfaces REQUIRED) ++include_directories(${DBUSINTERFACE_INCLUDE_DIRS}) ++link_directories(${DBUSINTERFACE_LIBRARY_DIRS}) ++ ++add_executable(${PROJECT_NAME} ${SRC_FILES}) ++target_link_libraries(${PROJECT_NAME} ${DBUSINTERFACE_LIBRARIES} ) ++target_link_libraries(${PROJECT_NAME} "${SDBUSPLUSPLUS_LIBRARIES} -lstdc++fs -lphosphor_dbus") ++ ++install (TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) ++install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/) +\ No newline at end of file +diff --git a/MAINTAINERS b/MAINTAINERS +new file mode 100644 +index 0000000..de6cc54 +--- /dev/null ++++ b/MAINTAINERS +@@ -0,0 +1,45 @@ ++How to use this list: ++ Find the most specific section entry (described below) that matches where ++ your change lives and add the reviewers (R) and maintainers (M) as ++ reviewers. You can use the same method to track down who knows a particular ++ code base best. ++ ++ Your change/query may span multiple entries; that is okay. ++ ++ If you do not find an entry that describes your request at all, someone ++ forgot to update this list; please at least file an issue or send an email ++ to a maintainer, but preferably you should just update this document. ++ ++Description of section entries: ++ ++ Section entries are structured according to the following scheme: ++ ++ X: NAME ++ X: ... ++ . ++ . ++ . ++ ++ Where REPO_NAME is the name of the repository within the OpenBMC GitHub ++ organization; FILE_PATH is a file path within the repository, possibly with ++ wildcards; X is a tag of one of the following types: ++ ++ M: Denotes maintainer; has fields NAME ; ++ if omitted from an entry, assume one of the maintainers from the ++ MAINTAINERS entry. ++ R: Denotes reviewer; has fields NAME ; ++ these people are to be added as reviewers for a change matching the repo ++ path. ++ F: Denotes forked from an external repository; has fields URL. ++ ++ Line comments are to be denoted "# SOME COMMENT" (typical shell style ++ comment); it is important to follow the correct syntax and semantics as we ++ may want to use automated tools with this file in the future. ++ ++ A change cannot be added to an OpenBMC repository without a MAINTAINER's ++ approval; thus, a MAINTAINER should always be listed as a reviewer. ++ ++START OF MAINTAINERS LIST ++------------------------- ++ ++M: Kuiying Wang +\ No newline at end of file +diff --git a/inc/post_code.hpp b/inc/post_code.hpp +new file mode 100644 +index 0000000..84c8b3e +--- /dev/null ++++ b/inc/post_code.hpp +@@ -0,0 +1,152 @@ ++/* ++// Copyright (c) 2019 Intel Corporation ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++*/ ++#pragma once ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#define MaxPostCodeCycles 100 ++ ++const static constexpr char *PostCodePath = ++ "/xyz/openbmc_project/state/boot/raw"; ++const static constexpr char *PropertiesIntf = ++ "org.freedesktop.DBus.Properties"; ++const static constexpr char *PostCodeListPath = ++ "/var/lib/phosphor-post-code-manager/"; ++const static constexpr char *CurrentBootCycleIndexName = ++ "CurrentBootCycleIndex"; ++const static constexpr char *HostStatePath = ++ "/xyz/openbmc_project/state/host0"; ++ ++ ++struct EventDeleter ++{ ++ void operator()(sd_event *event) const ++ { ++ event = sd_event_unref(event); ++ } ++}; ++using EventPtr = std::unique_ptr; ++namespace fs = std::experimental::filesystem; ++namespace StateServer = sdbusplus::xyz::openbmc_project::State::server; ++ ++using post_code = ++ sdbusplus::xyz::openbmc_project::State::Boot::server::PostCode; ++ ++struct PostCode : sdbusplus::server::object_t ++{ ++ PostCode(sdbusplus::bus::bus& bus, const char* path, ++ EventPtr &event) : ++ sdbusplus::server::object_t(bus, path), ++ bus(bus), ++ propertiesChangedSignalRaw( ++ bus, ++ sdbusplus::bus::match::rules::type::signal() + ++ sdbusplus::bus::match::rules::member("PropertiesChanged") + ++ sdbusplus::bus::match::rules::path(PostCodePath) + ++ sdbusplus::bus::match::rules::interface(PropertiesIntf), ++ [this](sdbusplus::message::message &msg) { ++ std::string objectName; ++ std::map> msgData; ++ msg.read(objectName, msgData); ++ // Check if it was the Value property that changed. ++ auto valPropMap = msgData.find("Value"); ++ { ++ if (valPropMap != msgData.end()) ++ { ++ this->savePostCodes(sdbusplus::message::variant_ns::get(valPropMap->second)); ++ } ++ } ++ }), ++ propertiesChangedSignalCurrentHostState( ++ bus, ++ sdbusplus::bus::match::rules::type::signal() + ++ sdbusplus::bus::match::rules::member("PropertiesChanged") + ++ sdbusplus::bus::match::rules::path(HostStatePath) + ++ sdbusplus::bus::match::rules::interface(PropertiesIntf), ++ [this](sdbusplus::message::message &msg) { ++ std::string objectName; ++ std::map> msgData; ++ msg.read(objectName, msgData); ++ // Check if it was the Value property that changed. ++ auto valPropMap = msgData.find("CurrentHostState"); ++ { ++ if (valPropMap != msgData.end()) ++ { ++ StateServer::Host::HostState currentHostState = ++ StateServer::Host::convertHostStateFromString( ++ sdbusplus::message::variant_ns::get(valPropMap->second)); ++ if (currentHostState == StateServer::Host::HostState::Off) ++ { ++ if (this->currentBootCycleIndex() >= this->maxBootCycleNum()) ++ { ++ this->currentBootCycleIndex(1); ++ } else{ ++ this->currentBootCycleIndex(this->currentBootCycleIndex() + 1); ++ } ++ this->postCodes.clear(); ++ } ++ } ++ } ++ }) ++ { ++ phosphor::logging::log( ++ "PostCode is created"); ++ auto dir = fs::path(PostCodeListPath); ++ fs::create_directories(dir); ++ strPostCodeListPath = PostCodeListPath; ++ strCurrentBootCycleIndexName = CurrentBootCycleIndexName; ++ uint16_t index = 0; ++ deserialize(fs::path(strPostCodeListPath + strCurrentBootCycleIndexName), index); ++ currentBootCycleIndex(index); ++ maxBootCycleNum(MaxPostCodeCycles); ++ if (currentBootCycleIndex() >= maxBootCycleNum()) ++ { ++ currentBootCycleIndex(1); ++ } else{ ++ currentBootCycleIndex(currentBootCycleIndex() + 1); ++ } ++ } ++ ~PostCode() ++ { ++ ++ } ++ ++ std::vector getPostCodes(uint16_t index) override; ++ ++ private: ++ sdbusplus::bus::bus& bus; ++ std::vector postCodes; ++ std::string strPostCodeListPath; ++ std::string strCurrentBootCycleIndexName; ++ void savePostCodes(uint64_t code); ++ sdbusplus::bus::match_t propertiesChangedSignalRaw; ++ sdbusplus::bus::match_t propertiesChangedSignalCurrentHostState; ++ fs::path serialize(const std::string& path); ++ bool deserialize(const fs::path& path, uint16_t& index); ++ bool deserializePostCodes(const fs::path& path, std::vector &codes); ++}; +diff --git a/service_files/xyz.openbmc_project.State.Boot.PostCode.service b/service_files/xyz.openbmc_project.State.Boot.PostCode.service +new file mode 100644 +index 0000000..67bc43f +--- /dev/null ++++ b/service_files/xyz.openbmc_project.State.Boot.PostCode.service +@@ -0,0 +1,11 @@ ++[Unit] ++Description=Post code manager ++ ++[Service] ++ExecStart=/usr/bin/env post-code-manager ++SyslogIdentifier=post-code-manager ++Type=dbus ++BusName=xyz.openbmc_project.State.Boot.PostCode ++ ++[Install] ++WantedBy=obmc-standby.target +diff --git a/src/main.cpp b/src/main.cpp +new file mode 100644 +index 0000000..4a74b29 +--- /dev/null ++++ b/src/main.cpp +@@ -0,0 +1,61 @@ ++/* ++// Copyright (c) 2019 Intel Corporation ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++*/ ++#include "post_code.hpp" ++ ++int main(int argc, char* argv[]) ++{ ++ int ret = 0; ++ ++ phosphor::logging::log( ++ "Start post code manager service..."); ++ ++ sd_event* event = nullptr; ++ ret = sd_event_default(&event); ++ if (ret < 0) ++ { ++ phosphor::logging::log( ++ "Error creating a default sd_event handler"); ++ return ret; ++ } ++ EventPtr eventP{event}; ++ event = nullptr; ++ ++ sdbusplus::bus::bus bus = sdbusplus::bus::new_default(); ++ sdbusplus::server::manager_t m{bus, DBUS_OBJECT_NAME}; ++ ++ bus.request_name(DBUS_INTF_NAME); ++ ++ PostCode postCode{bus, DBUS_OBJECT_NAME, eventP}; ++ ++ try ++ { ++ bus.attach_event(eventP.get(), SD_EVENT_PRIORITY_NORMAL); ++ ret = sd_event_loop(eventP.get()); ++ if (ret < 0) ++ { ++ phosphor::logging::log( ++ "Error occurred during the sd_event_loop", ++ phosphor::logging::entry("RET=%d", ret)); ++ } ++ } ++ catch (std::exception& e) ++ { ++ phosphor::logging::log(e.what()); ++ return -1; ++ } ++ return 0; ++ ++} +diff --git a/src/post_code.cpp b/src/post_code.cpp +new file mode 100644 +index 0000000..983eeee +--- /dev/null ++++ b/src/post_code.cpp +@@ -0,0 +1,109 @@ ++/* ++// Copyright (c) 2019 Intel Corporation ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++*/ ++#include "post_code.hpp" ++std::vector PostCode::getPostCodes(uint16_t index) ++{ ++ std::vector codes; ++ ++ if (currentBootCycleIndex() == index) ++ return postCodes; ++ deserializePostCodes(fs::path(strPostCodeListPath + std::to_string(index)), codes); ++ return codes; ++} ++void PostCode::savePostCodes(uint64_t code) ++{ ++ postCodes.push_back(code); ++ serialize(fs::path(PostCodeListPath)); ++ return; ++} ++ ++fs::path PostCode::serialize(const std::string& path) ++{ ++ try ++ { ++ uint16_t index = currentBootCycleIndex(); ++ fs::path fullPath(path + strCurrentBootCycleIndexName); ++ std::ofstream os(fullPath.c_str(), std::ios::binary); ++ cereal::JSONOutputArchive oarchive(os); ++ oarchive(index); ++ ++ std::ofstream osPostCodes((path + std::to_string(currentBootCycleIndex())).c_str(), std::ios::binary); ++ cereal::JSONOutputArchive oarchivePostCodes(osPostCodes); ++ oarchivePostCodes(postCodes); ++ ++ return path; ++ } ++ catch (cereal::Exception& e) ++ { ++ phosphor::logging::log(e.what()); ++ } ++ catch (const fs::filesystem_error& e) ++ { ++ phosphor::logging::log(e.what()); ++ } ++} ++ ++bool PostCode::deserialize(const fs::path& path, uint16_t& index) ++{ ++ try ++ { ++ if (fs::exists(path)) ++ { ++ std::ifstream is(path.c_str(), std::ios::in | std::ios::binary); ++ cereal::JSONInputArchive iarchive(is); ++ iarchive(index); ++ return true; ++ } ++ return false; ++ } ++ catch (cereal::Exception& e) ++ { ++ phosphor::logging::log(e.what()); ++ return false; ++ } ++ catch (const fs::filesystem_error& e) ++ { ++ return false; ++ } ++ ++ return false; ++} ++ ++bool PostCode::deserializePostCodes(const fs::path& path, std::vector &codes) ++{ ++ try ++ { ++ if (fs::exists(path)) ++ { ++ std::ifstream is(path.c_str(), std::ios::in | std::ios::binary); ++ cereal::JSONInputArchive iarchive(is); ++ iarchive(codes); ++ return true; ++ } ++ return false; ++ } ++ catch (cereal::Exception& e) ++ { ++ phosphor::logging::log(e.what()); ++ return false; ++ } ++ catch (const fs::filesystem_error& e) ++ { ++ return false; ++ } ++ ++ return false; ++} +-- +2.19.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/post-code-manager_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/state/post-code-manager_git.bb new file mode 100644 index 000000000..8f2ead18a --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/state/post-code-manager_git.bb @@ -0,0 +1,34 @@ +SUMMARY = "Phosphor post code manager" +DESCRIPTION = "Post Code Manager" + +SRC_URI = "git://github.com/openbmc/phosphor-post-code-manager.git" +SRCREV = "7f50dcaa6feb66cf5307b8a0e4742a36a50eed29" + +S = "${WORKDIR}/git" + +PV = "1.0+git${SRCPV}" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" + +inherit cmake pkgconfig systemd + +SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.State.Boot.PostCode.service" + +DEPENDS += " \ + autoconf-archive-native \ + systemd \ + sdbusplus \ + sdbusplus-native \ + phosphor-dbus-interfaces \ + phosphor-dbus-interfaces-native \ + phosphor-logging \ + " +RDEPENDS_${PN} += " \ + libsystemd \ + sdbusplus \ + phosphor-dbus-interfaces \ + phosphor-logging \ + " +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +SRC_URI += "file://0001-Implement-post-code-manager.patch" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/system/callback-manager.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/system/callback-manager.bb index 3fb68201e..74f87e019 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/system/callback-manager.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/system/callback-manager.bb @@ -1,13 +1,13 @@ SUMMARY = "Callback Manager" DESCRIPTION = "D-Bus daemon that registers matches that trigger method calls" -SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh" +SRC_URI = "git://git@github.com/Intel-BMC/provingground;protocol=ssh" inherit cmake systemd DEPENDS = "boost sdbusplus" PV = "0.1+git${SRCPV}" -SRCREV = "3cc86d6c536b4c5ee7afb5447837b83ce8b3d149" +SRCREV = "c927781ad3ca1408cd7fb0b7cc2538ea10ded76b" S = "${WORKDIR}/git/callback-manager" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/system/obmc-mgr-system%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/system/obmc-mgr-system%.bbappend deleted file mode 100644 index 37bb8f961..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/system/obmc-mgr-system%.bbappend +++ /dev/null @@ -1,2 +0,0 @@ -SYSTEMD_AUTO_ENABLE = "enable" - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch index 332933a28..01be1501a 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch @@ -1,4 +1,4 @@ -From 4762913cfbd45234ddb363a5ec130eb56a8c7af0 Mon Sep 17 00:00:00 2001 +From 6e13c881be7df3cd1e19c69355ef87b91dbc197b Mon Sep 17 00:00:00 2001 From: Radivoje Jovanovic Date: Mon, 2 Jul 2018 19:23:25 -0700 Subject: [PATCH] Added suport for multiple user manager services @@ -11,16 +11,16 @@ Signed-off-by: Richard Marian Thomaiyar + #include --#include --#include + #include + #include #include -#include -#include @@ -184,7 +184,7 @@ index 786a8fd..51193cc 100644 #include "user_mgr.hpp" #include "users.hpp" #include "config.h" -@@ -43,12 +35,10 @@ namespace phosphor +@@ -43,12 +37,10 @@ namespace phosphor namespace user { @@ -197,7 +197,7 @@ index 786a8fd..51193cc 100644 static constexpr uint8_t minPasswdLength = 8; static constexpr int success = 0; static constexpr int failure = -1; -@@ -83,79 +73,6 @@ using NoResource = +@@ -94,79 +86,6 @@ using NoResource = using Argument = xyz::openbmc_project::Common::InvalidArgument; @@ -277,7 +277,7 @@ index 786a8fd..51193cc 100644 bool UserMgr::isUserExist(const std::string &userName) { if (userName.empty()) -@@ -282,39 +199,14 @@ void UserMgr::createUser(std::string userName, +@@ -293,39 +212,14 @@ void UserMgr::createUser(std::string userName, { throwForInvalidPrivilege(priv); throwForInvalidGroups(groupNames); @@ -289,9 +289,7 @@ index 786a8fd..51193cc 100644 - std::string groups = getCSVFromVector(groupNames); - bool sshRequested = removeStringFromCSV(groups, grpSsh); -+ // Tell the User Service to create a new user with the info provided. -+ userSrvc->createUser(userName, groupNames, priv, enabled); - +- - // treat privilege as a group - This is to avoid using different file to - // store the same. - if (!priv.empty()) @@ -314,13 +312,15 @@ index 786a8fd..51193cc 100644 - log("Unable to create new user"); - elog(); - } -- ++ // Tell the User Service to create a new user with the info provided. ++ userSrvc->createUser(userName, groupNames, priv, enabled); + - // Add the users object before sending out the signal + // Add the users to the local list before sending out the signal std::string userObj = std::string(usersObjPath) + "/" + userName; std::sort(groupNames.begin(), groupNames.end()); usersList.emplace( -@@ -328,19 +220,11 @@ void UserMgr::createUser(std::string userName, +@@ -339,19 +233,11 @@ void UserMgr::createUser(std::string userName, void UserMgr::deleteUser(std::string userName) { @@ -344,7 +344,7 @@ index 786a8fd..51193cc 100644 usersList.erase(userName); -@@ -351,24 +235,13 @@ void UserMgr::deleteUser(std::string userName) +@@ -362,24 +248,13 @@ void UserMgr::deleteUser(std::string userName) void UserMgr::renameUser(std::string userName, std::string newUserName) { @@ -372,7 +372,7 @@ index 786a8fd..51193cc 100644 const auto &user = usersList[userName]; std::string priv = user.get()->userPrivilege(); std::vector groupNames = user.get()->userGroups(); -@@ -392,8 +265,6 @@ void UserMgr::updateGroupsAndPriv(const std::string &userName, +@@ -403,8 +278,6 @@ void UserMgr::updateGroupsAndPriv(const std::string &userName, { throwForInvalidPrivilege(priv); throwForInvalidGroups(groupNames); @@ -381,7 +381,7 @@ index 786a8fd..51193cc 100644 throwForUserDoesNotExist(userName); const std::vector &oldGroupNames = usersList[userName].get()->userGroups(); -@@ -409,29 +280,8 @@ void UserMgr::updateGroupsAndPriv(const std::string &userName, +@@ -420,29 +293,8 @@ void UserMgr::updateGroupsAndPriv(const std::string &userName, throwForMaxGrpUserCount(groupNames); } @@ -413,7 +413,7 @@ index 786a8fd..51193cc 100644 log("User groups / privilege updated successfully", entry("USER_NAME=%s", userName.c_str())); -@@ -627,19 +477,9 @@ int UserMgr::setPamModuleArgValue(const std::string &moduleName, +@@ -638,19 +490,9 @@ int UserMgr::setPamModuleArgValue(const std::string &moduleName, void UserMgr::userEnable(const std::string &userName, bool enabled) { @@ -435,7 +435,7 @@ index 786a8fd..51193cc 100644 log("User enabled/disabled state updated successfully", entry("USER_NAME=%s", userName.c_str()), -@@ -730,49 +570,8 @@ bool UserMgr::userLockedForFailedAttempt(const std::string &userName, +@@ -728,49 +570,8 @@ bool UserMgr::userLockedForFailedAttempt(const std::string &userName, UserSSHLists UserMgr::getUserAndSshGrpList() { @@ -487,7 +487,7 @@ index 786a8fd..51193cc 100644 } size_t UserMgr::getIpmiUsersCount() -@@ -783,60 +582,23 @@ size_t UserMgr::getIpmiUsersCount() +@@ -781,49 +582,14 @@ size_t UserMgr::getIpmiUsersCount() bool UserMgr::isUserEnabled(const std::string &userName) { @@ -540,7 +540,8 @@ index 786a8fd..51193cc 100644 + return std::move(userSrvc->getUsersInGroup(groupName)); } - void UserMgr::initUserObjects(void) + DbusUserObj UserMgr::getPrivilegeMapperObject(void) +@@ -1018,11 +784,9 @@ void UserMgr::initUserObjects(void) { // All user management lock has to be based on /etc/shadow phosphor::user::shadow::Lock lock(); @@ -554,7 +555,7 @@ index 786a8fd..51193cc 100644 if (!userNameList.empty()) { -@@ -891,8 +653,10 @@ void UserMgr::initUserObjects(void) +@@ -1077,8 +841,10 @@ void UserMgr::initUserObjects(void) } } @@ -567,7 +568,7 @@ index 786a8fd..51193cc 100644 { UserMgrIface::allPrivileges(privMgr); std::sort(groupsMgr.begin(), groupsMgr.end()); -@@ -1000,6 +764,7 @@ UserMgr::UserMgr(sdbusplus::bus::bus &bus, const char *path) : +@@ -1186,6 +952,7 @@ UserMgr::UserMgr(sdbusplus::bus::bus &bus, const char *path) : } AccountPolicyIface::accountUnlockTimeout(value32); } @@ -576,18 +577,18 @@ index 786a8fd..51193cc 100644 } diff --git a/user_mgr.hpp b/user_mgr.hpp -index c1673f1..169f121 100644 +index c78174d..9d9c842 100644 --- a/user_mgr.hpp +++ b/user_mgr.hpp -@@ -20,6 +20,7 @@ - #include +@@ -21,6 +21,7 @@ #include + #include #include "users.hpp" +#include "user_service.hpp" namespace phosphor { -@@ -27,8 +28,6 @@ namespace user +@@ -28,8 +29,6 @@ namespace user { using UserMgrIface = sdbusplus::xyz::openbmc_project::User::server::Manager; @@ -596,7 +597,7 @@ index c1673f1..169f121 100644 using AccountPolicyIface = sdbusplus::xyz::openbmc_project::User::server::AccountPolicy; -@@ -49,8 +48,10 @@ class UserMgr : public UserMgrIface, AccountPolicyIface +@@ -71,8 +70,10 @@ class UserMgr : public UserMgrIface, AccountPolicyIface * * @param[in] bus - sdbusplus handler * @param[in] path - D-Bus path @@ -608,7 +609,7 @@ index c1673f1..169f121 100644 /** @brief create user method. * This method creates a new user as requested -@@ -148,6 +149,8 @@ class UserMgr : public UserMgrIface, AccountPolicyIface +@@ -181,6 +182,8 @@ class UserMgr : public UserMgrIface, AccountPolicyIface /** @brief object path */ const std::string path; diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0007-Fix-some-page-keeps-loading-on-IE11.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0007-Fix-some-page-keeps-loading-on-IE11.patch new file mode 100644 index 000000000..31d810cb6 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0007-Fix-some-page-keeps-loading-on-IE11.patch @@ -0,0 +1,68 @@ +From 5a3750377629725890f949d68e7e0ba7d4752825 Mon Sep 17 00:00:00 2001 +From: Mirage Su +Date: Fri, 8 Mar 2019 17:12:46 +0800 +Subject: [PATCH] Fix some page keeps loading on IE11 + +--- + app/index.js | 1 + + package-lock.json | 19 +++++++++++++++++++ + package.json | 1 + + 3 files changed, 21 insertions(+) + mode change 100644 => 100755 package-lock.json + +diff --git a/app/index.js b/app/index.js +index c9fed83..c51203e 100644 +--- a/app/index.js ++++ b/app/index.js +@@ -8,6 +8,7 @@ + */ + import 'angular/angular-csp.css'; + import 'bootstrap/dist/css/bootstrap.css'; ++import 'babel-polyfill'; + + import angular from 'angular'; + import angular_animate from 'angular-animate'; +diff --git a/package-lock.json b/package-lock.json +old mode 100644 +new mode 100755 +index 2d9d31b..61e9787 +--- a/package-lock.json ++++ b/package-lock.json +@@ -1500,6 +1500,25 @@ + "babel-runtime": "6.26.0" + } + }, ++ "babel-polyfill": { ++ "version": "6.26.0", ++ "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", ++ "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", ++ "dev": true, ++ "requires": { ++ "babel-runtime": "^6.26.0", ++ "core-js": "^2.5.0", ++ "regenerator-runtime": "^0.10.5" ++ }, ++ "dependencies": { ++ "regenerator-runtime": { ++ "version": "0.10.5", ++ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", ++ "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", ++ "dev": true ++ } ++ } ++ }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", +diff --git a/package.json b/package.json +index 35c6b78..1bdf934 100644 +--- a/package.json ++++ b/package.json +@@ -50,6 +50,7 @@ + "autoprefixer": "9.1.5", + "babel-core": "6.26.3", + "babel-loader": "8.0.2", ++ "babel-polyfill": "^6.26.0", + "compression-webpack-plugin": "2.0.0", + "copy-webpack-plugin": "4.5.2", + "csp-html-webpack-plugin": "^2.5.0", diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/config.json b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/config.json new file mode 100644 index 000000000..1543a6249 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/config.json @@ -0,0 +1,8 @@ +{ + "customKeyEnable": true, + "keyType" : "VT100+", + "customConsoleDisplaySize": { + "width": 100, + "height": 32 + } +} 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 e40b5ed8e..dd1ed6613 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,3 +1,10 @@ FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" -SRC_URI += "file://0001-Implement-KVM-in-webui.patch" +SRC_URI += "file://0001-Implement-KVM-in-webui.patch \ + file://config.json \ + file://0007-Fix-some-page-keeps-loading-on-IE11.patch \ + " + +do_compile_prepend() { + cp -r ${WORKDIR}/config.json ${S}/ +} -- cgit v1.2.3