diff options
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor')
54 files changed, 1387 insertions, 1218 deletions
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 2a6b5abb0..77ef33c29 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 = "a218ddb84c5cb6f6d07c3febd14bb0395ce38e5f" +SRCREV = "24b01fdd5681726c71ddab73b2b9dfc89ee3de70" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0002-Modify-Dbus-for-IPv6.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0002-Modify-Dbus-for-IPv6.patch index 5b86d3154..3ca81c388 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0002-Modify-Dbus-for-IPv6.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0002-Modify-Dbus-for-IPv6.patch @@ -1,22 +1,22 @@ -From 066ecddebc29a87b05f8c66491eec19bb27d1d33 Mon Sep 17 00:00:00 2001 +From 068b816b3c9bf75dcd2a808fc81c67a32fbe29ea Mon Sep 17 00:00:00 2001 From: David Cobbley <david.j.cobbley@linux.intel.com> Date: Wed, 6 Jun 2018 10:11:58 -0700 -Subject: [PATCH 3/3] Modify Dbus for IPv6. +Subject: [PATCH] Modify Dbus for IPv6. Add additional interfaces for IPv6 use. --- - .../Network/EthernetInterface.interface.yaml | 18 ++++++++++++++++++ - xyz/openbmc_project/Network/IP.interface.yaml | 4 ++++ - 2 files changed, 22 insertions(+) + .../Network/EthernetInterface.interface.yaml | 17 ++++++++++++++++- + xyz/openbmc_project/Network/IP.interface.yaml | 4 ++++ + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/xyz/openbmc_project/Network/EthernetInterface.interface.yaml b/xyz/openbmc_project/Network/EthernetInterface.interface.yaml -index fc744fc..fd19e27 100644 +index 744ac77..6b7cd9a 100644 --- a/xyz/openbmc_project/Network/EthernetInterface.interface.yaml +++ b/xyz/openbmc_project/Network/EthernetInterface.interface.yaml -@@ -37,3 +37,21 @@ properties: - Implementation of this Dbus-interface is required to implement this property. - This property supports read/write operation. - Configure the NTP servers on the system during write operation. +@@ -42,6 +42,14 @@ properties: + description: > + This indicates link local auto configuration on this ethernet + interface and configured on this ethernet interface. + - name: IPv6AcceptRA + type: boolean + description: > @@ -25,8 +25,14 @@ index fc744fc..fd19e27 100644 + type: enum[self.IPAllowed] + description: > + The type of IP connection is allowed on this channel -+ -+enumerations: + + enumerations: + - name: LinkLocalConf +@@ -52,4 +60,11 @@ enumerations: + - name: v4 + - name: v6 + - name: none +- + - name: IPAllowed + description: > + Determines whether the system allows both IPv6 & IPv4, or disables on diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0006-dbus-interface-add-boot-option-support-for-floppy-an.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0006-dbus-interface-add-boot-option-support-for-floppy-an.patch deleted file mode 100644 index f0d7b03f8..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0006-dbus-interface-add-boot-option-support-for-floppy-an.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 643772fc7f6021fbfba3b14de0c86501ae3e7f3a Mon Sep 17 00:00:00 2001 -From: "Jia, Chunhui" <chunhui.jia@intel.com> -Date: Fri, 13 Jul 2018 15:22:05 +0800 -Subject: [PATCH] [dbus interface]add boot option support for floppy and USB - -Current implementations use ExternalMedia type to specify both CD/DVD/USB -/Floppy. But in IPMI spec, they are different. CD/DVD type is 0x5 and -USB/Floppy type is 0xF. - -This causes a bug that we can not force BIOS boots into USB/Floppy. - -Test: -$ ipmitool -H 10.239.56.91 -P 0penBmc -I lanplus raw - 0x0 0x8 0x5 0x80 0x14 0x00 0x00 0x00 -$ ipmitool -H 10.239.56.91 -P 0penBmc -I lanplus chassis bootparam get 5 -Boot parameter version: 1 -Boot parameter 5 is valid/unlocked -Boot parameter data: 8014000000 - Boot Flags : - - Boot Flag Valid - - Options apply to only next boot - - BIOS PC Compatible (legacy) boot - - Boot Device Selector : Force Boot from CD/DVD - - Console Redirection control : System Default - - BIOS verbosity : Console redirection occurs per BIOS - configuration setting (default) - - BIOS Mux Control Override : - BIOS uses recommended setting of the mux at the end of POST - -$ipmitool -H 10.239.56.91 -P 0penBmc -I lanplus raw - 0x0 0x8 0x5 0x80 0x3c 0x00 0x00 0x00 -$ipmitool -H 10.239.56.91 -P 0penBmc -I lanplus chassis bootparam get 5 -Boot parameter version: 1 -Boot parameter 5 is valid/unlocked -Boot parameter data: 803c000000 - Boot Flags : - - Boot Flag Valid - - Options apply to only next boot - - BIOS PC Compatible (legacy) boot - - Boot Device Selector : Force Boot from Floppy/primary removable media - - Console Redirection control : System Default - - BIOS verbosity : - Console redirection occurs per BIOS configuration setting (default) - - - BIOS Mux Control Override : - BIOS uses recommended setting of the mux at the end of POST - -Signed-off-by: Jia, Chunhui <chunhui.jia@intel.com> ---- - xyz/openbmc_project/Control/Boot/Source.interface.yaml | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/xyz/openbmc_project/Control/Boot/Source.interface.yaml b/xyz/openbmc_project/Control/Boot/Source.interface.yaml -index ea811bd..8e5916f 100644 ---- a/xyz/openbmc_project/Control/Boot/Source.interface.yaml -+++ b/xyz/openbmc_project/Control/Boot/Source.interface.yaml -@@ -15,12 +15,15 @@ enumerations: - - name: Disk - description: > - Boot from the local hard disk. -- - name: ExternalMedia -+ - name: DVD - description: > -- Boot from CD/DVD/USB, etc. -+ Boot from CD/DVD. - - name: Network - description: > - Boot from a remote source over a network. - - name: Default - description: > - Boot from an implementation defined source. -+ - name: Removable -+ description: > -+ Boot from floppy/primary removable media(USB). --- -2.16.2 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0017-Add-shutdown-policy-interface-for-get-set-shutdown-p.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0017-Add-shutdown-policy-interface-for-get-set-shutdown-p.patch deleted file mode 100644 index 587bcebf1..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0017-Add-shutdown-policy-interface-for-get-set-shutdown-p.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 7ebb72a93922a0163a5b35c277f3bbd241bdf78c Mon Sep 17 00:00:00 2001 -From: Yong Li <yong.b.li@linux.intel.com> -Date: Mon, 22 Oct 2018 16:20:36 +0800 -Subject: [PATCH] Add shutdown policy interface for get/set shutdown policy OEM - IPMI commands - -The policy property is used to store the shutdown policy. - -Tested by: -busctl get-property "xyz.openbmc_project.Settings" \ -"/xyz/openbmc_project/control/shutdown_policy_config" \ -"xyz.openbmc_project.Control.ShutdownPolicy" "Policy" - -busctl set-property "xyz.openbmc_project.Settings" \ -"/xyz/openbmc_project/control/shutdown_policy_config" \ -"xyz.openbmc_project.Control.ShutdownPolicy" "Policy" y 1 - -Signed-off-by: Yong Li <yong.b.li@linux.intel.com> ---- - xyz/openbmc_project/Control/ShutdownPolicy.interface.yaml | 10 ++++++++++ - 1 file changed, 10 insertions(+) - create mode 100644 xyz/openbmc_project/Control/ShutdownPolicy.interface.yaml - -diff --git a/xyz/openbmc_project/Control/ShutdownPolicy.interface.yaml b/xyz/openbmc_project/Control/ShutdownPolicy.interface.yaml -new file mode 100644 -index 0000000..e562ea8 ---- /dev/null -+++ b/xyz/openbmc_project/Control/ShutdownPolicy.interface.yaml -@@ -0,0 +1,10 @@ -+description: > -+ An interface for node shutdown policy on multi-node products. -+properties: -+ - name: Policy -+ type: byte -+ description: > -+ 0: Do not shutdown node on a power supply over current(OC) -+ or a power supply over temperature(OT) event. -+ 1: Shutdown node on an OC/OT event. -+ Only available on multi-node products. --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0020-Change-some-properties-name-in-SOL-Dbus.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0020-Change-some-properties-name-in-SOL-Dbus.patch deleted file mode 100644 index 9fe383fda..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0020-Change-some-properties-name-in-SOL-Dbus.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 2e265e85777345a318084c2f1f3b684f7e7ff4a4 Mon Sep 17 00:00:00 2001 -From: Cheng C Yang <cheng.c.yang@intel.com> -Date: Thu, 28 Mar 2019 18:06:54 +0800 -Subject: [PATCH] Change some properties name in SOL Dbus - -Change some properties name in SOL D-Bus interface to make the meaning -of the properties more clearly. - -Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com> ---- - xyz/openbmc_project/Ipmi/SOL.interface.yaml | 25 +++++++++++++++++-------- - 1 file changed, 17 insertions(+), 8 deletions(-) - -diff --git a/xyz/openbmc_project/Ipmi/SOL.interface.yaml b/xyz/openbmc_project/Ipmi/SOL.interface.yaml -index 94db59f..96c8c87 100644 ---- a/xyz/openbmc_project/Ipmi/SOL.interface.yaml -+++ b/xyz/openbmc_project/Ipmi/SOL.interface.yaml -@@ -2,8 +2,8 @@ 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 -+ through KCS, and current SOL manager is implemented in net-ipmid and -+ cannot be accessed by host-ipmid, add a D-Bus interface for host-ipmid - command to transfer properties to net-ipmid. - This interface will be implemented in phosphor-settings. - properties: -@@ -17,12 +17,20 @@ properties: - description: > - SOL Enable property, this controls whether the SOL payload type - can be activated. -- - name: Authentication -+ - name: ForceEncryption -+ type: boolean -+ description: > -+ If SOL enable Force Payload Encryption. -+ - name: ForceAuthentication -+ type: boolean -+ description: > -+ If SOL enable Force Payload Authentication -+ - name: Privilege - type: byte - description: > -- If SOL enable Force Payload Encryption and Authenticaton. -- And the minimun operating privilege level SOL required. -- - name: Accumulate -+ Sets the minimum operating privilege level that is required to -+ be able to activate SOL by Activate Payload command. -+ - name: AccumulateIntervalMS - type: byte - description: > - Character Accumulate Interval in 5ms increments. -@@ -31,13 +39,14 @@ properties: - type: byte - description: > - BMC will automatically send an SOL character data packet containing -- this number of characters. -+ 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: RetryInterval -+ - 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 e46c06bcd..8521f6839 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,12 +1,11 @@ SRC_URI = "git://github.com/openbmc/phosphor-dbus-interfaces.git" -SRCREV = "4623908c8c0e82d5831fca562c6f5a8430d494c8" +SRCREV = "b8a82d92bb6e1727257d745189215b03016a39c6" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += "file://0002-Modify-Dbus-for-IPv6.patch \ file://0003-Chassis-Power-Control-are-implemented.patch \ file://0005-Add-DBUS-interface-of-CPU-and-Memory-s-properties.patch \ - file://0006-dbus-interface-add-boot-option-support-for-floppy-an.patch \ file://0007-ipmi-set-BIOS-id.patch \ file://0009-Add-host-restart-cause-property.patch \ file://0010-Increase-the-default-watchdog-timeout-value.patch \ @@ -14,9 +13,7 @@ SRC_URI += "file://0002-Modify-Dbus-for-IPv6.patch \ file://0013-Add-ErrConfig.yaml-interface-for-processor-error-config.patch \ file://0014-Add-multiple-state-signal-for-host-start-and-stop.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-Change-some-properties-name-in-SOL-Dbus.patch \ file://0021-Add-interface-suppot-for-provisioning-modes.patch \ " diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service index 99494717f..e8baaa23e 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control/phosphor-pid-control.service @@ -1,5 +1,7 @@ [Unit] Description=Phosphor-Pid-Control Margin-based Fan Control Daemon +After=xyz.openbmc_project.EntityManager +After=xyz.openbmc_project.ObjectMapper [Service] Restart=always 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 efaccb590..2706f8508 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 = "5782ab81367e22e87d719c9fef6e85ecdc6cf95e" +SRCREV = "ded0ab5662212155e5d209343375e34ce9d34cdb" FILES_${PN} = "${bindir}/swampd ${bindir}/setsensor" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0002-Redfish-firmware-activation.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0002-Redfish-firmware-activation.patch new file mode 100644 index 000000000..2a4c7e9b6 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0002-Redfish-firmware-activation.patch @@ -0,0 +1,44 @@ +From b6b3051c8078267153712ed8cf514373924fd07a Mon Sep 17 00:00:00 2001 +From: Jennifer Lee <jennifer1.lee@intel.com> +Date: Mon, 16 Jul 2018 19:15:04 -0700 +Subject: [PATCH 2/6] Redfish firmware activation -- Modified flash.cpp to + call to customized flash service + +Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> +Change-Id: I81c3185e9c4c2ee907feeb53620faa22723c04d4 +--- + ubi/flash.cpp | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/ubi/flash.cpp b/ubi/flash.cpp +index ffa9348..5af2a17 100644 +--- a/ubi/flash.cpp ++++ b/ubi/flash.cpp +@@ -15,10 +15,13 @@ void Activation::flashWrite() + { + auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, + SYSTEMD_INTERFACE, "StartUnit"); +- method.append("obmc-flash-bmc-ubirw.service", "replace"); ++ std::string rwServiceFile = ++ "obmc-flash-bmc-ubirw@" + versionId + ".service"; ++ method.append(rwServiceFile, "replace"); + bus.call_noreply(method); + +- auto roServiceFile = "obmc-flash-bmc-ubiro@" + versionId + ".service"; ++ std::string roServiceFile = ++ "obmc-flash-bmc-ubiro@" + versionId + ".service"; + method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, + SYSTEMD_INTERFACE, "StartUnit"); + method.append(roServiceFile, "replace"); +@@ -37,7 +40,7 @@ void Activation::onStateChanges(sdbusplus::message::message& msg) + // Read the msg and populate each variable + msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult); + +- auto rwServiceFile = "obmc-flash-bmc-ubirw.service"; ++ auto rwServiceFile = "obmc-flash-bmc-ubirw@" + versionId + ".service"; + auto roServiceFile = "obmc-flash-bmc-ubiro@" + versionId + ".service"; + auto ubootVarsServiceFile = + "obmc-flash-bmc-updateubootvars@" + versionId + ".service"; +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0004-Changed-the-condition-of-software-version-service-wa.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0004-Changed-the-condition-of-software-version-service-wa.patch new file mode 100644 index 000000000..3fc3907ba --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0004-Changed-the-condition-of-software-version-service-wa.patch @@ -0,0 +1,41 @@ +From 1b00440d0c8fabfa2e3eda984a21c0f004ca2150 Mon Sep 17 00:00:00 2001 +From: Jennifer Lee <jennifer1.lee@intel.com> +Date: Fri, 26 Oct 2018 11:54:05 -0700 +Subject: [PATCH 4/6] Changed the condition of software version service + watching deamon + + Originally it watches only files that are "written" into /tmp/images directory. +This change modified the condition to also watch files that are "moved" into this directory. + +Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> +Change-Id: I3e9cf1ffc3f5350d4649d32d3d3837991322a65b +--- + watch.cpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/watch.cpp b/watch.cpp +index e46b8aa..eee1bc3 100644 +--- a/watch.cpp ++++ b/watch.cpp +@@ -45,7 +45,7 @@ Watch::Watch(sd_event* loop, std::function<int(std::string&)> imageCallback) : + std::strerror(error)); + } + +- wd = inotify_add_watch(fd, IMG_UPLOAD_DIR, IN_CLOSE_WRITE); ++ wd = inotify_add_watch(fd, IMG_UPLOAD_DIR, IN_CLOSE_WRITE | IN_MOVED_TO); + if (-1 == wd) + { + auto error = errno; +@@ -96,7 +96,8 @@ int Watch::callback(sd_event_source* s, int fd, uint32_t revents, + while (offset < bytes) + { + auto event = reinterpret_cast<inotify_event*>(&buffer[offset]); +- if ((event->mask & IN_CLOSE_WRITE) && !(event->mask & IN_ISDIR)) ++ if ((event->mask & (IN_CLOSE_WRITE | IN_MOVED_TO)) && ++ !(event->mask & IN_ISDIR)) + { + auto tarballPath = std::string{IMG_UPLOAD_DIR} + '/' + event->name; + auto rc = static_cast<Watch*>(userdata)->imageCallback(tarballPath); +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0005-Modified-firmware-activation-to-launch-fwupd.sh-thro.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0005-Modified-firmware-activation-to-launch-fwupd.sh-thro.patch new file mode 100644 index 000000000..aa5d900e0 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0005-Modified-firmware-activation-to-launch-fwupd.sh-thro.patch @@ -0,0 +1,188 @@ +From 7f29c255dd2af7fa6d38b02ad63a8b8940fbce84 Mon Sep 17 00:00:00 2001 +From: Jennifer Lee <jennifer1.lee@intel.com> +Date: Mon, 10 Dec 2018 10:36:44 -0800 +Subject: [PATCH 5/6] Modified firmware activation to launch fwupd.sh through + non-ubi fs code path to match more closely to the upstream design - + Added option FWUPD_SCRIPT to saperate intel customized code - Adopted + ActivationProgress from ubi fs activation code mainly for progress indicator + for ipmi update + +Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> +Change-Id: Id805deea75b21fab86f6bb6edbf50ddb3be42564 +--- + activation.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ + configure.ac | 7 +++++++ + static/flash.cpp | 41 +++++++++++++++++++++++++++++++++++++++-- + ubi/flash.cpp | 9 +++------ + 4 files changed, 93 insertions(+), 8 deletions(-) + +diff --git a/activation.cpp b/activation.cpp +index f918221..f2923ae 100644 +--- a/activation.cpp ++++ b/activation.cpp +@@ -163,6 +163,50 @@ auto Activation::activation(Activations value) -> Activations + softwareServer::Activation::Activations::Active); + } + } ++#elif defined(FWUPD_SCRIPT) ++ if (!activationProgress) ++ { ++ // Enable systemd signals ++ Activation::subscribeToSystemdSignals(); ++ parent.freeSpace(*this); ++ ++ activationProgress = ++ std::make_unique<ActivationProgress>(bus, path); ++ ++#ifdef WANT_SIGNATURE_VERIFY ++ fs::path uploadDir(IMG_UPLOAD_DIR); ++ if (!verifySignature(uploadDir / versionId, SIGNED_IMAGE_CONF_PATH)) ++ { ++ onVerifyFailed(); ++ // Stop the activation process, if fieldMode is enabled. ++ if (parent.control::FieldMode::fieldModeEnabled()) ++ { ++ return softwareServer::Activation::activation( ++ softwareServer::Activation::Activations::Failed); ++ } ++ } ++#endif ++ flashWrite(); ++ activationProgress->progress(10); ++ } ++ else if (activationProgress->progress() == 100) ++ { ++ log<level::ERR>("[Jennifer] progress == 100..."); ++ if (!redundancyPriority) ++ { ++ redundancyPriority = ++ std::make_unique<RedundancyPriority>(bus, path, *this, 0); ++ } ++ ++ // Remove version object from image manager ++ Activation::deleteImageManagerObject(); ++ ++ // Create active association ++ parent.createActiveAssociation(path); ++ ++ return softwareServer::Activation::activation( ++ softwareServer::Activation::Activations::Active); ++ } + #else // !UBIFS_LAYOUT + + #ifdef WANT_SIGNATURE_VERIFY +diff --git a/configure.ac b/configure.ac +index 2da97ad..720e704 100755 +--- a/configure.ac ++++ b/configure.ac +@@ -184,6 +184,13 @@ AS_IF([test "x$enable_ubifs_layout" == "xyes"], \ + [AC_DEFINE([UBIFS_LAYOUT],[],[Enable ubifs support.])]) + AM_CONDITIONAL([UBIFS_LAYOUT], [test "x$enable_ubifs_layout" == "xyes"]) + ++# setup fwupd script support ++AC_ARG_ENABLE([fwupd_script], ++ AS_HELP_STRING([--enable-fwupd_script], [Enable fwupd script support.])) ++AS_IF([test "x$enable_fwupd_script" == "xyes"], \ ++ [AC_DEFINE([FWUPD_SCRIPT],[],[Enable fwupd script support.])]) ++AM_CONDITIONAL([FWUPD_SCRIPT], [test "x$enable_fwupd_script" == "xyes"]) ++ + # Check for header files. + AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])]) + AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/server.hpp...openbmc/sdbusplus package required])]) +diff --git a/static/flash.cpp b/static/flash.cpp +index 82c2393..1bf29d5 100644 +--- a/static/flash.cpp ++++ b/static/flash.cpp +@@ -20,9 +20,11 @@ namespace updater + { + + namespace fs = std::experimental::filesystem; ++namespace softwareServer = sdbusplus::xyz::openbmc_project::Software::server; + + void Activation::flashWrite() + { ++#ifndef FWUPD_SCRIPT + // For static layout code update, just put images in /run/initramfs. + // It expects user to trigger a reboot and an updater script will program + // the image to flash during reboot. +@@ -33,11 +35,46 @@ void Activation::flashWrite() + fs::copy_file(uploadDir / versionId / bmcImage, toPath / bmcImage, + fs::copy_options::overwrite_existing); + } ++ ++#else ++ auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, ++ SYSTEMD_INTERFACE, "StartUnit"); ++ method.append("fwupd@" + versionId + ".service", "replace"); ++ bus.call_noreply(method); ++#endif + } + +-void Activation::onStateChanges(sdbusplus::message::message& /*msg*/) ++void Activation::onStateChanges(sdbusplus::message::message& msg) + { +- // Empty ++#ifndef FWUPD_SCRIPT ++ uint32_t newStateID{}; ++ sdbusplus::message::object_path newStateObjPath; ++ std::string newStateUnit{}; ++ std::string newStateResult{}; ++ ++ msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult); ++ ++ auto rwServiceFile = "fwupdw@" + versionId + ".service"; ++ ++ if (newStateUnit == rwServiceFile && newStateResult == "done") ++ { ++ activationProgress->progress(100); ++ } ++ ++ if (newStateUnit == rwServiceFile) ++ { ++ if (newStateResult == "failed" || newStateResult == "dependency") ++ { ++ Activation::activation( ++ softwareServer::Activation::Activations::Failed); ++ } ++ else ++ { ++ Activation::activation( ++ softwareServer::Activation::Activations::Activating); ++ } ++ } ++#endif + } + + } // namespace updater +diff --git a/ubi/flash.cpp b/ubi/flash.cpp +index 5af2a17..ffa9348 100644 +--- a/ubi/flash.cpp ++++ b/ubi/flash.cpp +@@ -15,13 +15,10 @@ void Activation::flashWrite() + { + auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, + SYSTEMD_INTERFACE, "StartUnit"); +- std::string rwServiceFile = +- "obmc-flash-bmc-ubirw@" + versionId + ".service"; +- method.append(rwServiceFile, "replace"); ++ method.append("obmc-flash-bmc-ubirw.service", "replace"); + bus.call_noreply(method); + +- std::string roServiceFile = +- "obmc-flash-bmc-ubiro@" + versionId + ".service"; ++ auto roServiceFile = "obmc-flash-bmc-ubiro@" + versionId + ".service"; + method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, + SYSTEMD_INTERFACE, "StartUnit"); + method.append(roServiceFile, "replace"); +@@ -40,7 +37,7 @@ void Activation::onStateChanges(sdbusplus::message::message& msg) + // Read the msg and populate each variable + msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult); + +- auto rwServiceFile = "obmc-flash-bmc-ubirw@" + versionId + ".service"; ++ auto rwServiceFile = "obmc-flash-bmc-ubirw.service"; + auto roServiceFile = "obmc-flash-bmc-ubiro@" + versionId + ".service"; + auto ubootVarsServiceFile = + "obmc-flash-bmc-updateubootvars@" + versionId + ".service"; +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0006-Modify-the-ID-of-software-image-updater-object-on-DB.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0006-Modify-the-ID-of-software-image-updater-object-on-DB.patch new file mode 100644 index 000000000..2d2ac2673 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0006-Modify-the-ID-of-software-image-updater-object-on-DB.patch @@ -0,0 +1,44 @@ +From 9b3c44e9fb3d907c0152f14b967e23ab964c0e0b Mon Sep 17 00:00:00 2001 +From: Jennifer Lee <jennifer1.lee@intel.com> +Date: Thu, 14 Feb 2019 14:54:45 -0800 +Subject: [PATCH 6/6] Modify the ID of software image updater object on DBus to + allow force update onto same version image + +In the original design of image update, it does not allow the same version of image to be flashed onto itself. +But this blocks validation tests and in most of the cases we don't prevent user from doing such update. + +This patch appends a random number after the version ID hash string to unblock such limitation. + +Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> +Change-Id: I16aba4804ae1bc2e8784320f91c0419fb8b23c35 +--- + image_manager.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/image_manager.cpp b/image_manager.cpp +index 5b2ff49..e3d26e3 100644 +--- a/image_manager.cpp ++++ b/image_manager.cpp +@@ -9,6 +9,7 @@ + #include <stdlib.h> + #include <sys/stat.h> + #include <sys/wait.h> ++#include <time.h> + #include <unistd.h> + + #include <algorithm> +@@ -129,6 +130,11 @@ int Manager::processImage(const std::string& tarFilePath) + // Compute id + auto id = Version::getId(version); + ++ // Append a random number after the original version hash ++ // This will allow forcing image update onto the same version ++ srand(time(NULL)); ++ id = id + "_" + std::to_string(rand()); ++ + fs::path imageDirPath = std::string{IMG_UPLOAD_DIR}; + imageDirPath /= id; + +-- +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 80c5ea9d3..719c2562a 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 @@ -3,9 +3,11 @@ 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;protocol=ssh" -SRCREV = "f8f76c29dbe2806a6eacd15847563cdf7f7567f4" - #Currently enforcing image signature validation only for PFR images PACKAGECONFIG_append = "${@bb.utils.contains('IMAGE_TYPE', 'pfr', ' verify_signature', '', d)}" + +SRC_URI += "file://0002-Redfish-firmware-activation.patch \ + file://0004-Changed-the-condition-of-software-version-service-wa.patch \ + file://0005-Modified-firmware-activation-to-launch-fwupd.sh-thro.patch \ + file://0006-Modify-the-ID-of-software-image-updater-object-on-DB.patch \ + " 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 7347fe483..588ae46b6 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/gpiodaemon/gpiodaemon.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/gpiodaemon/gpiodaemon.bb @@ -8,9 +8,9 @@ S = "${WORKDIR}/git/gpiodaemon" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" -SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh" +SRC_URI = "git://github.com/Intel-BMC/provingground.git;protocol=ssh" -SRCREV = "785f19b128794611574ea6c18805740fb851ecff" +SRCREV = "ec8f1c06be71d6059c82fd442475420286f5dbcd" inherit cmake systemd SYSTEMD_SERVICE_${PN} = "gpiodaemon.service" 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 3ff46cdc9..62e332e2e 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 = "0e7de46f9b6365bad4e79a3933112750c5bf7853" +SRCREV = "22c33710fed78a5c47446ee91ececf8b8ab104db" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-config/channel_config.json b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-config/channel_config.json index 13b945fd0..a7815a9a9 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-config/channel_config.json +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-config/channel_config.json @@ -55,12 +55,12 @@ } }, "5" : { - "name" : "ICMB", + "name" : "RESERVED", "is_valid" : false, "active_sessions" : 0, "channel_info" : { - "medium_type" : "ipmb", - "protocol_type" : "ipmb-1.0", + "medium_type" : "reserved", + "protocol_type" : "na", "session_supported" : "session-less", "is_ipmi" : true } @@ -77,12 +77,12 @@ } }, "7" : { - "name" : "SMM", + "name" : "ipmi-kcs4", "is_valid" : true, "active_sessions" : 0, "channel_info" : { - "medium_type" : "ipmb", - "protocol_type" : "ipmb-1.0", + "medium_type" : "system-interface", + "protocol_type" : "kcs", "session_supported" : "session-less", "is_ipmi" : true } @@ -92,8 +92,8 @@ "is_valid" : true, "active_sessions" : 0, "channel_info" : { - "medium_type" : "ipmb", - "protocol_type" : "ipmb-1.0", + "medium_type" : "oem", + "protocol_type" : "oem", "session_supported" : "session-less", "is_ipmi" : true } @@ -125,8 +125,8 @@ "is_valid" : false, "active_sessions" : 0, "channel_info" : { - "medium_type" : "ipmb", - "protocol_type" : "ipmb-1.0", + "medium_type" : "reserved", + "protocol_type" : "na", "session_supported" : "session-less", "is_ipmi" : true } @@ -147,8 +147,8 @@ "is_valid" : false, "active_sessions" : 0, "channel_info" : { - "medium_type" : "ipmb", - "protocol_type" : "ipmb-1.0", + "medium_type" : "reserved", + "protocol_type" : "na", "session_supported" : "session-less", "is_ipmi" : true } @@ -158,19 +158,19 @@ "is_valid" : false, "active_sessions" : 0, "channel_info" : { - "medium_type" : "ipmb", - "protocol_type" : "ipmb-1.0", + "medium_type" : "unknown", + "protocol_type" : "na", "session_supported" : "session-less", "is_ipmi" : true } }, "15" : { - "name" : "SMS", + "name" : "ipmi-kcs3", "is_valid" : true, "active_sessions" : 0, "channel_info" : { - "medium_type" : "ipmb", - "protocol_type" : "ipmb-1.0", + "medium_type" : "system-interface", + "protocol_type" : "kcs", "session_supported" : "session-less", "is_ipmi" : true } diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-config/master_write_read_white_list.json b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-config/master_write_read_white_list.json index 9fdb3c916..6fc46f452 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-config/master_write_read_white_list.json +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-config/master_write_read_white_list.json @@ -1,49 +1,76 @@ { "filters": [ { + "Description": "Allow full read - ignore first byte write value", "busId": "0x01", "slaveAddr": "0x4d", - "command": "0x00" + "slaveAddrMask": "0x00", + "command": "0x00", + "commandMask": "0xFF" }, { + "Description": "Allow full read - ignore first byte write value", "busId": "0x01", "slaveAddr": "0x57", - "command": "0x00" + "slaveAddrMask": "0x00", + "command": "0x00", + "commandMask": "0xFF" }, { + "Description": "Allow full read - ignore first byte write value", "busId": "0x02", "slaveAddr": "0x40", - "command": "0x00" + "slaveAddrMask": "0x00", + "command": "0x00", + "commandMask": "0xFF" }, { + "Description": "Allow full read - ignore first byte write value", "busId": "0x02", "slaveAddr": "0x49", - "command": "0x00" + "slaveAddrMask": "0x00", + "command": "0x00", + "commandMask": "0xFF" }, { + "Description": "Allow full read - ignore first byte write value", "busId": "0x02", "slaveAddr": "0x51", - "command": "0x00" + "slaveAddrMask": "0x00", + "command": "0x00", + "commandMask": "0xFF" }, { + "Description": "Allow full read - ignore first byte write value", "busId": "0x03", "slaveAddr": "0x44", - "command": "0x00" + "slaveAddrMask": "0x00", + "command": "0x00", + "commandMask": "0xFF" }, { + "Description": "Allow full read - ignore first byte write value", "busId": "0x03", "slaveAddr": "0x68", - "command": "0x00" + "slaveAddrMask": "0x00", + "command": "0x00", + "commandMask": "0xFF" }, { + "Description": "Allow full read - ignore first byte write value", "busId": "0x06", "slaveAddr": "0x40", - "command": "0x00" + "slaveAddrMask": "0x00", + "command": "0x00", + "commandMask": "0xFF" }, { + "Description": "Allow full read - ignore first byte write value", "busId": "0x07", "slaveAddr": "0x51", - "command": "0x00" + "slaveAddrMask": "0x00", + "command": "0x00", + "commandMask": "0xFF" } ] } diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0003-Modify-dbus-interface-for-chassis-control.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0003-Modify-dbus-interface-for-chassis-control.patch deleted file mode 100644 index 9061481ac..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0003-Modify-dbus-interface-for-chassis-control.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 48ac37551cd51415deafe8b1dcb23ebeef1e8ade Mon Sep 17 00:00:00 2001 -From: Yong Li <yong.b.li@linux.intel.com> -Date: Mon, 17 Sep 2018 13:04:42 +0800 -Subject: [PATCH] Modify-dbus-interface-for-chassis-control - -Switch chassis control service namespace from "org" to "xyz", -to compatible with new intel-chassis services - -Signed-off-by: Kuiying Wang <kuiying.wang@intel.com> -Signed-off-by: Yong Li <yong.b.li@linux.intel.com> ---- - apphandler.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/apphandler.cpp b/apphandler.cpp -index b089331..f2889c5 100644 ---- a/apphandler.cpp -+++ b/apphandler.cpp -@@ -393,9 +393,9 @@ ipmi_ret_t ipmi_app_get_device_guid(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - ipmi_data_len_t data_len, - ipmi_context_t context) - { -- const char* objname = "/org/openbmc/control/chassis0"; -+ const char* objname = "/xyz/openbmc_project/Chassis/Control/Chassis"; - const char* iface = "org.freedesktop.DBus.Properties"; -- const char* chassis_iface = "org.openbmc.control.Chassis"; -+ const char* chassis_iface = "xyz.openbmc_project.Chassis.Control.Chassis"; - sd_bus_message* reply = NULL; - sd_bus_error error = SD_BUS_ERROR_NULL; - int r = 0; --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0012-ipmi-set-get-boot-options.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0012-ipmi-set-get-boot-options.patch index 243015c95..fb5dcee09 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0012-ipmi-set-get-boot-options.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0012-ipmi-set-get-boot-options.patch @@ -21,9 +21,8 @@ index 666addb..77af2dc 100644 std::map<IpmiValue, Source::Sources> sourceIpmiToDbus = { {0x01, Source::Sources::Network}, {0x02, Source::Sources::Disk}, -- {0x05, Source::Sources::ExternalMedia}, -+ {0x05, Source::Sources::DVD}, -+ {0x0f, Source::Sources::Removable}, + {0x05, Source::Sources::ExternalMedia}, ++ {0x0f, Source::Sources::RemovableMedia}, {ipmiDefault, Source::Sources::Default}}; std::map<IpmiValue, Mode::Modes> modeIpmiToDbus = { @@ -31,9 +30,8 @@ index 666addb..77af2dc 100644 std::map<Source::Sources, IpmiValue> sourceDbusToIpmi = { {Source::Sources::Network, 0x01}, {Source::Sources::Disk, 0x02}, -- {Source::Sources::ExternalMedia, 0x05}, -+ {Source::Sources::DVD, 0x05}, -+ {Source::Sources::Removable, 0x0f}, + {Source::Sources::ExternalMedia, 0x05}, ++ {Source::Sources::RemovableMedia, 0x0f}, {Source::Sources::Default, ipmiDefault}}; std::map<Mode::Modes, IpmiValue> modeDbusToIpmi = { diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0014-Enable-get-device-guid-ipmi-command.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0014-Enable-get-device-guid-ipmi-command.patch deleted file mode 100644 index 46dd99466..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0014-Enable-get-device-guid-ipmi-command.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 482a6cc52d0ec514d6da5f4bcb04b4991f3cc36e Mon Sep 17 00:00:00 2001 -From: Yong Li <yong.b.li@linux.intel.com> -Date: Mon, 17 Sep 2018 13:41:25 +0800 -Subject: [PATCH] Enable get device guid ipmi command - -The UUID interface is changed, modify the API to get the correct UUID -for device guid - -Change-Id: I0c0c7bd350992ac03f928707986a7180407d8f3f -Signed-off-by: Yong Li <yong.b.li@linux.intel.com> ---- - apphandler.cpp | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/apphandler.cpp b/apphandler.cpp -index 937be71..89d797a 100644 ---- a/apphandler.cpp -+++ b/apphandler.cpp -@@ -392,9 +392,10 @@ ipmi_ret_t ipmi_app_get_device_guid(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - ipmi_data_len_t data_len, - ipmi_context_t context) - { -- const char* objname = "/xyz/openbmc_project/Chassis/Control/Chassis"; -+ const char* objname = -+ "/xyz/openbmc_project/inventory/system/chassis/motherboard/bmc"; - const char* iface = "org.freedesktop.DBus.Properties"; -- const char* chassis_iface = "xyz.openbmc_project.Chassis.Control.Chassis"; -+ const char* uuid_iface = "xyz.openbmc_project.Common.UUID"; - sd_bus_message* reply = NULL; - sd_bus_error error = SD_BUS_ERROR_NULL; - int r = 0; -@@ -426,8 +427,9 @@ ipmi_ret_t ipmi_app_get_device_guid(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - entry("ERRNO=0x%X", -r)); - goto finish; - } -+ - r = sd_bus_call_method(bus, busname, objname, iface, "Get", &error, &reply, -- "ss", chassis_iface, "uuid"); -+ "ss", uuid_iface, "UUID"); - if (r < 0) - { - log<level::ERR>("Failed to call Get Method", entry("ERRNO=0x%X", -r)); --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0021-Implement-IPMI-Commmand-Get-Host-Restart-Cause.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0021-Implement-IPMI-Commmand-Get-Host-Restart-Cause.patch index af526c177..cba0cde32 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0021-Implement-IPMI-Commmand-Get-Host-Restart-Cause.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0021-Implement-IPMI-Commmand-Get-Host-Restart-Cause.patch @@ -1,4 +1,4 @@ -From c14e31ebc35e0bb7b843d84683f9f2698c9c08d7 Mon Sep 17 00:00:00 2001 +From 6d5a372e0cf98de4d97a88d2cd42a00b7a8f034f Mon Sep 17 00:00:00 2001 From: Yong Li <yong.b.li@linux.intel.com> Date: Sun, 16 Sep 2018 21:32:38 +0800 Subject: [PATCH] Implement IPMI Commmand - Get Host Restart Cause. @@ -25,16 +25,16 @@ Change-Id: Id3b32e271b85b5fc4c69d5ca40227f8f9c08ce48 Signed-off-by: Kuiying Wang <kuiying.wang@intel.com> Signed-off-by: Yong Li <yong.b.li@linux.intel.com> --- - chassishandler.cpp | 54 +++++++++++++++++++++++++++++++++++++++++++++++ - chassishandler.hpp | 1 + + chassishandler.cpp | 54 +++++++++++++++++++++++++++++++++++++++ + chassishandler.hpp | 1 + host-ipmid-whitelist.conf | 1 + 3 files changed, 56 insertions(+) diff --git a/chassishandler.cpp b/chassishandler.cpp -index 77af2dc..2a29755 100644 +index d20b220..8a8cb26 100644 --- a/chassishandler.cpp +++ b/chassishandler.cpp -@@ -107,6 +107,11 @@ static constexpr auto chassisPOHStateIntf = +@@ -90,6 +90,11 @@ static constexpr auto chassisPOHStateIntf = "xyz.openbmc_project.State.PowerOnHours"; static constexpr auto pOHCounterProperty = "POHCounter"; static constexpr auto match = "chassis0"; @@ -46,7 +46,7 @@ index 77af2dc..2a29755 100644 const static constexpr char chassisCapIntf[] = "xyz.openbmc_project.Control.ChassisCapabilities"; const static constexpr char chassisCapFlagsProp[] = "CapabilitiesFlags"; -@@ -324,6 +329,13 @@ struct set_sys_boot_options_t +@@ -176,6 +181,13 @@ struct set_sys_boot_options_t uint8_t data[SIZE_BOOT_OPTION]; } __attribute__((packed)); @@ -60,7 +60,7 @@ index 77af2dc..2a29755 100644 int getHostNetworkData(get_sys_boot_options_response_t* respptr) { ipmi::PropertyMap properties; -@@ -1598,6 +1610,44 @@ ipmi_ret_t ipmi_chassis_set_sys_boot_options(ipmi_netfn_t netfn, ipmi_cmd_t cmd, +@@ -1584,6 +1596,44 @@ ipmi_ret_t ipmi_chassis_set_sys_boot_options(ipmi_netfn_t netfn, ipmi_cmd_t cmd, return rc; } @@ -102,20 +102,20 @@ index 77af2dc..2a29755 100644 + return rc; +} + - ipmi_ret_t ipmiGetPOHCounter(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) + /** @brief implements Get POH counter command + * @parameter + * - none @@ -1739,4 +1789,8 @@ void register_netfn_chassis_functions() - ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_SET_RESTORE_POLICY, NULL, - ipmi_chassis_set_power_restore_policy, - PRIVILEGE_OPERATOR); + ipmi::chassis::cmdSetPowerRestorePolicy, + ipmi::Privilege::Operator, + ipmiChassisSetPowerRestorePolicy); + + // <get Host Restart Cause> + ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_GET_SYS_RESTART_CAUSE, NULL, + ipmi_chassis_get_sys_restart_cause, PRIVILEGE_USER); } diff --git a/chassishandler.hpp b/chassishandler.hpp -index 0c6d5a2..e37c4f1 100644 +index 49b5ef8..2c42b11 100644 --- a/chassishandler.hpp +++ b/chassishandler.hpp @@ -17,6 +17,7 @@ enum ipmi_netfn_chassis_cmds @@ -127,10 +127,10 @@ index 0c6d5a2..e37c4f1 100644 IPMI_CMD_GET_SYS_BOOT_OPTIONS = 0x09, IPMI_CMD_GET_POH_COUNTER = 0x0F, diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf -index db54a49..827e2dc 100644 +index c1fca1d..94232de 100644 --- a/host-ipmid-whitelist.conf +++ b/host-ipmid-whitelist.conf -@@ -3,6 +3,7 @@ +@@ -4,6 +4,7 @@ 0x00:0x02 //<Chassis>:<Chassis Control> 0x00:0x05 //<Chassis>:<Set Chassis Capabilities> 0x00:0x06 //<Chassis>:<Set Power Restore Policy> @@ -139,5 +139,5 @@ index db54a49..827e2dc 100644 0x00:0x09 //<Chassis>:<Get System Boot Options> 0x00:0x0F //<Chassis>:<Get POH Counter Command> -- -2.7.4 +2.17.1 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0048-Implement-IPMI-Master-Write-Read-command.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0048-Implement-IPMI-Master-Write-Read-command.patch deleted file mode 100644 index 542c4f667..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0048-Implement-IPMI-Master-Write-Read-command.patch +++ /dev/null @@ -1,351 +0,0 @@ -From a8d7429b7bd9dea33d59c6e83f17372e77fe6145 Mon Sep 17 00:00:00 2001 -From: Yong Li <yong.b.li@linux.intel.com> -Date: Fri, 21 Sep 2018 09:21:14 +0800 -Subject: [PATCH] Implement IPMI Master Write-Read command - -This command can be used for low-level I2C/SMBus write, read, or write-read -accesses to the IPMB or private busses behind a management controller. - -The command can also be used for providing low-level access to devices -that provide an SMBus slave interface. - -Signed-off-by: Yong Li <yong.b.li@linux.intel.com> ---- - apphandler.cpp | 276 +++++++++++++++++++++++++++++++++++++- - apphandler.hpp | 1 + - host-ipmid-whitelist.conf | 1 + - 3 files changed, 274 insertions(+), 4 deletions(-) - -diff --git a/apphandler.cpp b/apphandler.cpp -index 15965ca..d8fb23d 100644 ---- a/apphandler.cpp -+++ b/apphandler.cpp -@@ -1,6 +1,19 @@ -+#include "apphandler.hpp" -+ -+#include "app/watchdog.hpp" -+#include "sys_info_param.hpp" -+#include "transporthandler.hpp" -+ - #include <arpa/inet.h> -+#include <fcntl.h> -+#include <ipmid/api.h> - #include <limits.h> -+#include <linux/i2c-dev.h> -+#include <linux/i2c.h> - #include <mapper.h> -+#include <sys/ioctl.h> -+#include <sys/stat.h> -+#include <sys/types.h> - #include <systemd/sd-bus.h> - #include <unistd.h> - -@@ -41,6 +54,8 @@ constexpr auto bmc_guid_interface = "xyz.openbmc_project.Common.UUID"; - constexpr auto bmc_guid_property = "UUID"; - constexpr auto bmc_guid_len = 16; - -+static constexpr uint8_t maxIPMIWriteReadSize = 144; -+ - static constexpr auto redundancyIntf = - "xyz.openbmc_project.Software.RedundancyPriority"; - static constexpr auto versionIntf = "xyz.openbmc_project.Software.Version"; -@@ -59,6 +74,47 @@ using BMC = sdbusplus::xyz::openbmc_project::State::server::BMC; - namespace fs = std::filesystem; - namespace variant_ns = sdbusplus::message::variant_ns; - -+// Offset in get device id command. -+typedef struct -+{ -+ uint8_t id; -+ uint8_t revision; -+ uint8_t fw[2]; -+ uint8_t ipmi_ver; -+ uint8_t addn_dev_support; -+ uint8_t manuf_id[3]; -+ uint8_t prod_id[2]; -+ uint8_t aux[4]; -+} __attribute__((packed)) ipmi_device_id_t; -+ -+typedef struct -+{ -+ uint8_t busId; -+ uint8_t slaveAddr; -+ uint8_t readCount; -+} __attribute__((packed)) ipmiI2cRwReq; -+ -+typedef struct -+{ -+ uint8_t busId; -+ uint8_t slaveAddr; -+ std::vector<uint8_t> data; -+} ipmiMasterRwWhitelist; -+ -+static std::vector<ipmiMasterRwWhitelist>& getWhiteList() -+{ -+ static std::vector<ipmiMasterRwWhitelist> rwWhiteList; -+ return rwWhiteList; -+} -+ -+static constexpr const char* whiteListFilename = -+ "/usr/share/ipmi-providers/master_write_read_white_list.json"; -+ -+static constexpr const char* filtersStr = "filters"; -+static constexpr const char* busIdStr = "busId"; -+static constexpr const char* slaveAddrStr = "slaveAddr"; -+static constexpr const char* cmdStr = "command"; -+ - /** - * @brief Returns the Version info from primary s/w object - * -@@ -1022,6 +1078,192 @@ writeResponse: - return IPMI_CC_OK; - } - -+static int loadI2CWhiteList() -+{ -+ nlohmann::json data = nullptr; -+ std::ifstream jsonFile(whiteListFilename); -+ -+ if (!jsonFile.good()) -+ { -+ log<level::WARNING>("whitelist file not found!"); -+ return -1; -+ } -+ -+ try -+ { -+ data = nlohmann::json::parse(jsonFile, nullptr, false); -+ } -+ catch (nlohmann::json::parse_error& e) -+ { -+ log<level::ERR>("Corrupted whitelist config file", -+ entry("MSG: %s", e.what())); -+ return -1; -+ } -+ -+ try -+ { -+ unsigned int i = 0; -+ nlohmann::json filters = data[filtersStr].get<nlohmann::json>(); -+ getWhiteList().resize(filters.size()); -+ -+ for (const auto& it : filters.items()) -+ { -+ nlohmann::json filter = it.value(); -+ if (filter.is_null()) -+ { -+ log<level::ERR>("Incorrect filter"); -+ return -1; -+ } -+ -+ getWhiteList()[i].busId = -+ std::stoul(filter[busIdStr].get<std::string>(), nullptr, 16); -+ -+ getWhiteList()[i].slaveAddr = std::stoul( -+ filter[slaveAddrStr].get<std::string>(), nullptr, 16); -+ -+ std::string command = filter[cmdStr].get<std::string>(); -+ -+ log<level::DEBUG>("IPMI I2C whitelist ", entry("INDEX=%d", i), -+ entry("BUS=%d", getWhiteList()[i].busId), -+ entry("ADDR=0x%x", getWhiteList()[i].slaveAddr), -+ entry("LEN=0x%x", command.length()), -+ entry("COMMAND=[%s]", command.c_str())); -+ -+ // convert data string -+ std::istringstream iss(command); -+ std::string token; -+ while (std::getline(iss, token, ' ')) -+ { -+ log<level::DEBUG>("IPMI I2C command\n", -+ entry("TOKEN=%s", token.c_str())); -+ getWhiteList()[i].data.emplace_back( -+ std::stoul(token, nullptr, 16)); -+ } -+ i++; -+ } -+ } -+ catch (std::exception& e) -+ { -+ log<level::ERR>("unexpected exception", entry("ERROR=%s", e.what())); -+ return -1; -+ } -+ return 0; -+} -+ -+ipmi_ret_t ipmiMasterWriteRead(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 foundInList = false; -+ int ret = 0; -+ i2c_rdwr_ioctl_data msgRdwr = {0}; -+ i2c_msg i2cmsg[2] = {0}; -+ ipmiI2cRwReq* reqi2c = reinterpret_cast<ipmiI2cRwReq*>(request); -+ -+ if (*data_len <= sizeof(ipmiI2cRwReq)) -+ { -+ log<level::ERR>("Failed in request", entry("LEN=%d", *data_len)); -+ *data_len = 0; -+ return IPMI_CC_REQ_DATA_LEN_INVALID; -+ } -+ -+ if (reqi2c->readCount > maxIPMIWriteReadSize) -+ { -+ log<level::ERR>("Failed in request", entry("R=%d", reqi2c->readCount)); -+ *data_len = 0; -+ return IPMI_CC_PARM_OUT_OF_RANGE; -+ } -+ -+ uint8_t* resptr = reinterpret_cast<uint8_t*>(response); -+ uint8_t busId = (reqi2c->busId & 0xFF) >> 1; -+ // Convert the I2C address from 7-bit format -+ uint8_t i2cAddr = reqi2c->slaveAddr >> 1; -+ size_t writeCount = *data_len - sizeof(ipmiI2cRwReq); -+ -+ log<level::DEBUG>( -+ "INPUT: ", entry("LEN=%d", *data_len), entry("ID=0x%x", busId), -+ entry("ADDR=0x%x", reqi2c->slaveAddr), entry("R=%d", reqi2c->readCount), -+ entry("W=%d", writeCount)); -+ -+ *data_len = 0; -+ -+ std::vector<uint8_t> inBuf(reqi2c->readCount); -+ std::vector<uint8_t> outBuf(writeCount); -+ uint8_t* reqptr = reinterpret_cast<uint8_t*>(request); -+ -+ reqptr += sizeof(ipmiI2cRwReq); -+ std::copy(reqptr, reqptr + writeCount, outBuf.begin()); -+ -+ log<level::DEBUG>("checking list ", -+ entry("SIZE=%d", getWhiteList().size())); -+ // command whitelist checking -+ for (unsigned int i = 0; i < getWhiteList().size(); i++) -+ { -+ // TODO add wildchard/regex support -+ if ((busId == getWhiteList()[i].busId) && -+ (i2cAddr == getWhiteList()[i].slaveAddr) && -+ (outBuf == getWhiteList()[i].data)) -+ { -+ log<level::DEBUG>("In whitelist"); -+ foundInList = true; -+ break; -+ } -+ } -+ -+ if (!foundInList) -+ { -+ log<level::ERR>("Request blocked!", entry("BUS=%d", busId), -+ entry("ADDR=0x%x", reqi2c->slaveAddr)); -+ return IPMI_CC_INVALID_FIELD_REQUEST; -+ } -+ -+ log<level::DEBUG>("IPMI Master WriteRead ", entry("BUS=%d", busId), -+ entry("ADDR=0x%x", reqi2c->slaveAddr), -+ entry("R=%d", reqi2c->readCount), -+ entry("W=%d", writeCount)); -+ -+ std::string i2cBus = "/dev/i2c-" + std::to_string(busId); -+ -+ int i2cDev = ::open(i2cBus.c_str(), O_RDWR | O_CLOEXEC); -+ if (i2cDev < 0) -+ { -+ log<level::ERR>("Failed in opening i2c device", -+ entry("BUS=%s", i2cBus.c_str())); -+ return IPMI_CC_UNSPECIFIED_ERROR; -+ } -+ -+ // write message -+ i2cmsg[0].addr = i2cAddr; -+ i2cmsg[0].flags = 0x00; -+ i2cmsg[0].len = writeCount; -+ i2cmsg[0].buf = outBuf.data(); -+ -+ // read message -+ i2cmsg[1].addr = i2cAddr; -+ i2cmsg[1].flags = I2C_M_RD; -+ i2cmsg[1].len = reqi2c->readCount; -+ i2cmsg[1].buf = inBuf.data(); -+ -+ msgRdwr.msgs = i2cmsg; -+ msgRdwr.nmsgs = 2; -+ -+ ret = ::ioctl(i2cDev, I2C_RDWR, &msgRdwr); -+ ::close(i2cDev); -+ -+ // TODO add completion code support -+ if (ret < 0) -+ { -+ log<level::ERR>("RDWR ioctl error", entry("RET=%d", ret)); -+ return IPMI_CC_UNSPECIFIED_ERROR; -+ } -+ -+ *data_len = msgRdwr.msgs[1].len; -+ std::copy(msgRdwr.msgs[1].buf, msgRdwr.msgs[1].buf + msgRdwr.msgs[1].len, -+ resptr); -+ -+ return IPMI_CC_OK; -+} -+ - void register_netfn_app_functions() - { - // <Get Device ID> -@@ -1063,6 +1306,31 @@ void register_netfn_app_functions() - ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_ACPI, NULL, - ipmi_app_get_acpi_power_state, PRIVILEGE_ADMIN); - -+// TODO: Below code and associated api's need to be removed later. -+// Its commented for now to avoid merge conflicts with upstream -+// changes and smooth upstream upgrades. -+#if 0 -+>>>>>>> IPMI Channel commands implementation -+ // <Get Channel Access> -+ ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_CHANNEL_ACCESS, NULL, -+ ipmi_get_channel_access, PRIVILEGE_USER); -+ -+ // <Get Channel Info Command> -+ ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_CHAN_INFO, NULL, -+ ipmi_app_channel_info, PRIVILEGE_USER); -+#endif -+ -+ int ret = loadI2CWhiteList(); -+ log<level::DEBUG>("i2c white list is loaded", entry("RET=%d", ret), -+ entry("SIZE=%d", getWhiteList().size())); -+ if (ret == 0) -+ { -+ log<level::DEBUG>("Register Master RW command"); -+ // <Master Write Read Command> -+ ipmi_register_callback(NETFUN_APP, IPMI_CMD_MASTER_WRITE_READ, NULL, -+ ipmiMasterWriteRead, PRIVILEGE_OPERATOR); -+ } -+ - // <Get System GUID Command> - ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_SYS_GUID, NULL, - ipmi_app_get_sys_guid, PRIVILEGE_USER); -diff --git a/apphandler.hpp b/apphandler.hpp -index d4dd8e8..f9e5c59 100644 ---- a/apphandler.hpp -+++ b/apphandler.hpp -@@ -19,6 +19,7 @@ enum ipmi_netfn_app_cmds - IPMI_CMD_SET_CHAN_ACCESS = 0x40, - IPMI_CMD_GET_CHANNEL_ACCESS = 0x41, - IPMI_CMD_GET_CHAN_INFO = 0x42, -+ IPMI_CMD_MASTER_WRITE_READ = 0x52, - IPMI_CMD_GET_CHAN_CIPHER_SUITES = 0x54, - IPMI_CMD_SET_SYSTEM_INFO = 0x58, - IPMI_CMD_GET_SYSTEM_INFO = 0x59, -diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf -index 49ff7b0..1ae79fd 100644 ---- a/host-ipmid-whitelist.conf -+++ b/host-ipmid-whitelist.conf -@@ -27,6 +27,7 @@ - 0x06:0x37 //<App>:<Get System GUID> - 0x06:0x42 //<App>:<Get Channel Info Command> - 0x06:0x4E //<App>:<Get Channel Payload Support> -+0x06:0x52 //<App>:<Master Write Read Command> - 0x06:0x54 //<App>:<Get Channel Cipher Suites> - 0x0A:0x10 //<Storage>:<Get FRU Inventory Area Info> - 0x0A:0x11 //<Storage>:<Read FRU Data> --- -2.17.1 - 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 index 170e530f9..fd7cf1851 100644 --- 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 @@ -29,12 +29,12 @@ index 4b42b3c..1a5b805 100644 static constexpr uint8_t chassisCapAddrMask = 0xfe; +static constexpr uint8_t disableResetButton = 0x2; +static constexpr uint8_t disablePowerButton = 0x1; - - typedef struct - { + static constexpr const char* powerButtonIntf = + "xyz.openbmc_project.Chassis.Buttons.Power"; + static constexpr const char* powerButtonPath = @@ -140,6 +142,19 @@ struct GetPOHCountResponse - uint8_t counterReading[4]; ///< Counter reading - } __attribute__((packed)); + uint8_t front_panel_button_cap_status; + } __attribute__((packed)) ipmi_get_chassis_status_t; +typedef struct +{ @@ -52,17 +52,8 @@ index 4b42b3c..1a5b805 100644 // 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; + return ipmi::responseSuccess(power_policy::allSupport); } +ipmi_ret_t ipmiSetFrontPanelButtonEnables(ipmi_netfn_t netfn, ipmi_cmd_t cmd, @@ -161,7 +152,7 @@ index 49b5ef8..f4a6bff 100644 --- a/chassishandler.hpp +++ b/chassishandler.hpp @@ -19,6 +19,7 @@ enum ipmi_netfn_chassis_cmds - // Get capability bits + IPMI_CMD_GET_SYS_RESTART_CAUSE = 0x07, IPMI_CMD_SET_SYS_BOOT_OPTIONS = 0x08, IPMI_CMD_GET_SYS_BOOT_OPTIONS = 0x09, + IPMI_CMD_SET_FRONT_PANEL_BUTTON_ENABLES = 0x0A, @@ -173,13 +164,13 @@ index e5cd0b5..d96d9ed 100644 --- a/host-ipmid-whitelist.conf +++ b/host-ipmid-whitelist.conf @@ -6,6 +6,7 @@ - 0x00:0x06 //<Chassis>:<Set Power Restore Policy> + 0x00:0x07 //<Chassis>:<Get System Restart Cause> 0x00:0x08 //<Chassis>:<Set System Boot Options> 0x00:0x09 //<Chassis>:<Get System Boot Options> +0x00:0x0A //<Chassis>:<Set Front Panel Button Enables> 0x00:0x0F //<Chassis>:<Get POH Counter Command> + 0x04:0x02 //<Sensor/Event>:<Platform event> 0x04:0x2D //<Sensor/Event>:<Get Sensor Reading> - 0x04:0x2F //<Sensor/Event>:<Get Sensor Type> -- 2.19.1 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0057-Add-timer-use-actions-support.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0057-Add-timer-use-actions-support.patch index 5813cceae..a96707d44 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0057-Add-timer-use-actions-support.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0057-Add-timer-use-actions-support.patch @@ -144,14 +144,14 @@ index e65ea63..8b1aa47 100644 +++ b/app/watchdog_service.cpp @@ -83,6 +83,9 @@ WatchdogService::Properties WatchdogService::getProperties() wd_prop.timerUse = Watchdog::convertTimerUseFromString( - get<std::string>(properties.at("CurrentTimerUse"))); + std::get<std::string>(properties.at("CurrentTimerUse"))); + wd_prop.expiredTimerUse = Watchdog::convertTimerUseFromString( -+ get<std::string>(properties.at("ExpiredTimerUse"))); ++ std::get<std::string>(properties.at("ExpiredTimerUse"))); + - wd_prop.interval = get<uint64_t>(properties.at("Interval")); - wd_prop.timeRemaining = get<uint64_t>(properties.at("TimeRemaining")); - return wd_prop; + wd_prop.interval = std::get<uint64_t>(properties.at("Interval")); + wd_prop.timeRemaining = + std::get<uint64_t>(properties.at("TimeRemaining")); @@ -187,6 +190,11 @@ void WatchdogService::setTimerUse(TimerUse timerUse) setProperty("CurrentTimerUse", convertForMessage(timerUse)); } diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0060-Move-Get-SOL-config-parameter-to-host-ipmid.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0060-Move-Get-SOL-config-parameter-to-host-ipmid.patch index 49a2c01ba..24f355d80 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0060-Move-Get-SOL-config-parameter-to-host-ipmid.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0060-Move-Get-SOL-config-parameter-to-host-ipmid.patch @@ -1,43 +1,93 @@ -From 973865687325c6563fd6b729a3a220661066f635 Mon Sep 17 00:00:00 2001 +From 3c95de833eba73b3585941ade42ad1775e723280 Mon Sep 17 00:00:00 2001 From: Cheng C Yang <cheng.c.yang@intel.com> -Date: Wed, 3 Apr 2019 15:55:04 +0800 +Date: Tue, 7 May 2019 08:03:56 +0800 Subject: [PATCH] Move Get SOL config parameter to host-ipmid Move Get SOL config parameter command from net-ipmid to host-ipmid. -Tested By: +Tested: Run command ipmitool sol info Set in progress : set-complete Enabled : true Force Encryption : false Force Authentication : false -Privilege Level : USER -Character Accumulate Level (ms) : 100 -Character Send Threshold : 1 -Retry Count : 3 -Retry Interval (ms) : 100 +Privilege Level : ADMINISTRATOR +Character Accumulate Level (ms) : 60 +Character Send Threshold : 96 +Retry Count : 6 +Retry Interval (ms) : 200 Volatile Bit Rate (kbps) : IPMI-Over-Serial-Setting -Non-Volatile Bit Rate (kbps) : IPMI-Over-Serial-Setting +Non-Volatile Bit Rate (kbps) : 115.2 Payload Channel : 14 (0x0e) Payload Port : 623 Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com> --- - transporthandler.cpp | 139 ++++++++++++++++++++++++++++++++++++++++++++++++--- - transporthandler.hpp | 26 +++++++++- - 2 files changed, 156 insertions(+), 9 deletions(-) + host-ipmid-whitelist.conf | 1 + + transporthandler.cpp | 198 ++++++++++++++++++++++++++++++++++++++++++++-- + transporthandler.hpp | 27 ++++++- + 3 files changed, 217 insertions(+), 9 deletions(-) +diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf +index 2ce44c6..383b412 100644 +--- a/host-ipmid-whitelist.conf ++++ b/host-ipmid-whitelist.conf +@@ -43,6 +43,7 @@ + 0x0A:0x49 //<Storage>:<Set SEL Time> + 0x0C:0x02 //<Transport>:<Get LAN Configuration Parameters> + 0x0C:0x21 //<Transport>:<Set SOL Configuration Parameters> ++0x0C:0x22 //<Transport>:<Get SOL Configuration Parameters> + 0x2C:0x00 //<Group Extension>:<Group Extension Command> + 0x2C:0x01 //<Group Extension>:<Get DCMI Capabilities> + 0x2C:0x02 //<Group Extension>:<Get Power Reading> diff --git a/transporthandler.cpp b/transporthandler.cpp -index 2111acf..b18f522 100644 +index 850172d..0c1223a 100644 --- a/transporthandler.cpp +++ b/transporthandler.cpp -@@ -1715,11 +1715,133 @@ void initializeSOLInProgress() +@@ -38,6 +38,8 @@ static const std::array<std::string, 3> ipAddressEnablesType = { + + constexpr const char* solInterface = "xyz.openbmc_project.Ipmi.SOL"; + constexpr const char* solPath = "/xyz/openbmc_project/ipmi/sol"; ++constexpr const char* consoleInterface = "xyz.openbmc_project.console"; ++constexpr const char* consolePath = "/xyz/openbmc_project/console"; + + std::map<int, std::unique_ptr<struct ChannelConfig_t>> channelConfig; + +@@ -1668,6 +1670,26 @@ static int setSOLParameter(std::string property, const ipmi::Value& value) + return 0; + } + ++static int getSOLBaudRate(ipmi::Value& value) ++{ ++ auto dbus = getSdBus(); ++ ++ try ++ { ++ value = ++ ipmi::getDbusProperty(*dbus, "xyz.openbmc_project.console", ++ consolePath, consoleInterface, "baudrate"); ++ } ++ catch (sdbusplus::exception_t&) ++ { ++ phosphor::logging::log<phosphor::logging::level::ERR>( ++ "Error getting sol baud rate"); ++ return -1; ++ } ++ ++ return 0; ++} ++ + static int getSOLParameter(std::string property, ipmi::Value& value) + { + auto dbus = getSdBus(); +@@ -1711,11 +1733,170 @@ void initializeSOLInProgress() } } -ipmi_ret_t setConfParams(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - ipmi_request_t request, ipmi_response_t response, - ipmi_data_len_t dataLen, ipmi_context_t context) ++static const constexpr uint8_t retryCountMask = 0x07; +// For getsetSOLConfParams, there are still three tings TODO: +// 1. session less channel number request has to return error. +// 2. convert 0xE channel number. @@ -45,8 +95,7 @@ index 2111acf..b18f522 100644 +ipmi_ret_t getSOLConfParams(ipmi_netfn_t netfn, ipmi_cmd_t cmd, + ipmi_request_t request, ipmi_response_t response, + ipmi_data_len_t dataLen, ipmi_context_t context) - { -- auto reqData = reinterpret_cast<const SetConfParamsRequest*>(request); ++{ + auto reqData = reinterpret_cast<const GetSOLConfParamsRequest*>(request); + std::vector<uint8_t> outPayload; + @@ -134,7 +183,7 @@ index 2111acf..b18f522 100644 + { + return IPMI_CC_UNSPECIFIED_ERROR; + } -+ outPayload.push_back(std::get<uint8_t>(value) & 0x03); ++ outPayload.push_back(std::get<uint8_t>(value) & retryCountMask); + + if (getSOLParameter("RetryIntervalMS", value) < 0) + { @@ -151,6 +200,42 @@ index 2111acf..b18f522 100644 + std::back_inserter(outPayload)); + break; + } ++ case sol::Parameter::nvbitrate: ++ { ++ if (getSOLBaudRate(value) < 0) ++ { ++ return IPMI_CC_UNSPECIFIED_ERROR; ++ } ++ uint8_t bitRate = 0; ++ uint32_t* pBaudRate = std::get_if<uint32_t>(&value); ++ if (!pBaudRate) ++ { ++ phosphor::logging::log<phosphor::logging::level::ERR>( ++ "Failed to get valid baud rate from D-Bus interface"); ++ } ++ switch (*pBaudRate) ++ { ++ case 9600: ++ bitRate = 0x06; ++ break; ++ case 19200: ++ bitRate = 0x07; ++ break; ++ case 38400: ++ bitRate = 0x08; ++ break; ++ case 57600: ++ bitRate = 0x09; ++ break; ++ case 115200: ++ bitRate = 0x0a; ++ break; ++ default: ++ break; ++ } ++ outPayload.push_back(bitRate); ++ break; ++ } + default: + return IPMI_CC_PARM_NOT_SUPPORTED; + } @@ -164,12 +249,13 @@ index 2111acf..b18f522 100644 +ipmi_ret_t setSOLConfParams(ipmi_netfn_t netfn, ipmi_cmd_t cmd, + ipmi_request_t request, ipmi_response_t response, + ipmi_data_len_t dataLen, ipmi_context_t context) -+{ + { +- auto reqData = reinterpret_cast<const SetConfParamsRequest*>(request); + auto reqData = reinterpret_cast<const SetSOLConfParamsRequest*>(request); // Check request length first switch (static_cast<sol::Parameter>(reqData->paramSelector)) -@@ -1728,7 +1850,7 @@ ipmi_ret_t setConfParams(ipmi_netfn_t netfn, ipmi_cmd_t cmd, +@@ -1724,7 +1905,7 @@ ipmi_ret_t setConfParams(ipmi_netfn_t netfn, ipmi_cmd_t cmd, case sol::Parameter::enable: case sol::Parameter::authentication: { @@ -178,7 +264,7 @@ index 2111acf..b18f522 100644 { *dataLen = 0; return IPMI_CC_REQ_DATA_LEN_INVALID; -@@ -1738,7 +1860,7 @@ ipmi_ret_t setConfParams(ipmi_netfn_t netfn, ipmi_cmd_t cmd, +@@ -1734,7 +1915,7 @@ ipmi_ret_t setConfParams(ipmi_netfn_t netfn, ipmi_cmd_t cmd, case sol::Parameter::accumulate: case sol::Parameter::retry: { @@ -187,7 +273,7 @@ index 2111acf..b18f522 100644 { *dataLen = 0; return IPMI_CC_REQ_DATA_LEN_INVALID; -@@ -1869,7 +1991,10 @@ void register_netfn_transport_functions() +@@ -1865,7 +2046,10 @@ void register_netfn_transport_functions() ipmi_transport_get_lan, PRIVILEGE_OPERATOR); ipmi_register_callback(NETFUN_TRANSPORT, IPMI_CMD_SET_SOL_CONF_PARAMS, NULL, @@ -200,10 +286,18 @@ index 2111acf..b18f522 100644 // Initialize dbus property progress to 0 every time sol manager restart. initializeSOLInProgress(); diff --git a/transporthandler.hpp b/transporthandler.hpp -index 3b5e9e1..7132cff 100644 +index 3b5e9e1..a21862b 100644 --- a/transporthandler.hpp +++ b/transporthandler.hpp -@@ -257,7 +257,7 @@ struct Retry +@@ -1,6 +1,7 @@ + #pragma once + + #include <ipmid/types.hpp> ++#include <map> + #include <string> + // IPMI commands for Transport net functions. + enum ipmi_netfn_storage_cmds +@@ -257,7 +258,7 @@ struct Retry uint8_t interval; //!< SOL retry interval. } __attribute__((packed)); @@ -212,7 +306,7 @@ index 3b5e9e1..7132cff 100644 { #if BYTE_ORDER == LITTLE_ENDIAN uint8_t channelNumber : 4; //!< Channel number. -@@ -279,7 +279,29 @@ struct SetConfParamsRequest +@@ -279,7 +280,29 @@ struct SetConfParamsRequest }; } __attribute__((packed)); @@ -244,5 +338,5 @@ index 3b5e9e1..7132cff 100644 +static constexpr uint16_t ipmiStdPort = 623; +static constexpr uint8_t solParameterRevision = 0x11; -- -2.16.2 +2.7.4 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 f454f7ce9..91319a9d3 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 @@ -3,27 +3,37 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" # TODO: This should be removed, once up-stream bump up # issue is resolved #SRC_URI = "git://github.com/openbmc/phosphor-host-ipmid" -SRCREV = "11df4f6906edc0dfb23089a6e297158549c19ebd" +SRCREV = "fdb8389df74f9f0d6428252a75c33f6abf6d8481" SRC_URI += "file://phosphor-ipmi-host.service \ - file://0002-Modify-dbus-interface-for-power-control.patch \ - file://0003-Modify-dbus-interface-for-chassis-control.patch \ file://0009-IPv6-Network-changes.patch \ file://0010-fix-get-system-GUID-ipmi-command.patch \ file://0012-ipmi-set-get-boot-options.patch \ file://0013-ipmi-add-set-bios-id-to-whitelist.patch \ - file://0014-Enable-get-device-guid-ipmi-command.patch \ file://0021-Implement-IPMI-Commmand-Get-Host-Restart-Cause.patch \ file://0039-ipmi-add-oem-command-get-AIC-FRU-to-whitelist.patch \ - file://0048-Implement-IPMI-Master-Write-Read-command.patch \ file://0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch \ file://0050-enable-6-oem-commands.patch \ file://0053-Fix-keep-looping-issue-when-entering-OS.patch \ file://0055-Implement-set-front-panel-button-enables-command.patch \ file://0056-add-SetInProgress-to-get-set-boot-option-cmd.patch \ file://0057-Add-timer-use-actions-support.patch \ - file://0058-Add-AC-failed-bit-support-for-get-chassis-status-com.patch \ file://0059-Move-Set-SOL-config-parameter-to-host-ipmid.patch \ file://0060-Move-Get-SOL-config-parameter-to-host-ipmid.patch \ " +# remove the softpoweroff service since we do not need it +SYSTEMD_SERVICE_${PN}_remove += " \ + xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service" + +SYSTEMD_LINK_${PN}_remove += " \ + ../xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service:obmc-host-shutdown@0.target.requires/xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service \ + " +FILES_${PN}_remove = " \ + ${systemd_unitdir}/system/obmc-host-shutdown@0.target.requires/ \ + ${systemd_unitdir}/system/obmc-host-shutdown@0.target.requires/xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service \ + " + +do_install_append(){ + rm -f ${D}/${bindir}/phosphor-softpoweroff +} diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend index 694bd1fcf..13d908ad1 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend @@ -1,2 +1,2 @@ SRC_URI = "git://github.com/openbmc/ipmbbridge.git" -SRCREV = "08deaa317c7ac0dd6e4202529ff17962c63df485" +SRCREV = "8188d7651c23502f88f9bf850ab7e549f6463997" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-kcs/org.openbmc.HostIpmi.SMM.service b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-kcs/org.openbmc.HostIpmi.SMM.service deleted file mode 100644 index 288fa422d..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-kcs/org.openbmc.HostIpmi.SMM.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Phosphor IPMI KCS DBus Bridge(SMM) -After=phosphor-ipmi-host.service - -[Service] -Restart=always -ExecStart={sbindir}/kcsbridged --d="/dev/ipmi-kcs4" --i="SMM" -SyslogIdentifier=kcsbridged_SMM -Type=dbus -BusName={BUSNAME} - -[Install] -WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-kcs/org.openbmc.HostIpmi.service b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-kcs/org.openbmc.HostIpmi.service deleted file mode 100644 index 177062e27..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-kcs/org.openbmc.HostIpmi.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Phosphor IPMI KCS DBus Bridge(SMS) -After=phosphor-ipmi-host.service - -[Service] -Restart=always -ExecStart={sbindir}/kcsbridged --d="/dev/ipmi-kcs3" -SyslogIdentifier=kcsbridged -Type=dbus -BusName={BUSNAME} - -[Install] -WantedBy={SYSTEMD_DEFAULT_TARGET} 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 ac7a03108..e3d397f06 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 @@ -1,9 +1,12 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -DBUS_SERVICE_${PN} += "org.openbmc.HostIpmi.SMM.service" +#SYSTEMD_SUBSTITUTIONS_remove = "KCS_DEVICE:${KCS_DEVICE}:${DBUS_SERVICE_${PN}}" -SYSTEMD_SUBSTITUTIONS_remove = "KCS_DEVICE:${KCS_DEVICE}:${DBUS_SERVICE_${PN}}" +# Default kcs device is ipmi-kcs3; this is SMS. +# Add SMM kcs device instance +SMM_DEVICE = "ipmi-kcs4" +SYSTEMD_SERVICE_${PN}_append = " ${PN}@${SMM_DEVICE}.service " SRC_URI = "git://github.com/openbmc/kcsbridge.git" -SRCREV = "17a2ab7f39a78ff0603aa68cf35108ea94eb442f" +SRCREV = "2cdc49585235a6557c9cbb6c8b75c064fc02681a" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0008-Sync-GetSession-Info-cmd-based-on-Upstream-review.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0008-Sync-GetSession-Info-cmd-based-on-Upstream-review.patch index 6212c0724..c6b87bf4f 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0008-Sync-GetSession-Info-cmd-based-on-Upstream-review.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0008-Sync-GetSession-Info-cmd-based-on-Upstream-review.patch @@ -256,54 +256,24 @@ diff --git a/socket_channel.hpp b/socket_channel.hpp index 349701e..8b64740 100644 --- a/socket_channel.hpp +++ b/socket_channel.hpp -@@ -52,33 +52,34 @@ class Channel - } - - /** -- * @brief Fetch the port number of the remote peer -- * -- * Returns the port number of the remote peer -+ * @brief Fetch the IP address of the remote peer - * -- * @return Port number -+ * Returns the IP address of the remote peer which is connected to this -+ * socket +@@ -107,14 +107,15 @@ class Channel * -+ * @return IP address of the remote peer - */ -- auto getPort() const -+ std::uint32_t getRemoteAddressInBytes() const - { -- return endpoint.port(); -+ const boost::asio::ip::address& addr = endpoint.address(); -+ if (addr.is_v4()) -+ { -+ return addr.to_v4().to_uint(); -+ } -+ return 0; - } - - /** -- * @brief Return the binary representation of the remote IPv4 address -+ * @brief Fetch the port number of the remote peer - * -- * getSessionInfo needs to return the remote IPv4 addresses of each session -+ * Returns the port number of the remote peer -+ * -+ * @return Port number - * -- * @return A uint32_t representation of the remote IPv4 address + * @return A uint32_t representation of the remote IPv4 address */ - std::uint32_t getRemoteAddressInbytes() -+ auto getPort() const ++ uint32_t getRemoteAddressInBytes() const { - const boost::asio::ip::address& addr = endpoint.address(); - if (addr.is_v4()) -- { ++ uint32_t v4addr = 0; ++ if (sockAddrSize == sizeof(sockaddr_in)) + { - return addr.to_v4().to_uint(); -- } ++ auto saddr = reinterpret_cast<const sockaddr_in*>(&remoteSockAddr); ++ v4addr = ntohl(saddr->sin_addr.s_addr); + } - return 0; -+ return endpoint.port(); ++ return v4addr; } /** diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0011-Remove-Get-SOL-Config-Command-from-Netipmid.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0011-Remove-Get-SOL-Config-Command-from-Netipmid.patch new file mode 100644 index 000000000..da173704b --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0011-Remove-Get-SOL-Config-Command-from-Netipmid.patch @@ -0,0 +1,336 @@ +From a36f181163974b2da0a954fc97a89fb2cdbd7287 Mon Sep 17 00:00:00 2001 +From: Cheng C Yang <cheng.c.yang@intel.com> +Date: Tue, 30 Apr 2019 05:35:31 +0800 +Subject: [PATCH] Remove Get SOL Config Command from Netipmid + +Since Get SOL Config Parameter command already exists in host-ipmid, and +can be shared to net channel, remove this command from net-ipmid. + +Tested: +Run ipmitool -I lanplus -H xxx -U root -P 0penBmc sol info, the command +returns the same result as ipmitool sol info as below. +Info: SOL parameter 'Nonvolatile Bitrate (5)' not supported +Info: SOL parameter 'Volatile Bitrate (6)' not supported +Info: SOL parameter 'Payload Channel (7)' not supported - defaulting to 0x0e +Set in progress : set-complete +Enabled : true +Force Encryption : true +Force Authentication : true +Privilege Level : USER +Character Accumulate Level (ms) : 100 +Character Send Threshold : 1 +Retry Count : 3 +Retry Interval (ms) : 100 +Volatile Bit Rate (kbps) : IPMI-Over-Serial-Setting +Non-Volatile Bit Rate (kbps) : IPMI-Over-Serial-Setting +Payload Channel : 14 (0x0e) +Payload Port : 623 + +Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com> +--- + command/sol_cmds.cpp | 91 ---------------------------- + command/sol_cmds.hpp | 168 --------------------------------------------------- + sol_module.cpp | 6 -- + 3 files changed, 265 deletions(-) + +diff --git a/command/sol_cmds.cpp b/command/sol_cmds.cpp +index 804b5ea..8b2d041 100644 +--- a/command/sol_cmds.cpp ++++ b/command/sol_cmds.cpp +@@ -65,97 +65,6 @@ void activating(uint8_t payloadInstance, uint32_t sessionID) + outPayload); + } + +-std::vector<uint8_t> getConfParams(const std::vector<uint8_t>& inPayload, +- const message::Handler& handler) +-{ +- std::vector<uint8_t> outPayload(sizeof(GetConfParamsResponse)); +- auto request = +- reinterpret_cast<const GetConfParamsRequest*>(inPayload.data()); +- auto response = reinterpret_cast<GetConfParamsResponse*>(outPayload.data()); +- response->completionCode = IPMI_CC_OK; +- response->paramRev = parameterRevision; +- +- if (request->getParamRev) +- { +- return outPayload; +- } +- +- switch (static_cast<Parameter>(request->paramSelector)) +- { +- case Parameter::PROGRESS: +- { +- outPayload.push_back( +- std::get<sol::Manager&>(singletonPool).progress); +- break; +- } +- case Parameter::ENABLE: +- { +- outPayload.push_back(std::get<sol::Manager&>(singletonPool).enable); +- break; +- } +- case Parameter::AUTHENTICATION: +- { +- Auth value{0}; +- +- value.encrypt = std::get<sol::Manager&>(singletonPool).forceEncrypt; +- value.auth = std::get<sol::Manager&>(singletonPool).forceAuth; +- value.privilege = static_cast<uint8_t>( +- std::get<sol::Manager&>(singletonPool).solMinPrivilege); +- auto buffer = reinterpret_cast<const uint8_t*>(&value); +- +- std::copy_n(buffer, sizeof(value), std::back_inserter(outPayload)); +- break; +- } +- case Parameter::ACCUMULATE: +- { +- Accumulate value{0}; +- +- value.interval = std::get<sol::Manager&>(singletonPool) +- .accumulateInterval.count() / +- sol::accIntervalFactor; +- value.threshold = +- std::get<sol::Manager&>(singletonPool).sendThreshold; +- auto buffer = reinterpret_cast<const uint8_t*>(&value); +- +- std::copy_n(buffer, sizeof(value), std::back_inserter(outPayload)); +- break; +- } +- case Parameter::RETRY: +- { +- Retry value{0}; +- +- value.count = std::get<sol::Manager&>(singletonPool).retryCount; +- value.interval = +- std::get<sol::Manager&>(singletonPool).retryInterval.count() / +- sol::retryIntervalFactor; +- auto buffer = reinterpret_cast<const uint8_t*>(&value); +- +- std::copy_n(buffer, sizeof(value), std::back_inserter(outPayload)); +- break; +- } +- case Parameter::PORT: +- { +- auto port = endian::to_ipmi<uint16_t>(IPMI_STD_PORT); +- auto buffer = reinterpret_cast<const uint8_t*>(&port); +- +- std::copy_n(buffer, sizeof(port), std::back_inserter(outPayload)); +- break; +- } +- case Parameter::CHANNEL: +- { +- outPayload.push_back( +- std::get<sol::Manager&>(singletonPool).channel); +- break; +- } +- case Parameter::NVBITRATE: +- case Parameter::VBITRATE: +- default: +- response->completionCode = ipmiCCParamNotSupported; +- } +- +- return outPayload; +-} +- + } // namespace command + + } // namespace sol +diff --git a/command/sol_cmds.hpp b/command/sol_cmds.hpp +index 182b73e..10cbf25 100644 +--- a/command/sol_cmds.hpp ++++ b/command/sol_cmds.hpp +@@ -62,174 +62,6 @@ struct ActivatingRequest + */ + void activating(uint8_t payloadInstance, uint32_t sessionID); + +-/** @enum Parameter +- * +- * SOL parameters are volatile, they are initialized by the SOL manager. +- * They can be read using Get SOL configuration parameters command and updated +- * using Set SOL configuration parameters command. +- */ +-enum class Parameter +-{ +- PROGRESS, //!< Set In Progress. +- ENABLE, //!< SOL Enable. +- AUTHENTICATION, //!< SOL Authentication. +- ACCUMULATE, //!< Character Accumulate Interval & Send Threshold. +- RETRY, //!< SOL Retry. +- NVBITRATE, //!< SOL non-volatile bit rate. +- VBITRATE, //!< SOL volatile bit rate. +- CHANNEL, //!< SOL payload channel. +- PORT, //!< SOL payload port. +-}; +- +-constexpr uint8_t progressMask = 0x03; +-constexpr uint8_t enableMask = 0x01; +- +-/** @struct Auth +- * +- * SOL authentication parameter. +- */ +-struct Auth +-{ +-#if BYTE_ORDER == LITTLE_ENDIAN +- uint8_t privilege : 4; //!< SOL privilege level. +- uint8_t reserved : 2; //!< Reserved. +- uint8_t auth : 1; //!< Force SOL payload Authentication. +- uint8_t encrypt : 1; //!< Force SOL payload encryption. +-#endif +- +-#if BYTE_ORDER == BIG_ENDIAN +- uint8_t encrypt : 1; //!< Force SOL payload encryption. +- uint8_t auth : 1; //!< Force SOL payload Authentication. +- uint8_t reserved : 2; //!< Reserved. +- uint8_t privilege : 4; //!< SOL privilege level. +-#endif +-} __attribute__((packed)); +- +-/** @struct Accumulate +- * +- * Character accumulate interval & Character send threshold. +- */ +-struct Accumulate +-{ +- uint8_t interval; //!< Character accumulate interval. +- uint8_t threshold; //!< Character send threshold. +-} __attribute__((packed)); +- +-constexpr uint8_t retryCountMask = 0x07; +- +-/** @struct Retry +- * +- * SOL retry count and interval. +- */ +-struct Retry +-{ +-#if BYTE_ORDER == LITTLE_ENDIAN +- uint8_t count : 3; //!< SOL retry count. +- uint8_t reserved : 5; //!< Reserved. +-#endif +- +-#if BYTE_ORDER == BIG_ENDIAN +- uint8_t reserved : 5; //!< Reserved. +- uint8_t count : 3; //!< SOL retry count. +-#endif +- +- uint8_t interval; //!< SOL retry interval. +-} __attribute__((packed)); +- +-constexpr uint8_t ipmiCCParamNotSupported = 0x80; +-constexpr uint8_t ipmiCCInvalidSetInProgress = 0x81; +-constexpr uint8_t ipmiCCWriteReadParameter = 0x82; +-constexpr uint8_t ipmiCCReadWriteParameter = 0x83; +-constexpr uint8_t parameterRevision = 0x11; +- +-/** @struct SetConfParamsRequest +- * +- * IPMI payload for Set SOL configuration parameters command request. +- */ +-struct SetConfParamsRequest +-{ +-#if BYTE_ORDER == LITTLE_ENDIAN +- uint8_t channelNumber : 4; //!< Channel number. +- uint8_t reserved : 4; //!< Reserved. +-#endif +- +-#if BYTE_ORDER == BIG_ENDIAN +- uint8_t reserved : 4; //!< Reserved. +- uint8_t channelNumber : 4; //!< Channel number. +-#endif +- +- uint8_t paramSelector; //!< Parameter selector. +- union +- { +- uint8_t value; //!< Represents one byte SOL parameters. +- struct Accumulate acc; //!< Character accumulate values. +- struct Retry retry; //!< Retry values. +- struct Auth auth; //!< Authentication parameters. +- }; +-} __attribute__((packed)); +- +-/** @struct SetConfParamsResponse +- * +- * IPMI payload for Set SOL configuration parameters command response. +- */ +-struct SetConfParamsResponse +-{ +- uint8_t completionCode; //!< Completion code. +-} __attribute__((packed)); +- +-/** @brief Set SOL configuration parameters command. +- * +- * @param[in] inPayload - Request data for the command. +- * @param[in] handler - Reference to the message handler. +- * +- * @return Response data for the command. +- */ +-std::vector<uint8_t> setConfParams(const std::vector<uint8_t>& inPayload, +- const message::Handler& handler); +- +-/** @struct GetConfParamsRequest +- * +- * IPMI payload for Get SOL configuration parameters command request. +- */ +-struct GetConfParamsRequest +-{ +-#if BYTE_ORDER == LITTLE_ENDIAN +- uint8_t channelNum : 4; //!< Channel number. +- uint8_t reserved : 3; //!< Reserved. +- uint8_t getParamRev : 1; //!< Get parameter or Get parameter revision +-#endif +- +-#if BYTE_ORDER == BIG_ENDIAN +- uint8_t getParamRev : 1; //!< Get parameter or Get parameter revision +- uint8_t reserved : 3; //!< Reserved. +- uint8_t channelNum : 4; //!< Channel number. +-#endif +- +- uint8_t paramSelector; //!< Parameter selector. +- uint8_t setSelector; //!< Set selector. +- uint8_t blockSelector; //!< Block selector. +-} __attribute__((packed)); +- +-/** @struct GetConfParamsResponse +- * +- * IPMI payload for Get SOL configuration parameters command response. +- */ +-struct GetConfParamsResponse +-{ +- uint8_t completionCode; //!< Completion code. +- uint8_t paramRev; //!< Parameter revision. +-} __attribute__((packed)); +- +-/** @brief Get SOL configuration parameters command. +- * +- * @param[in] inPayload - Request data for the command. +- * @param[in] handler - Reference to the message handler. +- * +- * @return Response data for the command. +- */ +-std::vector<uint8_t> getConfParams(const std::vector<uint8_t>& inPayload, +- const message::Handler& handler); +- + } // namespace command + + } // namespace sol +diff --git a/sol_module.cpp b/sol_module.cpp +index 2b1fb46..6da82c0 100644 +--- a/sol_module.cpp ++++ b/sol_module.cpp +@@ -42,12 +42,6 @@ void registerCommands() + &getPayloadInfo, + session::Privilege::USER, + false}, +- // Get SOL Configuration Parameters +- {{(static_cast<uint32_t>(message::PayloadType::IPMI) << 16) | +- static_cast<uint16_t>(::command::NetFns::TRANSPORT) | 0x22}, +- &getConfParams, +- session::Privilege::USER, +- false}, + }; + + for (const auto& iter : commands) +-- +2.7.4 + 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 9dc21a3dd..9f5e3fa6f 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,12 +3,20 @@ 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 = "8af90ebcc552e243ae85aa9e9da1a00fbecab56c" +#SRCREV = "052b7cf37411a1bb69af1e6ce541a16021fffa9f" USERADD_PACKAGES = "${PN}" # add a group called ipmi GROUPADD_PARAM_${PN} = "ipmi " +# Default rmcpp iface is eth0; channel 1 +# Add channel 2 instance (eth1) +RMCPP_EXTRA = "eth1" +SYSTEMD_SERVICE_${PN} += " \ + ${PN}@${RMCPP_EXTRA}.service \ + ${PN}@${RMCPP_EXTRA}.socket \ + " + FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += " file://0006-Modify-dbus-namespace-of-chassis-control-for-guid.patch \ @@ -16,5 +24,6 @@ SRC_URI += " file://0006-Modify-dbus-namespace-of-chassis-control-for-guid.patch file://0008-Sync-GetSession-Info-cmd-based-on-Upstream-review.patch \ file://0009-Add-dbus-interface-for-sol-commands.patch \ file://00010-Change-Authentication-Parameter.patch \ + file://0011-Remove-Get-SOL-Config-Command-from-Netipmid.patch \ " 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 af83facf6..4861755b6 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,7 +2,7 @@ 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;protocol=ssh" +SRC_URI = "git://github.com/Intel-BMC/node-manager;protocol=ssh" SRCREV = "2ab90332828614c95e0ce22c0c95285734b55b65" PV = "0.1+git${SRCPV}" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/multi-node-manager/multi-node-manager.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/multi-node-manager/multi-node-manager.bb index 31b9e9338..e7cd1ab42 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/multi-node-manager/multi-node-manager.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/multi-node-manager/multi-node-manager.bb @@ -1,7 +1,7 @@ SUMMARY = "Multi node manager" DESCRIPTION = "Daemon to handle chassis level shared resources on multi-node platform" -SRC_URI = "git://git@github.com/Intel-BMC/multi-node-manager.git;protocol=ssh" +SRC_URI = "git://github.com/Intel-BMC/multi-node-manager.git;protocol=ssh" SRCREV = "8a34c017e04dd8f327aff127f64855f6132bd318" PV = "0.1+git${SRCPV}" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend deleted file mode 100644 index f1be7d358..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend +++ /dev/null @@ -1,4 +0,0 @@ -${PN}-software-extras_remove = " \ - obmc-flash-bmc \ - obmc-mgr-download \ -" 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 c5b2eb040..c7f78b1e3 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 @@ -53,9 +53,11 @@ NV_MTD_NUM="$(mtdnum_by_name ${NV_MTD})" nvrw() { local p="$1" + # Clear the work dir doing overlay mount + rm -rf "${RWFS_MNT}${p}.work" mkdir -p "${RWFS_MNT}${p}" "${RWFS_MNT}${p}.work" local mname=$(echo "rwnv${p}" | sed 's,/,,g') - local opts="lowerdir=${p},upperdir=${RWFS_MNT}${p},workdir=${RWFS_MNT}${p}.work" + local opts="lowerdir=${p},upperdir=${RWFS_MNT}${p},workdir=${RWFS_MNT}${p}.work,sync" mount -t overlay -o "$opts" "$mname" "$p" } @@ -142,8 +144,29 @@ fi # work around bug where /etc/machine-id will be mounted with a temporary file # if rootfs is read-only and the file is empty MACHINE_ID=/etc/machine-id -if [ ! -s "$MACHINE_ID" ]; then +generate_machine_id() { systemd-machine-id-setup + cp -pf "$MACHINE_ID" "${MACHINE_ID}_bkup" +} + +if [ ! -s "$MACHINE_ID" ]; then + # work around - Bug: Overlay fs fails for machine-id due to + # origin mismatch. Clean it up, from overlay fs before re-creating + # the same. + if [ -e "$RWFS_MNT$MACHINE_ID" ]; then + umount "/etc" + rm -f "$RWFS_MNT$MACHINE_ID" + nvrw "/etc" + # Restore the machine-id from backup, else generate it. + if [ -s "${MACHINE_ID}_bkup" ]; then + cp -pf "${MACHINE_ID}_bkup" "${MACHINE_ID}" + else + generate_machine_id + fi + echo "Remounted /etc for machine-id origin mismatch" + else + generate_machine_id + fi fi # mount persistent NV filesystem, where immortal settings live 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 ca38bf7fb..2cdc93e29 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,6 +1,7 @@ # Enable downstream autobump SRC_URI = "git://github.com/openbmc/phosphor-sel-logger.git" -SRCREV = "f2552a50fde35d665b5fc3ac6852f2f6bb229cae" +SRCREV = "c4a336fb15464b9f4a7328c02cb43285a6eb1e58" # Enable threshold monitoring EXTRA_OECMAKE += "-DSEL_LOGGER_MONITOR_THRESHOLD_EVENTS=ON" +EXTRA_OECMAKE += "-DREDFISH_LOG_MONITOR_PULSE_EVENTS=ON" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/selftest/intel-self-test_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/selftest/intel-self-test_git.bb index da1d74207..f655d22e4 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/selftest/intel-self-test_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/selftest/intel-self-test_git.bb @@ -1,7 +1,7 @@ SUMMARY = "BMC Self Test service" DESCRIPTION = "BMC Self Test service for subsystem diagnosis failure info" -SRC_URI = "git://git@github.com/Intel-BMC/intel-self-test;protocol=ssh" +SRC_URI = "git://github.com/Intel-BMC/intel-self-test;protocol=ssh" PV = "1.0+git${SRCPV}" SRCREV = "d039998ad2c55aeae4191af30e15bbd3032508c1" 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 fdd62e731..ba82532fc 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,4 +1,4 @@ -SRCREV = "93dc2c8e7c710fd65d269ef0bf684fb7a433a602" +SRCREV = "8dbb395364629673a1f1dde81b1cf7d8041b0662" SRC_URI = "git://github.com/openbmc/dbus-sensors.git" DEPENDS_append = " i2c-tools" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native/defaults.yaml b/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native/defaults.yaml index d2624b606..05d3df07e 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native/defaults.yaml +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native/defaults.yaml @@ -150,11 +150,11 @@ ResetErrorOccurrenceCounts: Default: 0 -/xyz/openbmc_project/control/shutdown_policy_config: - - Interface: xyz.openbmc_project.Control.ShutdownPolicy +/com/intel/control/ocotshutdown_policy_config: + - Interface: com.intel.Control.OCOTShutdownPolicy Properties: - Policy: - Default: 0 + OCOTPolicy: + Default: OCOTShutdownPolicy::Policy::NoShutdownOnOCOT /xyz/openbmc_project/control/chassis_capabilities_config: - Interface: xyz.openbmc_project.Control.ChassisCapabilities @@ -198,12 +198,12 @@ ForceAuthentication: Default: 'true' Privilege: - Default: 2 + Default: 4 AccumulateIntervalMS: - Default: 20 + Default: 12 Threshold: - Default: 1 + Default: 96 RetryCount: - Default: 7 + Default: 6 RetryIntervalMS: - Default: 10 + Default: 20 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager_%.bbappend index bc695abe8..f5c924b31 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager_%.bbappend @@ -2,3 +2,8 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += "file://0001-settings-initialize-data-file-with-default-setting.patch \ " + +DEPENDS += "intel-dbus-interfaces intel-dbus-interfaces-native" +RDEPENDS_${PN} += "intel-dbus-interfaces" + +EXTRA_OEMAKE += "LDFLAGS='${LDFLAGS} -lintel_dbus'" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/special-mode-mgr/special-mode-mgr_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/special-mode-mgr/special-mode-mgr_git.bb new file mode 100644 index 000000000..bcb8361dd --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/special-mode-mgr/special-mode-mgr_git.bb @@ -0,0 +1,28 @@ +SUMMARY = "Special mode manager daemon to handle manufacturing modes" +DESCRIPTION = "Daemon exposes the manufacturing mode property" + +PV = "1.0+git${SRCPV}" + +S = "${WORKDIR}/git/special-mode-mgr" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" + +SRC_URI = "git://github.com/Intel-BMC/provingground.git;protocol=ssh;nobranch=1" +SRCREV = "ec8f1c06be71d6059c82fd442475420286f5dbcd" + +inherit cmake systemd +SYSTEMD_SERVICE_${PN} = "specialmodemgr.service" + +DEPENDS += " \ + systemd \ + sdbusplus \ + sdbusplus-native \ + phosphor-logging \ + boost \ + " +RDEPENDS_${PN} += " \ + libsystemd \ + sdbusplus \ + phosphor-logging \ + " 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 6737ed7a2..c3d71d30c 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 @@ -8,8 +8,8 @@ S = "${WORKDIR}/git/srvcfg-manager" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" -SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh" -SRCREV = "785f19b128794611574ea6c18805740fb851ecff" +SRC_URI = "git://github.com/Intel-BMC/provingground.git;protocol=ssh" +SRCREV = "ec8f1c06be71d6059c82fd442475420286f5dbcd" 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 7d70b29fa..2adff372e 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,27 +1,28 @@ -From c0f01261572cb527cf9dc62fa732b28c658ff013 Mon Sep 17 00:00:00 2001 +From ed64fe7379a259a822aca69e70426a2b07aad25d Mon Sep 17 00:00:00 2001 From: Kuiying Wang <kuiying.wang@intel.com> Date: Tue, 7 Aug 2018 16:43:00 +0800 Subject: [PATCH] Capture host restart cause Capture host restart cause on power/reset button pressed, +ipmi command/webui, host OS reboot(Ctrl-Alt-Del), and power restore policy settings. -Save the restart cause into file system. -And restort it when BMC boot up. +Save the restart cause into file system, +and restore it when BMC boot up. Signed-off-by: Kuiying Wang <kuiying.wang@intel.com> Signed-off-by: Yong Li <yong.b.li@linux.intel.com> --- - 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(-) + configure.ac | 4 +- + discover_system_state.cpp | 14 +++++ + host_state_manager.cpp | 17 ++++++ + host_state_manager.hpp | 148 +++++++++++++++++++++++++++++++++++++++++++++- + 4 files changed, 178 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac -index e985a95..b9e64c8 100644 +index 7919ec5..051a0c0 100644 --- a/configure.ac +++ b/configure.ac -@@ -56,9 +56,9 @@ AC_ARG_VAR(HOST_RUNNING_FILE, [File to create if host is running]) +@@ -52,9 +52,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]) @@ -73,7 +74,7 @@ index 3a38152..0b5798a 100644 return 0; diff --git a/host_state_manager.cpp b/host_state_manager.cpp -index 7d661dd..03d210d 100644 +index 7d661dd..0e00e78 100644 --- a/host_state_manager.cpp +++ b/host_state_manager.cpp @@ -308,6 +308,15 @@ bool Host::deserialize(const fs::path& path) @@ -92,7 +93,15 @@ index 7d661dd..03d210d 100644 Host::Transition Host::requestedHostTransition(Transition value) { log<level::INFO>("Host State transaction request", -@@ -353,6 +362,13 @@ Host::HostState Host::currentHostState(HostState value) +@@ -321,6 +330,7 @@ Host::Transition Host::requestedHostTransition(Transition value) + // check of this count will occur + if (value != server::Host::Transition::Off) + { ++ hostRestartCause(RestartCause::IpmiCommand); + decrementRebootCount(); + } + +@@ -353,6 +363,13 @@ Host::HostState Host::currentHostState(HostState value) return server::Host::currentHostState(value); } @@ -107,10 +116,10 @@ index 7d661dd..03d210d 100644 } // namespace state } // namespace phosphor diff --git a/host_state_manager.hpp b/host_state_manager.hpp -index 2b00777..e74fab7 100644 +index 2b00777..afd8aa3 100644 --- a/host_state_manager.hpp +++ b/host_state_manager.hpp -@@ -32,6 +32,15 @@ using namespace phosphor::logging; +@@ -32,6 +32,22 @@ using namespace phosphor::logging; namespace sdbusRule = sdbusplus::bus::match::rules; namespace fs = std::experimental::filesystem; @@ -123,10 +132,17 @@ index 2b00777..e74fab7 100644 +const static constexpr char* resetButtonIntf = + "xyz.openbmc_project.Chassis.Buttons.Reset"; + ++const static constexpr char* powerControlService = ++ "xyz.openbmc_project.Chassis.Control.Power"; ++const static constexpr char* powerControlPath = ++ "/xyz/openbmc_project/Chassis/Control/Power0"; ++const static constexpr char* powerControlInterface = ++ "xyz.openbmc_project.Chassis.Control.Power"; ++ /** @class Host * @brief OpenBMC host state management implementation. * @details A concrete implementation for xyz.openbmc_project.State.Host -@@ -59,7 +68,31 @@ class Host : public HostInherit +@@ -59,8 +75,93 @@ class Host : public HostInherit sdbusRule::interface("org.freedesktop.systemd1.Manager"), std::bind(std::mem_fn(&Host::sysStateChange), this, std::placeholders::_1)), @@ -137,38 +153,121 @@ index 2b00777..e74fab7 100644 + sdbusRule::type::signal() + sdbusRule::member("Pressed") + + sdbusRule::path(powerButtonPath) + + sdbusRule::interface(powerButtonIntf), -+ [this](sdbusplus::message::message &msg) { -+ phosphor::logging::log<phosphor::logging::level::INFO>( -+ "powerButtonPressedSignal callback function is called..."); -+ this->hostRestartCause(this->RestartCause::PowerButton); -+ return; -+ } -+ ), -+ resetButtonPressedSignal( ++ [this](sdbusplus::message::message& msg) { ++ phosphor::logging::log<phosphor::logging::level::INFO>( ++ "powerButtonPressedSignal callback function is called..."); ++ this->hostRestartCause(this->RestartCause::PowerButton); ++ this->powerButtonPressed = true; ++ return; ++ }), ++ resetButtonPressedSignal( + bus, + sdbusRule::type::signal() + sdbusRule::member("Pressed") + + sdbusRule::path(resetButtonPath) + + sdbusRule::interface(resetButtonIntf), -+ [this](sdbusplus::message::message &msg) { -+ phosphor::logging::log<phosphor::logging::level::INFO>( -+ "resetButtonPressedSignal callback function is called..."); -+ this->hostRestartCause(this->RestartCause::ResetButton); -+ return; ++ [this](sdbusplus::message::message& msg) { ++ phosphor::logging::log<phosphor::logging::level::INFO>( ++ "resetButtonPressedSignal callback function is called..."); ++ this->hostRestartCause(this->RestartCause::ResetButton); ++ this->resetButtonPressed = true; ++ return; ++ }), ++ postCompletePropSignal( ++ bus, ++ sdbusplus::bus::match::rules::propertiesChanged( ++ powerControlPath, powerControlInterface), ++ [this](sdbusplus::message::message& msg) { ++ phosphor::logging::log<phosphor::logging::level::INFO>( ++ "postCompletePropSignal callback function is called..."); ++ ++ using DbusVariant = sdbusplus::message::variant< ++ std::string, bool, uint8_t, uint16_t, int16_t, uint32_t, ++ int32_t, uint64_t, int64_t, double>; ++ ++ std::map<std::string, DbusVariant> props; ++ std::vector<std::string> inval; ++ std::string iface; ++ msg.read(iface, props, inval); ++ ++ for (const auto& t : props) ++ { ++ auto key = t.first; ++ auto value = t.second; ++ ++ if (key == "state") ++ { ++ this->powerStateChanged = true; ++ } ++ ++ else if (key == "pgood") ++ { ++ this->pgood = ++ sdbusplus::message::variant_ns::get<int32_t>(value); ++ } ++ ++ else if (key == "post_complete") ++ { ++ bool postState = ++ sdbusplus::message::variant_ns::get<bool>(value); ++ ++ if (!postState && this->pgood) ++ { ++ if (!this->resetButtonPressed && ++ !this->powerButtonPressed && ++ !this->powerStateChanged) ++ { ++ phosphor::logging::log< ++ phosphor::logging::level::INFO>( ++ "OEM Reset"); ++ this->hostRestartCause(this->RestartCause::OEM); ++ } ++ this->powerButtonPressed = false; ++ this->powerStateChanged = false; ++ this->resetButtonPressed = false; ++ } ++ } + } -+ ) ++ }) { ++ powerButtonPressed = false; ++ powerStateChanged = false; ++ resetButtonPressed = false; ++ pgood = 0; ++ // Enable systemd signals subscribeToSystemdSignals(); -@@ -69,6 +102,8 @@ class Host : public HostInherit + +@@ -69,8 +170,29 @@ class Host : public HostInherit attemptsLeft(BOOT_COUNT_MAX_ALLOWED); -+ restoreHostRestartCause(); // restore host restart cause from persisted file ++ restoreHostRestartCause(); // restore host restart cause from persisted ++ // file + // We deferred this until we could get our property correct this->emit_object_added(); ++ sdbusplus::message::variant<int32_t> pgoodProp = -1; ++ auto method = ++ this->bus.new_method_call(powerControlService, powerControlPath, ++ "org.freedesktop.DBus.Properties", "Get"); ++ ++ method.append(powerControlInterface, "pgood"); ++ try ++ { ++ auto reply = this->bus.call(method); ++ reply.read(pgoodProp); ++ pgood = sdbusplus::message::variant_ns::get<int>(pgoodProp); ++ } ++ catch (const sdbusplus::exception::SdBusError& e) ++ { ++ log<level::ERR>("Error performing call to get pgood", ++ entry("NAME=%s", e.name()), ++ entry("ERROR=%s", e.what())); ++ } } -@@ -85,6 +120,9 @@ class Host : public HostInherit + + /** @brief Set value of HostTransition */ +@@ -85,6 +207,9 @@ class Host : public HostInherit /** @brief Set value of CurrentHostState */ HostState currentHostState(HostState value) override; @@ -178,19 +277,18 @@ index 2b00777..e74fab7 100644 /** * @brief Set host reboot count to default * -@@ -192,7 +230,10 @@ class Host : public HostInherit +@@ -192,7 +317,9 @@ class Host : public HostInherit server::Progress::bootProgress()), convertForMessage( sdbusplus::xyz::openbmc_project::State::OperatingSystem:: - server::Status::operatingSystemState())); + server::Status::operatingSystemState()), + convertForMessage(sdbusplus::xyz::openbmc_project::State:: -+ server::Host::hostRestartCause()) -+ ); ++ server::Host::hostRestartCause())); } /** @brief Function required by Cereal to perform deserialization. -@@ -208,7 +249,8 @@ class Host : public HostInherit +@@ -208,7 +335,8 @@ class Host : public HostInherit std::string reqTranState; std::string bootProgress; std::string osState; @@ -200,16 +298,16 @@ index 2b00777..e74fab7 100644 auto reqTran = Host::convertTransitionFromString(reqTranState); // When restoring, set the requested state with persistent value // but don't call the override which would execute it -@@ -219,6 +261,8 @@ class Host : public HostInherit +@@ -219,6 +347,8 @@ class Host : public HostInherit sdbusplus::xyz::openbmc_project::State::OperatingSystem::server:: Status::operatingSystemState( Host::convertOSStatusFromString(osState)); -+ sdbusplus::xyz::openbmc_project::State::server::Host:: -+ hostRestartCause(Host::convertRestartCauseFromString(restartCause)); ++ sdbusplus::xyz::openbmc_project::State::server::Host::hostRestartCause( ++ Host::convertRestartCauseFromString(restartCause)); } /** @brief Serialize and persist requested host state -@@ -239,6 +283,9 @@ class Host : public HostInherit +@@ -239,6 +369,9 @@ class Host : public HostInherit */ bool deserialize(const fs::path& path); @@ -219,13 +317,19 @@ index 2b00777..e74fab7 100644 /** @brief Persistent sdbusplus DBus bus connection. */ sdbusplus::bus::bus& bus; -@@ -247,6 +294,9 @@ class Host : public HostInherit +@@ -247,6 +380,15 @@ class Host : public HostInherit // Settings objects of interest settings::Objects settings; + ++ bool resetButtonPressed; ++ bool powerButtonPressed; ++ bool powerStateChanged; ++ int32_t pgood; ++ + sdbusplus::bus::match_t powerButtonPressedSignal; + sdbusplus::bus::match_t resetButtonPressedSignal; ++ sdbusplus::bus::match_t postCompletePropSignal; }; } // namespace manager diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0004-Add-Power-Restore-delay-support.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0004-Add-Power-Restore-delay-support.patch new file mode 100644 index 000000000..31cb31079 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0004-Add-Power-Restore-delay-support.patch @@ -0,0 +1,141 @@ +From 0edff651156ae63b6a73d9cb81e5e76cc6ae501a Mon Sep 17 00:00:00 2001 +From: Yong Li <yong.b.li@linux.intel.com> +Date: Fri, 12 Apr 2019 18:43:06 +0800 +Subject: [PATCH] Add Power Restore delay support + +That takes effect whenever the BMC +automatically turns on the system due +to the Power Restore Policy setting + +Tested: +Set power restore delay: +ipmitool raw 0x30 0x54 0 7 +Set restore policy as always-on: +ipmitool chassis policy always-on +AC off/on, check the journal log, the host will start boot after 7 seconds delay + +Signed-off-by: Yong Li <yong.b.li@linux.intel.com> +--- + discover_system_state.cpp | 71 +++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 68 insertions(+), 3 deletions(-) + +diff --git a/discover_system_state.cpp b/discover_system_state.cpp +index 0b5798a..298ae5b 100644 +--- a/discover_system_state.cpp ++++ b/discover_system_state.cpp +@@ -1,5 +1,4 @@ + #include <getopt.h> +-#include <iostream> + #include <map> + #include <string> + #include <config.h> +@@ -114,6 +113,49 @@ void setProperty(sdbusplus::bus::bus& bus, const std::string& path, + return; + } + ++int getPowerRestoreDelay(sdbusplus::bus::bus& bus, uint16_t& delay) ++{ ++ static constexpr const char* powerRestoreDelayObjPath = ++ "/xyz/openbmc_project/control/power_restore_delay"; ++ static constexpr const char* powerRestoreDelayIntf = ++ "xyz.openbmc_project.Control.Power.RestoreDelay"; ++ static constexpr const char* powerRestoreDelayProp = "PowerRestoreDelay"; ++ ++ std::string service = ++ getService(bus, powerRestoreDelayObjPath, powerRestoreDelayIntf); ++ ++ sdbusplus::message::message method = bus.new_method_call( ++ service.c_str(), powerRestoreDelayObjPath, PROPERTY_INTERFACE, "Get"); ++ ++ method.append(powerRestoreDelayIntf, powerRestoreDelayProp); ++ ++ try ++ { ++ auto reply = bus.call(method); ++ sdbusplus::message::variant<uint16_t> variant; ++ reply.read(variant); ++ delay = sdbusplus::message::variant_ns::get<uint16_t>(variant); ++ } ++ catch (sdbusplus::exception_t&) ++ { ++ phosphor::logging::log<phosphor::logging::level::ERR>( ++ "Failed to get property", ++ phosphor::logging::entry("PROPERTY=%s", powerRestoreDelayProp), ++ phosphor::logging::entry("PATH=%s", powerRestoreDelayObjPath), ++ phosphor::logging::entry("INTERFACE=%s", powerRestoreDelayIntf)); ++ return -1; ++ } ++ return 0; ++} ++ ++void applyPowerRestoreDelay(uint16_t delay) ++{ ++ if (delay > 0) ++ { ++ log<level::INFO>("Apply Power Restore Delay", entry("DELAY=%d", delay)); ++ std::this_thread::sleep_for(std::chrono::milliseconds(1000 * delay)); ++ } ++} + } // namespace manager + } // namespace state + } // namespace phosphor +@@ -176,13 +218,27 @@ int main(int argc, char** argv) + log<level::INFO>("Host power is off, checking power policy", + entry("POWER_POLICY=%s", powerPolicy.c_str())); + ++ uint16_t delay = 0; ++ int ret = getPowerRestoreDelay(bus, delay); ++ ++ if (ret != 0) ++ { ++ log<level::WARNING>("getPowerRestoreDelay failed!"); ++ delay = 0; ++ } ++ + if (RestorePolicy::Policy::AlwaysOn == + RestorePolicy::convertPolicyFromString(powerPolicy)) + { ++ applyPowerRestoreDelay(delay); ++ + log<level::INFO>("power_policy=ALWAYS_POWER_ON, powering host on"); ++ + setProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition", + convertForMessage(server::Host::Transition::On)); + ++ // Host on, needs to set the restart cause after host transition ++ // since host transition will change the restart cause + setProperty( + bus, hostPath, HOST_BUSNAME, "HostRestartCause", + convertForMessage(server::Host::RestartCause::PowerPolicyAlwaysOn)); +@@ -195,17 +251,26 @@ int main(int argc, char** argv) + // Read last requested state and re-request it to execute it + auto hostReqState = + getProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition"); +- setProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition", +- hostReqState); + + if (server::Host::convertTransitionFromString(hostReqState) == + server::Host::Transition::On) + { ++ applyPowerRestoreDelay(delay); ++ setProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition", ++ hostReqState); ++ ++ // Host on, needs to set the restart cause after host transition ++ // since host transition will change the restart cause + setProperty( + bus, hostPath, HOST_BUSNAME, "HostRestartCause", + convertForMessage( + server::Host::RestartCause::PowerPolicyPreviousState)); + } ++ else ++ { ++ setProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition", ++ hostReqState); ++ } + } + + return 0; +-- +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 4c50ecf5e..63155ce0d 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 @@ -6,4 +6,5 @@ SRC_URI += "file://0001-Modify-dbus-interface-for-power-control.patch \ 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 \ + file://0004-Add-Power-Restore-delay-support.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 ace1969e5..818259153 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;protocol=ssh" +SRC_URI = "git://github.com/Intel-BMC/provingground;protocol=ssh" inherit cmake systemd DEPENDS = "boost sdbusplus" PV = "0.1+git${SRCPV}" -SRCREV = "785f19b128794611574ea6c18805740fb851ecff" +SRCREV = "ec8f1c06be71d6059c82fd442475420286f5dbcd" S = "${WORKDIR}/git/callback-manager" 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 4c7d3ac2d..70cbc72f6 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 = "c3f56c50ffffe1076531eb4aad7c0a574a44841f" +SRCREV = "fef578960f632abacc5cd615b2bedfb3ab9ebb90" SRC_URI += " \ diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Add-restart-cause-support.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Add-restart-cause-support.patch new file mode 100644 index 000000000..05374e9db --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Add-restart-cause-support.patch @@ -0,0 +1,82 @@ +From af3a7d07b801c22a03350897c2186b1ee9507ff2 Mon Sep 17 00:00:00 2001 +From: Yong Li <yong.b.li@linux.intel.com> +Date: Sun, 14 Apr 2019 11:14:09 +0800 +Subject: [PATCH] Add restart cause support + +Add restart cause support for watchdog expiration, to support +Get system restart cause command defined in IPMI spec + +Tested: +Set a hard reset watchdog: +ipmitool raw 0x06 0x24 0x5 0x1 0x0 0x0 0x64 0x00 + +Start the timer: +ipmitool mc watchdog reset + +Wait for 10 seconds, host will be restart, query the restart cause: +Ipmitool chassis restart_cause +System restart cause: watchdog expired + +Signed-off-by: Yong Li <yong.b.li@linux.intel.com> +--- + watchdog.cpp | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +diff --git a/watchdog.cpp b/watchdog.cpp +index 008cde5..7f1ec05 100644 +--- a/watchdog.cpp ++++ b/watchdog.cpp +@@ -7,6 +7,7 @@ + #include <phosphor-logging/log.hpp> + #include <sdbusplus/exception.hpp> + #include <xyz/openbmc_project/Common/error.hpp> ++#include <xyz/openbmc_project/State/Host/server.hpp> + + namespace phosphor + { +@@ -24,6 +25,12 @@ constexpr auto SYSTEMD_SERVICE = "org.freedesktop.systemd1"; + constexpr auto SYSTEMD_ROOT = "/org/freedesktop/systemd1"; + constexpr auto SYSTEMD_INTERFACE = "org.freedesktop.systemd1.Manager"; + ++// host state manager service ++static constexpr const char* hostService = "xyz.openbmc_project.State.Host"; ++static constexpr const char* hostPath = "/xyz/openbmc_project/state/host0"; ++static constexpr const char* hostInterface = "xyz.openbmc_project.State.Host"; ++static constexpr const char* dbusPropIf = "org.freedesktop.DBus.Properties"; ++ + void Watchdog::resetTimeRemaining(bool enableWatchdog) + { + timeRemaining(interval()); +@@ -139,6 +146,29 @@ void Watchdog::timeOutHandler() + entry("ERROR=%s", e.what())); + commit<InternalFailure>(); + } ++ ++ // set restart cause for watchdog HardReset & PowerCycle actions ++ if ((action == Watchdog::Action::HardReset) || ++ (action == Watchdog::Action::PowerCycle)) ++ { ++ sdbusplus::message::variant<std::string> property = ++ convertForMessage( ++ (sdbusplus::xyz::openbmc_project::State::server::Host:: ++ RestartCause::WatchdogTimer)); ++ try ++ { ++ auto method = bus.new_method_call(hostService, hostPath, ++ dbusPropIf, "Set"); ++ method.append(hostInterface, "HostRestartCause", property); ++ bus.call(method); ++ } ++ catch (sdbusplus::exception_t& e) ++ { ++ log<level::ERR>("Failed to set HostRestartCause property", ++ entry("ERROR=%s", e.what())); ++ commit<InternalFailure>(); ++ } ++ } + } + + tryFallbackOrDisable(); +-- +2.7.4 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend index 6411c209d..d9c047461 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend @@ -1,6 +1,8 @@ FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" -SRC_URI += "file://0001-Add-redfish-log-support-for-IPMI-watchdog-timeout-ac.patch" +SRC_URI += "file://0001-Add-redfish-log-support-for-IPMI-watchdog-timeout-ac.patch \ + file://0002-Add-restart-cause-support.patch \ + " # Remove the override to keep service running after DC cycle SYSTEMD_OVERRIDE_${PN}_remove = "poweron.conf:phosphor-watchdog@poweron.service.d/poweron.conf" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0001-Implement-KVM-in-webui.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0001-Implement-KVM-in-webui.patch deleted file mode 100644 index 85b0f1009..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0001-Implement-KVM-in-webui.patch +++ /dev/null @@ -1,238 +0,0 @@ -From 4c63b4e16fbc3b536a437b2ab5d5df5e846e6b83 Mon Sep 17 00:00:00 2001 -From: Ed tanous <ed@tanous.net> -Date: Sun, 22 Apr 2018 10:53:28 -0700 -Subject: [PATCH] Implement KVM in webui - -This patchset adds the infrastructure to allow KVM sessions -through the webui. A websocket capable VNC/RFB connection -on the BMC is needed for KVM sessions. - -To access, navigate to Server control -> KVM. - -Tested: Ran obmc-ikvm on the BMC, added a KVM Handler to - Phosphor Rest Server, and was able to establish a - KVM session in the webui on a Witherspoon. -Change-Id: I7dda5bec41d270ae8d0913697714d4df4ec3a257 -Signed-off-by: Ed Tanous <ed.tanous@intel.com> -Signed-off-by: Gunnar Mills <gmills@us.ibm.com> ---- - app/common/directives/app-navigation.html | 12 +++-- - app/index.js | 1 + - app/server-control/controllers/kvm-controller.html | 5 ++ - app/server-control/controllers/kvm-controller.js | 55 ++++++++++++++++++++++ - app/server-control/index.js | 5 ++ - app/server-control/styles/index.scss | 1 + - app/server-control/styles/kvm.scss | 11 +++++ - package-lock.json | 5 ++ - package.json | 1 + - webpack.config.js | 6 ++- - 10 files changed, 96 insertions(+), 6 deletions(-) - create mode 100644 app/server-control/controllers/kvm-controller.html - create mode 100644 app/server-control/controllers/kvm-controller.js - create mode 100644 app/server-control/styles/kvm.scss - -diff --git a/app/common/directives/app-navigation.html b/app/common/directives/app-navigation.html -index a45a24bcbaa1..e54b23631b3e 100644 ---- a/app/common/directives/app-navigation.html -+++ b/app/common/directives/app-navigation.html -@@ -87,19 +87,21 @@ - <a href="#/server-control/bmc-reboot" tabindex="13" ng-click="closeSubnav()">Reboot BMC</a></li> - <li ng-class="{'active': (path == '/server-control/remote-console')}"> - <a href="#/server-control/remote-console" tabindex="14" ng-click="closeSubnav()">Serial over LAN console</a></li> -+ <li ng-class="{'active': (path == '/server-control/kvm')}"> -+ <a href="#/server-control/kvm" tabindex="15" ng-click="closeSubnav()">KVM</a></li> - </ul> - <ul class="nav__second-level btn-firmware" ng-style="navStyle" ng-class="{opened: (showSubMenu && firstLevel == 'configuration')}"> - <li ng-class="{'active': (path == '/configuration' || path == '/configuration/network')}"> -- <a href="#/configuration/network" tabindex="15" ng-click="closeSubnav()">Network settings</a></li> -+ <a href="#/configuration/network" tabindex="16" ng-click="closeSubnav()">Network settings</a></li> - <li ng-class="{'active': (path == '/configuration' || path == '/configuration/snmp')}"> -- <a href="#/configuration/snmp" tabindex="16" ng-click="closeSubnav()">SNMP settings</a></li> -+ <a href="#/configuration/snmp" tabindex="17" ng-click="closeSubnav()">SNMP settings</a></li> - <li ng-class="{'active': (path == '/configuration' || path == '/configuration/firmware')}"> -- <a href="#/configuration/firmware" tabindex="17" ng-click="closeSubnav()">Firmware</a></li> -+ <a href="#/configuration/firmware" tabindex="18" ng-click="closeSubnav()">Firmware</a></li> - <li ng-class="{'active': (path == '/configuration' || path == '/configuration/date-time')}"> -- <a href="#/configuration/date-time" tabindex="18" ng-click="closeSubnav()">Date and time settings</a></li> -+ <a href="#/configuration/date-time" tabindex="19" ng-click="closeSubnav()">Date and time settings</a></li> - </ul> - <ul class="nav__second-level btn-users" ng-style="navStyle" ng-class="{opened: (showSubMenu && firstLevel == 'users')}"> - <li ng-class="{'active': (path == '/users' || path == '/users/manage-accounts')}"> -- <a href="#/users/manage-accounts" tabindex="19" ng-click="closeSubnav()">Manage user account</a></li> -+ <a href="#/users/manage-accounts" tabindex="20" ng-click="closeSubnav()">Manage user account</a></li> - </ul> - </nav> -diff --git a/app/index.js b/app/index.js -index 38df0e9896f4..a0dde4df96b7 100644 ---- a/app/index.js -+++ b/app/index.js -@@ -69,6 +69,7 @@ import power_operations_controller from './server-control/controllers/power-oper - import power_usage_controller from './server-control/controllers/power-usage-controller.js'; - import remote_console_window_controller from './server-control/controllers/remote-console-window-controller.js'; - import server_led_controller from './server-control/controllers/server-led-controller.js'; -+import kvm_controller from './server-control/controllers/kvm-controller.js'; - - import server_health_index from './server-health/index.js'; - import inventory_overview_controller from './server-health/controllers/inventory-overview-controller.js'; -diff --git a/app/server-control/controllers/kvm-controller.html b/app/server-control/controllers/kvm-controller.html -new file mode 100644 -index 000000000000..40e4d97454bc ---- /dev/null -+++ b/app/server-control/controllers/kvm-controller.html -@@ -0,0 +1,5 @@ -+<div id="noVNC_container"> -+ <div id="noVNC_status_bar"> -+ <div id="noVNC_left_dummy_elem"></div> -+ </div> -+</div> -diff --git a/app/server-control/controllers/kvm-controller.js b/app/server-control/controllers/kvm-controller.js -new file mode 100644 -index 000000000000..a43f169ddf19 ---- /dev/null -+++ b/app/server-control/controllers/kvm-controller.js -@@ -0,0 +1,55 @@ -+/** -+ * Controller for KVM (Kernel-based Virtual Machine) -+ * -+ * @module app/serverControl -+ * @exports kvmController -+ * @name kvmController -+ */ -+ -+import RFB from '@novnc/novnc/core/rfb.js'; -+ -+window.angular && (function(angular) { -+ 'use strict'; -+ -+ angular.module('app.serverControl').controller('kvmController', [ -+ '$scope', '$location', '$log', -+ function($scope, $location, $log) { -+ var rfb; -+ -+ $scope.$on('$destroy', function() { -+ if (rfb) { -+ rfb.disconnect(); -+ } -+ }); -+ -+ function sendCtrlAltDel() { -+ rfb.sendCtrlAltDel(); -+ return false; -+ }; -+ -+ function connected(e) { -+ $log.debug('RFB Connected'); -+ } -+ function disconnected(e) { -+ $log.debug('RFB disconnected'); -+ } -+ -+ var host = $location.host(); -+ var port = $location.port(); -+ var target = -+ angular.element(document.querySelector('#noVNC_container'))[0]; -+ -+ try { -+ rfb = new RFB(target, 'wss://' + host + ':' + port + '/kvm/0', {}); -+ -+ rfb.addEventListener('connect', connected); -+ rfb.addEventListener('disconnect', disconnected); -+ } catch (exc) { -+ $log.error(exc); -+ updateState( -+ null, 'fatal', null, 'Unable to create RFB client -- ' + exc); -+ return; // don't continue trying to connect -+ }; -+ } -+ ]); -+})(angular); -diff --git a/app/server-control/index.js b/app/server-control/index.js -index 739bd1eb8ad9..1b8aad50b702 100644 ---- a/app/server-control/index.js -+++ b/app/server-control/index.js -@@ -48,6 +48,11 @@ window.angular && (function(angular) { - 'controller': 'remoteConsoleWindowController', - authenticated: true - }) -+ .when('/server-control/kvm', { -+ 'template': require('./controllers/kvm-controller.html'), -+ 'controller': 'kvmController', -+ authenticated: true -+ }) - .when('/server-control', { - 'template': - require('./controllers/power-operations-controller.html'), -diff --git a/app/server-control/styles/index.scss b/app/server-control/styles/index.scss -index f6b15ab6afc9..5e8a99580894 100644 ---- a/app/server-control/styles/index.scss -+++ b/app/server-control/styles/index.scss -@@ -3,3 +3,4 @@ - @import "./remote-console.scss"; - @import "./server-led.scss"; - @import "./power-usage.scss"; -+@import "./kvm.scss"; -diff --git a/app/server-control/styles/kvm.scss b/app/server-control/styles/kvm.scss -new file mode 100644 -index 000000000000..2f9e2c0c9f37 ---- /dev/null -+++ b/app/server-control/styles/kvm.scss -@@ -0,0 +1,11 @@ -+ -+.noNVC_shown { -+ display: inline; -+} -+.noVNC_hidden { -+ display: none; -+} -+ -+#noVNC_left_dummy_elem { -+ flex: 1; -+} -diff --git a/package-lock.json b/package-lock.json -index 2d9d31b21968..103c9b84b933 100644 ---- a/package-lock.json -+++ b/package-lock.json -@@ -807,6 +807,11 @@ - "to-fast-properties": "2.0.0" - } - }, -+ "@novnc/novnc": { -+ "version": "1.0.0", -+ "resolved": "https://registry.npmjs.org/@novnc/novnc/-/novnc-1.0.0.tgz", -+ "integrity": "sha1-drDonm+HOMqBVBlbr1uOaoC8kQU=" -+ }, - "@types/node": { - "version": "10.12.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", -diff --git a/package.json b/package.json -index 35c6b78e320c..fd253cbb2f02 100644 ---- a/package.json -+++ b/package.json -@@ -30,6 +30,7 @@ - "dependencies": { - "angular": "^1.7.5", - "angular-animate": "^1.7.5", -+ "@novnc/novnc": "^1.0.0", - "angular-clipboard": "^1.6.2", - "angular-cookies": "^1.7.5", - "angular-messages": "^1.7.6", -diff --git a/webpack.config.js b/webpack.config.js -index 91cbea8f2952..6c8667cbbc98 100644 ---- a/webpack.config.js -+++ b/webpack.config.js -@@ -113,7 +113,11 @@ module.exports = (env, options) => { - 'base-uri': '\'self\'', - 'object-src': '\'none\'', - 'script-src': ['\'self\''], -- 'style-src': ['\'self\''] -+ 'style-src': ['\'self\''], -+ // KVM requires image buffers from data: payloads, so allow that in -+ // img-src -+ // https://stackoverflow.com/questions/18447970/content-security-policy-data-not-working-for-base64-images-in-chrome-28 -+ 'img-src': ['\'self\'', 'data:'], - }), - new MiniCssExtractPlugin(), - --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0008-Pull-the-latest-novnc-package.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0008-Pull-the-latest-novnc-package.patch deleted file mode 100644 index 77bf662dc..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui/0008-Pull-the-latest-novnc-package.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 7ea99450a96ac6eb5815ed5f1b7a17e055365b78 Mon Sep 17 00:00:00 2001 -From: Jae Hyun Yoo <jae.hyun.yoo@intel.com> -Date: Sat, 6 Apr 2019 00:15:04 -0700 -Subject: [PATCH] Pull the latest novnc package - -Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com> ---- - package-lock.json | 18 +++++++++++------- - package.json | 2 +- - 2 files changed, 12 insertions(+), 8 deletions(-) - -diff --git a/package-lock.json b/package-lock.json -index c79a26c8229c..337383551a96 100644 ---- a/package-lock.json -+++ b/package-lock.json -@@ -808,9 +808,8 @@ - } - }, - "@novnc/novnc": { -- "version": "1.0.0", -- "resolved": "https://registry.npmjs.org/@novnc/novnc/-/novnc-1.0.0.tgz", -- "integrity": "sha1-drDonm+HOMqBVBlbr1uOaoC8kQU=" -+ "version": "git+https://github.com/novnc/noVNC.git#a136b4b078e8ac316b80d1ee24cf8f9b400ba2d5", -+ "from": "git+https://github.com/novnc/noVNC.git#a136b4b078e8ac316b80d1ee24cf8f9b400ba2d5" - }, - "@types/node": { - "version": "10.12.18", -@@ -3965,7 +3964,8 @@ - "ansi-regex": { - "version": "2.1.1", - "bundled": true, -- "dev": true -+ "dev": true, -+ "optional": true - }, - "aproba": { - "version": "1.2.0", -@@ -4380,7 +4380,8 @@ - "safe-buffer": { - "version": "5.1.1", - "bundled": true, -- "dev": true -+ "dev": true, -+ "optional": true - }, - "safer-buffer": { - "version": "2.1.2", -@@ -4436,6 +4437,7 @@ - "version": "3.0.1", - "bundled": true, - "dev": true, -+ "optional": true, - "requires": { - "ansi-regex": "2.1.1" - } -@@ -4479,12 +4481,14 @@ - "wrappy": { - "version": "1.0.2", - "bundled": true, -- "dev": true -+ "dev": true, -+ "optional": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true, -- "dev": true -+ "dev": true, -+ "optional": true - } - } - }, -diff --git a/package.json b/package.json -index 0a880571d617..be816c8ece03 100644 ---- a/package.json -+++ b/package.json -@@ -30,7 +30,7 @@ - "dependencies": { - "angular": "^1.7.5", - "angular-animate": "^1.7.5", -- "@novnc/novnc": "^1.0.0", -+ "@novnc/novnc": "https://github.com/novnc/noVNC.git#a136b4b078e8ac316b80d1ee24cf8f9b400ba2d5", - "angular-clipboard": "^1.6.2", - "angular-cookies": "^1.7.5", - "angular-messages": "^1.7.6", --- -2.7.4 - 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 9248894f7..3d8f359f8 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,9 +1,6 @@ FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" #SRC_URI = "git://github.com/openbmc/phosphor-webui.git" -SRCREV = "4733a11b42fca6013e3957bf0e345d0cea086d96" +SRCREV = "44da471fceb3790b49a43bc023781f62b19f9fde" -SRC_URI += "file://0001-Implement-KVM-in-webui.patch \ - file://0004-Implement-force-boot-to-bios-in-server-power-control.patch \ - file://0008-Pull-the-latest-novnc-package.patch \ - " +SRC_URI += "file://0004-Implement-force-boot-to-bios-in-server-power-control.patch" |