From d0f63ef62c76c932a2003eaa42c0b250065ae06f Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Wed, 31 Jul 2019 10:43:37 -0700 Subject: Update to internal 7-31-19 Signed-off-by: Ed Tanous --- .../xyz.openbmc_project.CloseMuxes.service | 10 - .../configuration/entity-manager_%.bbappend | 12 +- .../0002-Modify-Dbus-for-IPv6.patch | 38 +- ...003-Chassis-Power-Control-are-implemented.patch | 264 ------------- .../0009-Add-host-restart-cause-property.patch | 98 ----- ...iple-state-signal-for-host-start-and-stop.patch | 63 ---- ...ng-the-Session-interface-for-Host-and-LAN.patch | 116 ------ ...d-interface-suppot-for-provisioning-modes.patch | 52 --- ...-Intf-Security-modes-property-intf-update.patch | 80 ++++ ...0023-Add-host-interrupt-to-the-Host-State.patch | 31 -- ...25-Add-PreInterruptFlag-properity-in-DBUS.patch | 39 ++ .../dbus/phosphor-dbus-interfaces_%.bbappend | 10 +- .../phosphor-pid-control.service | 4 +- .../fans/phosphor-pid-control_%.bbappend | 2 +- .../flash/phosphor-software-manager_%.bbappend | 2 - .../recipes-phosphor/gpiodaemon/gpiodaemon.bb | 18 - .../recipes-phosphor/interfaces/bmcweb_%.bbappend | 2 +- .../ipmi/phosphor-ipmi-config/channel_config.json | 10 +- ...2-Modify-dbus-interface-for-power-control.patch | 31 -- .../0010-fix-get-system-GUID-ipmi-command.patch | 74 ++-- .../0013-ipmi-add-set-bios-id-to-whitelist.patch | 15 +- ...ment-IPMI-Commmand-Get-Host-Restart-Cause.patch | 143 ------- ...ified-error-on-ipmi-restart-cause-command.patch | 71 ---- ...nt-set-front-panel-button-enables-command.patch | 176 --------- ...ed-bit-support-for-get-chassis-status-com.patch | 76 ---- ...ve-Set-SOL-config-parameter-to-host-ipmid.patch | 372 +++++++++--------- ...ve-Get-SOL-config-parameter-to-host-ipmid.patch | 270 +++++-------- ...nbmc_project.State.Chassis-for-IPMI-chass.patch | 127 ------- .../0062-Update-IPMI-Chassis-Control-command.patch | 89 ++++- ...hdog-to-save-useflag-after-host-power-off.patch | 29 ++ ...064-Update-provisioning-mode-filter-logic.patch | 286 ++++++++++++++ .../phosphor-ipmi-host/host-ipmid-whitelist.conf | 50 +++ .../phosphor-ipmi-host/phosphor-ipmi-host.service | 6 +- .../ipmi/phosphor-ipmi-host_%.bbappend | 12 +- .../ipmi/phosphor-ipmi-ipmb_%.bbappend | 2 +- ...Adding-support-for-GetSessionInfo-command.patch | 418 --------------------- ...Session-Info-cmd-based-on-Upstream-review.patch | 282 -------------- .../0009-Add-dbus-interface-for-sol-commands.patch | 48 ++- .../ipmi/phosphor-ipmi-net_%.bbappend | 7 +- .../ipmi/phosphor-node-manager-proxy_git.bb | 2 +- .../multi-node-manager/multi-node-manager.bb | 2 +- .../phosphor-u-boot-mgr/phosphor-u-boot-mgr_git.bb | 18 + .../preinit-mounts/preinit-mounts/init | 162 ++++---- .../prov-mode-mgr/prov-mode-mgr_git.bb | 18 + .../sel-logger/phosphor-sel-logger_%.bbappend | 2 +- .../sensors/dbus-sensors_%.bbappend | 4 +- .../phosphor-settings-defaults-native.bbappend | 4 - .../defaults.yaml | 209 ----------- ...initialize-data-file-with-default-setting.patch | 37 -- .../settings/phosphor-settings-manager_%.bbappend | 9 - .../recipes-phosphor/settings/settings_git.bb | 4 +- .../special-mode-mgr/special-mode-mgr_git.bb | 2 +- .../srvcfg-manager/srvcfg-manager_git.bb | 2 +- ...1-Modify-dbus-interface-for-power-control.patch | 38 -- .../0002-Capture-host-restart-cause.patch | 338 ----------------- ...boot-for-the-Reboot-host-state-transition.patch | 71 ---- .../0004-Add-Power-Restore-delay-support.patch | 141 ------- .../phosphor-reboot-host@.service | 18 - .../phosphor-reset-host-check@.service | 19 - .../phosphor-reset-host-reboot-attempts@.service | 14 - .../state/phosphor-state-manager_%.bbappend | 10 - .../recipes-phosphor/system/callback-manager.bb | 2 +- ...suport-for-multiple-user-manager-services.patch | 31 +- .../users/phosphor-user-manager_%.bbappend | 4 +- .../virtual-media/virtual-media.bb | 21 ++ ...-log-support-for-IPMI-watchdog-timeout-ac.patch | 51 --- ...hosphor-Watchdog-to-Not-Use-Service-Files.patch | 198 ++++++++++ .../0002-Add-restart-cause-support.patch | 82 ---- ...he-watchdog-when-the-host-is-going-to-off.patch | 118 ++++++ ...-log-support-for-IPMI-watchdog-pre-timeou.patch | 48 --- .../obmc-enable-host-watchdog@.service | 14 - .../phosphor-watchdog/phosphor-watchdog.service | 16 + .../phosphor-watchdog/phosphor-watchdog@.service | 12 - .../watchdog/phosphor-watchdog_%.bbappend | 7 +- .../webui/phosphor-webui_%.bbappend | 2 +- 75 files changed, 1458 insertions(+), 3707 deletions(-) delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.CloseMuxes.service delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0003-Chassis-Power-Control-are-implemented.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0009-Add-host-restart-cause-property.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0014-Add-multiple-state-signal-for-host-start-and-stop.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0019-Creating-the-Session-interface-for-Host-and-LAN.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-Add-interface-suppot-for-provisioning-modes.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-D-Bus-Intf-Security-modes-property-intf-update.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0023-Add-host-interrupt-to-the-Host-State.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0025-Add-PreInterruptFlag-properity-in-DBUS.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/gpiodaemon/gpiodaemon.bb delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Modify-dbus-interface-for-power-control.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0021-Implement-IPMI-Commmand-Get-Host-Restart-Cause.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0055-Implement-set-front-panel-button-enables-command.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0058-Add-AC-failed-bit-support-for-get-chassis-status-com.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0061-Use-xyz.openbmc_project.State.Chassis-for-IPMI-chass.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Enable-watchdog-to-save-useflag-after-host-power-off.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Update-provisioning-mode-filter-logic.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/host-ipmid-whitelist.conf delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0007-Adding-support-for-GetSessionInfo-command.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0008-Sync-GetSession-Info-cmd-based-on-Upstream-review.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/phosphor-u-boot-mgr/phosphor-u-boot-mgr_git.bb create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/prov-mode-mgr/prov-mode-mgr_git.bb delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native.bbappend delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native/defaults.yaml delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager/0001-settings-initialize-data-file-with-default-setting.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager_%.bbappend delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0001-Modify-dbus-interface-for-power-control.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0002-Capture-host-restart-cause.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0003-Use-warm-reboot-for-the-Reboot-host-state-transition.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0004-Add-Power-Restore-delay-support.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reboot-host@.service delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-check@.service delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-reboot-attempts@.service delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/virtual-media/virtual-media.bb delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Add-redfish-log-support-for-IPMI-watchdog-timeout-ac.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Move-Phosphor-Watchdog-to-Not-Use-Service-Files.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Add-restart-cause-support.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Stop-the-watchdog-when-the-host-is-going-to-off.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0003-Add-redfish-log-support-for-IPMI-watchdog-pre-timeou.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/obmc-enable-host-watchdog@.service create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor') diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.CloseMuxes.service b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.CloseMuxes.service deleted file mode 100644 index bc05fa1a1..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.CloseMuxes.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Close Muxes -ConditionFileNotEmpty=/usr/bin/CloseMuxes.py - -[Service] -ExecStart=/usr/bin/env CloseMuxes.py -Type=oneshot - -[Install] -WantedBy=basic.target 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 8b9da74f0..d4b50df88 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,18 +1,8 @@ # this is here just to bump faster than upstream SRC_URI = "git://github.com/openbmc/entity-manager.git" -SRCREV = "15c49902cf030a91a5b4bd325d185ee74b760359" +SRCREV = "441c7a86749b2331863b115e141033e735bd6ffc" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -RDEPENDS_${PN} += "python" -SRC_URI += " file://xyz.openbmc_project.CloseMuxes.service" -SYSTEMD_SERVICE_${PN} += " xyz.openbmc_project.CloseMuxes.service" - EXTRA_OECMAKE = "-DYOCTO=1 -DUSE_OVERLAYS=0" -do_install_prepend() { - install -d ${D}${bindir} - install -m 0755 ${S}/scripts/CloseMuxes.py ${D}${bindir} - install -d ${D}${base_libdir}/systemd/system - install -m 0644 ${WORKDIR}/xyz.openbmc_project.CloseMuxes.service ${D}${base_libdir}/systemd/system -} 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 3ca81c388..fc09da3bd 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,26 +1,24 @@ -From 068b816b3c9bf75dcd2a808fc81c67a32fbe29ea Mon Sep 17 00:00:00 2001 +From 62240a7ef12bb2ed3730a625ad7a809a9a6d0512 Mon Sep 17 00:00:00 2001 From: David Cobbley Date: Wed, 6 Jun 2018 10:11:58 -0700 -Subject: [PATCH] Modify Dbus for IPv6. +Subject: [PATCH 1/1] Modify Dbus for IPv6. Add additional interfaces for IPv6 use. + +Signed-off-by: James Feist --- - .../Network/EthernetInterface.interface.yaml | 17 ++++++++++++++++- - xyz/openbmc_project/Network/IP.interface.yaml | 4 ++++ - 2 files changed, 20 insertions(+), 1 deletion(-) + .../Network/EthernetInterface.interface.yaml | 13 ++++++++++++- + xyz/openbmc_project/Network/IP.interface.yaml | 4 ++++ + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/xyz/openbmc_project/Network/EthernetInterface.interface.yaml b/xyz/openbmc_project/Network/EthernetInterface.interface.yaml -index 744ac77..6b7cd9a 100644 +index 6fa1d0b..6b7cd9a 100644 --- a/xyz/openbmc_project/Network/EthernetInterface.interface.yaml +++ b/xyz/openbmc_project/Network/EthernetInterface.interface.yaml -@@ -42,6 +42,14 @@ properties: +@@ -46,6 +46,10 @@ properties: + type: boolean description: > - This indicates link local auto configuration on this ethernet - interface and configured on this ethernet interface. -+ - name: IPv6AcceptRA -+ type: boolean -+ description: > -+ Boolean for accepting router advertisements in IPv6 + Boolean for accepting router advertisements in IPv6 + - name: IPAddressEnables + type: enum[self.IPAllowed] + description: > @@ -28,7 +26,7 @@ index 744ac77..6b7cd9a 100644 enumerations: - name: LinkLocalConf -@@ -52,4 +60,11 @@ enumerations: +@@ -56,4 +60,11 @@ enumerations: - name: v4 - name: v6 - name: none @@ -42,13 +40,13 @@ index 744ac77..6b7cd9a 100644 + - name: IPv4Only + - name: IPv6Only diff --git a/xyz/openbmc_project/Network/IP.interface.yaml b/xyz/openbmc_project/Network/IP.interface.yaml -index 565dcd6..2ffb016 100644 +index 5091ac9..b2442a5 100644 --- a/xyz/openbmc_project/Network/IP.interface.yaml +++ b/xyz/openbmc_project/Network/IP.interface.yaml -@@ -22,6 +22,10 @@ properties: - type: string - description: > - This is the IP gateway for this address. +@@ -34,6 +34,10 @@ properties: + errors: + - xyz::openbmc_project.Common.Error.NotAllowed + + - name: BackupGateway + type: string + description: > @@ -57,5 +55,5 @@ index 565dcd6..2ffb016 100644 type: enum[self.Protocol] description: > -- -2.7.4 +2.17.1 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0003-Chassis-Power-Control-are-implemented.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0003-Chassis-Power-Control-are-implemented.patch deleted file mode 100644 index 0e25856ac..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0003-Chassis-Power-Control-are-implemented.patch +++ /dev/null @@ -1,264 +0,0 @@ -From a20f9fa9941533b591b6bbfe6b22a74b7c0dfe64 Mon Sep 17 00:00:00 2001 -From: Ed Tanous -Date: Thu, 24 Jan 2019 09:29:01 -0800 -Subject: [PATCH] Chassis Power Control are implemented. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Feature level: -Power on server is ready -Power off server is ready -Power cycle server is ready -Power reset server is ready - -Framework level: -WebUI is enabled. -IPMI Commands is enabled. -Restful API is enabled. -Physical buttons (Power/Reset/ID) are enabled. -Chassis state manager is enabled. -Host state manager is enabled. - -Enabled IPMI commands: -ipmitool -H -P -I lanplus chassis status -ipmitool -H   -P -I lanplus chassis power status -ipmitool -H   -P -I lanplus chassis power on -ipmitool -H   -P -I lanplus chassis power off -ipmitool -H   -P -I lanplus chassis power cycle -ipmitool -H   -P -I lanplus chassis power reset - -Enabled Restful APIs: -Login: curl --noproxy -c cjar -b cjar -k -H "Content-Type: application/json" -X POST https:///login -d "{\"data\": [ \"root\", \"0penBmc\" ] }“ -Host State: curl --noproxy -b cjar -k https:///xyz/openbmc_project/state/host0 -Chassis State: curl --noproxy -b cjar -k https:///xyz/openbmc_project/state/chassis0 -Power state: curl --noproxy -b cjar -k https:///xyz/openbmc_project/Chassis/Control/Power0 -Power on/off: curl --noproxy -q1c cjar -b cjar -k -H "Content-Type: application/json" -d '{"data": "xyz.openbmc_project.State.Host.Transition.Off"}' -X PUT https:///xyz/openbmc_project/state/host0/attr/RequestedHostTransition - -Signed-off-by: Kuiying Wang -Signed-off-by: Yong Li ---- - .../Chassis/Control/Chassis.interface.yaml | 94 ++++++++++++++++++++++ - .../Chassis/Control/Power.interface.yaml | 92 ++++++++++++++++++--- - 2 files changed, 173 insertions(+), 13 deletions(-) - create mode 100644 xyz/openbmc_project/Chassis/Control/Chassis.interface.yaml - -diff --git a/xyz/openbmc_project/Chassis/Control/Chassis.interface.yaml b/xyz/openbmc_project/Chassis/Control/Chassis.interface.yaml -new file mode 100644 -index 0000000..c28492a ---- /dev/null -+++ b/xyz/openbmc_project/Chassis/Control/Chassis.interface.yaml -@@ -0,0 +1,94 @@ -+description: > -+ chassis control service -+methods: -+ - name: powerOn -+ description: > -+ Power on system. -+ returns: -+ - name: state -+ type: int32 -+ description: > -+ The result of command. -+ errors: -+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand -+ -+ - xyz.openbmc_project.Chassis.Common.Error.IOError -+ -+ - name: powerOff -+ description: > -+ Power Off system. -+ returns: -+ - name: state -+ type: int32 -+ description: > -+ The result of command. -+ errors: -+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand -+ -+ - xyz.openbmc_project.Chassis.Common.Error.IOError -+ -+ - name: softPowerOff -+ description: > -+ Soft Power off system. -+ returns: -+ - name: state -+ type: int32 -+ description: > -+ The result of command. -+ errors: -+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand -+ -+ - xyz.openbmc_project.Chassis.Common.Error.IOError -+ -+ - name: reboot -+ description: > -+ reboot system. -+ returns: -+ - name: state -+ type: int32 -+ description: > -+ The result of command. -+ errors: -+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand -+ -+ - xyz.openbmc_project.Chassis.Common.Error.IOError -+ -+ - name: softReboot -+ description: > -+ Soft Reboot system. -+ returns: -+ - name: state -+ type: int32 -+ description: > -+ The result of command. -+ errors: -+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand -+ -+ - xyz.openbmc_project.Chassis.Common.Error.IOError -+ -+ - name: quiesce -+ description: > -+ Quiesce system. -+ returns: -+ - name: state -+ type: int32 -+ description: > -+ The result of command. -+ errors: -+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand -+ -+ - xyz.openbmc_project.Chassis.Common.Error.IOError -+ -+ - name: getPowerState -+ description: > -+ Get system power state. -+ returns: -+ - name: state -+ type: int32 -+ description: > -+ The result of command. -+ errors: -+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand -+ -+ - xyz.openbmc_project.Chassis.Common.Error.IOError -+ -diff --git a/xyz/openbmc_project/Chassis/Control/Power.interface.yaml b/xyz/openbmc_project/Chassis/Control/Power.interface.yaml -index 082586f..368beca 100644 ---- a/xyz/openbmc_project/Chassis/Control/Power.interface.yaml -+++ b/xyz/openbmc_project/Chassis/Control/Power.interface.yaml -@@ -1,31 +1,97 @@ - description: > -- Power control service -+ Chassis control service - methods: -+ - name: setPowerState -+ description: > -+ set host power state. -+ parameters: -+ - name: state -+ type: int32 -+ description: > -+ 0 for force power off host -+ 1 for power on host -+ returns: -+ - name: status -+ type: int32 -+ description: > -+ The result of command. -+ errors: -+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand -+ -+ - xyz.openbmc_project.Chassis.Common.Error.IOError -+ -+ - name: getPowerState -+ description: > -+ Get current host power status. -+ returns: -+ - name: status -+ type: int32 -+ description: > -+ Current host status, -+ 0 for host power off -+ 1 for host power on -+ errors: -+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand -+ -+ - xyz.openbmc_project.Chassis.Common.Error.IOError -+ - - name: forcePowerOff - description: > - Force power off the host. - returns: - - name: status -- type: boolean -+ type: int32 - description: > - The result of power off command. - errors: - - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand -+ - - xyz.openbmc_project.Chassis.Common.Error.IOError - - properties: -- - name: PGood -- type: boolean -- default: false -+ - name: vrd_good -+ type: int32 -+ default: 0 -+ description: > -+ ACPI status -+ - name: s4s5_state -+ type: int32 -+ default: 0 -+ description: > -+ ACPI status -+ - name: pgood -+ type: int32 -+ default: 0 - description: > -- PSU Power good property -- It is a read-only property. -- - name: State -+ pgood property -+ - name: state - type: int32 - default: 0 - description: > -- System power status -- 0: power is off -- 1: power is on -- Setting its value to change the system state -- Read its value to get the system state. -\ No newline at end of file -+ state property -+ - name: pgood_timeout -+ type: int32 -+ default: 0 -+ description: > -+ pgoodtimeout property -+ - name: post_complete -+ type: boolean -+ default: false -+ description: > -+ The current BIOS POST state, -+ false means not completed or system reset, -+ true means BIOS POST completed. -+ - name: PFail -+ type: boolean -+ default: true -+ description: > -+ The current booting status, -+ true means booting from AC loss, -+ false means not booting from AC loss. -+signals: -+ - name: PowerGood -+ description: > -+ Signal for powergood -+ - name: PowerLost -+ description: > -+ Signal for powerlost --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0009-Add-host-restart-cause-property.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0009-Add-host-restart-cause-property.patch deleted file mode 100644 index 1221a0ab4..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0009-Add-host-restart-cause-property.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 72b7b30a5dda56c170ee2ce82c1082c26f4663e3 Mon Sep 17 00:00:00 2001 -From: Kuiying Wang -Date: Tue, 31 Jul 2018 16:55:21 +0800 -Subject: [PATCH] Add host restart cause property. - -Add host restart cause property to track the information about what -action last caused the system to restart. -According to IPMI Spec, it includes 12 types as following: -1. Unknown 0x0 -2. IpmiCommand 0x1 -3. ResetButton 0x2 -4. PowerButton 0x3 -5. WatchdogTimer 0x4 -6. OEM 0x5 -7. PowerPolicyAlwaysOn 0x6 -8. PowerPolicyPreviousState 0x7 -9. PEF-Reset 0x8 -10. PEF-PowerCycle 0x9 -11. SoftReset 0xA -12. RTC-Wakeup 0xB - -Change-Id: Id2cc6a18b98e485a978940e5ffc085bf5c4fbed8 -Signed-off-by: Kuiying Wang ---- - xyz/openbmc_project/State/Host.interface.yaml | 52 +++++++++++++++++++ - 1 file changed, 52 insertions(+) - -diff --git a/xyz/openbmc_project/State/Host.interface.yaml b/xyz/openbmc_project/State/Host.interface.yaml -index 8f481b8..a4d88d0 100644 ---- a/xyz/openbmc_project/State/Host.interface.yaml -+++ b/xyz/openbmc_project/State/Host.interface.yaml -@@ -17,6 +17,12 @@ properties: - comparing the CurrentHostState and the RequestedHostTransition - properties. - -+ - name: HostRestartCause -+ type: enum[self.RestartCause] -+ default: Unknown -+ description: > -+ The information about what action last caused the system to restart. -+ - enumerations: - - name: Transition - description: > -@@ -45,3 +51,49 @@ enumerations: - - name: 'Quiesced' - description: > - Host firmware is quiesced -+ -+ - name: RestartCause -+ description: > -+ The information about what action last caused the system to restart. -+ values: -+ - name: Unknown -+ description: > -+ System start/restart detected but the reason is unknown. -+ - name: IpmiCommand -+ description: > -+ System start/restart detected and caused by ipmi command. -+ - name: ResetButton -+ description: > -+ System start/restart detected and caused by reset button. -+ - name: PowerButton -+ description: > -+ System start/restart detected and caused by power button. -+ - name: WatchdogTimer -+ description: > -+ System start/restart detected and casued by watchdog expiration. -+ - name: OEM -+ description: > -+ System start/restart detected and caused by OEM command. -+ - name: PowerPolicyAlwaysOn -+ description: > -+ System start/restart detected and caused by power restore policy -+ "chassis always powers up after AC/mains is applied or returns". -+ - name: PowerPolicyPreviousState -+ description: > -+ System start/restart detected and caused by power restore policy -+ "after AC/mains is applied or returns, power is restored to the -+ state was in effect when AC/mains removed or lost". -+ - name: PEFReset -+ description: > -+ System start/restart detected and caused by PEF(reset). -+ - name: PEFPowerCycle -+ description: > -+ System start/restart detected and caused by PEF(power-cycle). -+ - name: SoftReset -+ description: > -+ System start/restart detected and caused by soft reset like -+ "CTRL-ALT-DEL". -+ - name: RTCWakeup -+ description: > -+ System start/restart detected and caused by system real time -+ clock(RTC) wakeup. -\ No newline at end of file --- -2.17.0 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0014-Add-multiple-state-signal-for-host-start-and-stop.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0014-Add-multiple-state-signal-for-host-start-and-stop.patch deleted file mode 100644 index a8d732dab..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0014-Add-multiple-state-signal-for-host-start-and-stop.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 6d0069f4a2b4637c58fd321c9db3034ac9dd17c7 Mon Sep 17 00:00:00 2001 -From: Kuiying Wang -Date: Wed, 12 Sep 2018 15:03:26 +0800 -Subject: [PATCH] Add multiple state signal for host start and stop - -Add six host state signals like following: - - name: PreHostStart - description: > - This is the signal to indicate host is at pre start stage. - - name: PostHostStart - description: > - This is the signal to indicate host is at start complete stage. - - name: HostStarting - description: > - This is the signal to indicate host is at starting stage. - - name: HostStoping - description: > - This is the signal to indicate host is at stoping stage. - - name: PreHostStop - description: > - This is the signal to indicate host is at pre stop stage. - - name: PostHostStop - description: > - This is the signal to indicate host is at stop complete stage. - -Signed-off-by: Kuiying Wang ---- - xyz/openbmc_project/State/Host.interface.yaml | 21 ++++++++++++++++++++- - 1 file changed, 20 insertions(+), 1 deletion(-) - -diff --git a/xyz/openbmc_project/State/Host.interface.yaml b/xyz/openbmc_project/State/Host.interface.yaml -index 8531a27..1ceba13 100644 ---- a/xyz/openbmc_project/State/Host.interface.yaml -+++ b/xyz/openbmc_project/State/Host.interface.yaml -@@ -96,4 +96,23 @@ enumerations: - - name: RTCWakeup - description: > - System start/restart detected and caused by system real time -- clock(RTC) wakeup. -\ No newline at end of file -+ clock(RTC) wakeup. -+signals: -+ - name: PreHostStart -+ description: > -+ This is the signal to indicate host is at pre start stage. -+ - name: PostHostStart -+ description: > -+ This is the signal to indicate host is at start complete stage. -+ - name: HostStarting -+ description: > -+ This is the signal to indicate host is at starting stage. -+ - name: HostStoping -+ description: > -+ This is the signal to indicate host is at stoping stage. -+ - name: PreHostStop -+ description: > -+ This is the signal to indicate host is at pre stop stage. -+ - name: PostHostStop -+ description: > -+ This is the signal to indicate host is at stop complete stage. --- -2.16.2 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0019-Creating-the-Session-interface-for-Host-and-LAN.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0019-Creating-the-Session-interface-for-Host-and-LAN.patch deleted file mode 100644 index 47fab819b..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0019-Creating-the-Session-interface-for-Host-and-LAN.patch +++ /dev/null @@ -1,116 +0,0 @@ -From 28fac58dc6ef975e1e9283163d9f1e4c7764c3cc Mon Sep 17 00:00:00 2001 -From: Suryakanth Sekar -Date: Sat, 2 Mar 2019 03:31:09 +0530 -Subject: [PATCH] Creating the Session interface- for Host and LAN - -Defined all needed session properites to manage the session in -host and also in LAN - -Change-Id: Ic7cccfc3333a602ee07fcd60077ec58fd8f06304 -Signed-off-by: Suryakanth Sekar - -%% original patch: 0019-Creating-the-Session-interface-for-Host-and-LAN.patch ---- - xyz/openbmc_project/Ipmi/SESSION_README.md | 25 ++++++++++ - .../Ipmi/SessionInfo.interface.yaml | 57 ++++++++++++++++++++++ - 2 files changed, 82 insertions(+) - create mode 100644 xyz/openbmc_project/Ipmi/SESSION_README.md - create mode 100644 xyz/openbmc_project/Ipmi/SessionInfo.interface.yaml - -diff --git a/xyz/openbmc_project/Ipmi/SESSION_README.md b/xyz/openbmc_project/Ipmi/SESSION_README.md -new file mode 100644 -index 0000000..c59b251 ---- /dev/null -+++ b/xyz/openbmc_project/Ipmi/SESSION_README.md -@@ -0,0 +1,25 @@ -+# Session Management -+ -+## Overview -+IPMI RMCP+ sessions are created and maintained by phosphor-ipmi-net daemon, -+whereas we need to provide details about the same using phosphor-ipmi-host. -+Hence IPMI RMCP+ session details has to be exposed through D-Bus interface, -+so that both phosphor-ipmi-host & phosphr-ipmi-net will be in sync. -+ -+ -+#### xyz.openbmc_project.Ipmi.SessionInfo interface -+##### properties -+* SessionHandle - SessionHandle,unique one-byte number to locate the session. -+* Channel - Session created channel. -+* SessionPrivilege - Privilege of the session. -+* RemoteIPAddr – Remote IP address. -+* RemotePort - Remote port address. -+* RemoteMACAddress -Remote MAC Address. -+* UserID - Session created by given user id. -+ -+ -+ -+#### xyz.openbmc_project.Object.Delete -+#### methods -+* Delete - To delete the session object in the system. -+ -diff --git a/xyz/openbmc_project/Ipmi/SessionInfo.interface.yaml b/xyz/openbmc_project/Ipmi/SessionInfo.interface.yaml -new file mode 100644 -index 0000000..d461628 ---- /dev/null -+++ b/xyz/openbmc_project/Ipmi/SessionInfo.interface.yaml -@@ -0,0 +1,57 @@ -+description: > -+ Provides properties for IPMI RMCP+ session objects. -+ Provides RMCP+ session information as session objects -+ with Session ID (unique identifier) as path suffix. -+ -+properties: -+ - name: SessionHandle -+ type: byte -+ description: > -+ Session Handle,unique number to locate the session. -+ errors: -+ - xyz.openbmc_project.Common.Error.InternalFailure -+ - name: ChannelNum -+ type: byte -+ description: > -+ channelnumber which session is created. -+ errors: -+ - xyz.openbmc_project.Common.Error.InternalFailure -+ - name: CurrentPrivilege -+ type: byte -+ description: > -+ Privilege of the session. -+ errors: -+ - xyz.openbmc_project.Common.Error.InternalFailure -+ - name: RemoteIPAddr -+ type: uint32 -+ description: > -+ Remote IP address. -+ errors: -+ - xyz.openbmc_project.Common.Error.InternalFailure -+ - name: RemotePort -+ type: uint16 -+ description: > -+ Remote IP Port. -+ errors: -+ - xyz.openbmc_project.Common.Error.InternalFailure -+ - name: RemoteMACAddress -+ type: array[byte] -+ description: > -+ Remote MAC address. -+ errors: -+ - xyz.openbmc_project.Common.Error.InternalFailure -+ - name: UserID -+ type: byte -+ description: > -+ Session created by given user ID. -+ errors: -+ - xyz.openbmc_project.Common.Error.InternalFailure -+ - name: State -+ type: byte -+ default: 0 -+ description: > -+ Session state. -+ errors: -+ - xyz.openbmc_project.Common.Error.InternalFailure -+ -+# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-Add-interface-suppot-for-provisioning-modes.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-Add-interface-suppot-for-provisioning-modes.patch deleted file mode 100644 index f6e200cab..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-Add-interface-suppot-for-provisioning-modes.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 94fb1ac5dd4d54ea5a6d49597e1f15c384be7fd6 Mon Sep 17 00:00:00 2001 -From: Richard Marian Thomaiyar -Date: Mon, 8 Apr 2019 11:48:22 +0530 -Subject: [PATCH] Add interface suppot for provisioning modes - -Support for provisioning modes are added in -RestrictionMode.interface.yaml - -Tested: -1. Verified build, and verified specified modes are available -and able to set / get the same using busctl command - -Signed-off-by: Richard Marian Thomaiyar ---- - .../Security/RestrictionMode.interface.yaml | 24 ++++++++++++++++++++++ - 1 file changed, 24 insertions(+) - -diff --git a/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml b/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml -index 8e4fd8d..d328dac 100644 ---- a/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml -+++ b/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml -@@ -21,3 +21,27 @@ enumerations: - - name: Blacklist - description: > - Prevent, if in the blacklist. -+ - name: Provisioning -+ description: > -+ Indicate that system is in provisioning mode -+ and all commands are allowed in KCS inteface -+ in both pre and post BIOS boot. -+ - name: ProvisionedKCSWhiteList -+ description: > -+ Commands in the whitelist will only be executed -+ through KCS interface after BIOS POST complete. -+ All KCS commands are supported before POST complete. -+ - name: ProvisionedKCSDisabled -+ description: > -+ Commands through KCS interface are executed only -+ till BIOS POST complete notification, after -+ which no KCS commands will be executed(other -+ than BIOS SMI based ones). -+ - name: ValidationUnsecure -+ description: > -+ To indicate that BMC is in unsecure mode, and many -+ operations which are not meant for end-user will be -+ allowed in this mode. Interface which sets this -+ property has to make sure due diligence is made -+ as in this mode, many security intrinsic commands -+ can be executed. --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-D-Bus-Intf-Security-modes-property-intf-update.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-D-Bus-Intf-Security-modes-property-intf-update.patch new file mode 100644 index 000000000..62d5376d6 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0021-D-Bus-Intf-Security-modes-property-intf-update.patch @@ -0,0 +1,80 @@ +From 9b0630f40c7fb1143901f7d114c376426cc03501 Mon Sep 17 00:00:00 2001 +From: Richard Marian Thomaiyar +Date: Sat, 15 Jun 2019 01:04:41 +0530 +Subject: [PATCH] [D-Bus Intf] Security modes property & intf update + +Defined new values for RestrictionMode property and defined +SpecialMode interfaces to handle special cases like manufacturing +and validation mode in OpenBMC. + +Note: Please refer Security mode design doc under review for more +details +https://gerrit.openbmc-project.xyz/#/c/openbmc/docs/+/21195/ + +Change-Id: I270e7d23ca2ed260f2d121e3844c2ca79150070e +Signed-off-by: Richard Marian Thomaiyar +--- + .../Security/RestrictionMode.interface.yaml | 16 +++++++++++++ + .../Control/Security/SpecialMode.interface.yaml | 26 ++++++++++++++++++++++ + 2 files changed, 42 insertions(+) + create mode 100644 xyz/openbmc_project/Control/Security/SpecialMode.interface.yaml + +diff --git a/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml b/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml +index 8e4fd8d..afd2279 100644 +--- a/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml ++++ b/xyz/openbmc_project/Control/Security/RestrictionMode.interface.yaml +@@ -21,3 +21,19 @@ enumerations: + - name: Blacklist + description: > + Prevent, if in the blacklist. ++ - name: Provisioning ++ description: > ++ Indicate that system is in provisioning mode ++ and all commands are allowed in system inteface ++ in both pre and post BIOS boot. ++ - name: ProvisionedHostWhitelist ++ description: > ++ Commands in the whitelist will only be executed ++ through system interface after BIOS POST complete. ++ All KCS commands are supported before POST complete. ++ - name: ProvisionedHostDisabled ++ description: > ++ Commands through system interface are executed only ++ till BIOS POST complete notification, after ++ which no system interface commands will be executed(other ++ than BIOS SMI based ones). +diff --git a/xyz/openbmc_project/Control/Security/SpecialMode.interface.yaml b/xyz/openbmc_project/Control/Security/SpecialMode.interface.yaml +new file mode 100644 +index 0000000..6760076 +--- /dev/null ++++ b/xyz/openbmc_project/Control/Security/SpecialMode.interface.yaml +@@ -0,0 +1,26 @@ ++description: > ++ Implement to specify a special mode of operation ++ ++properties: ++ - name: SpecialMode ++ type: enum[self.Modes] ++ description: > ++ The special mode. ++ ++enumerations: ++ - name: Modes ++ description: > ++ Possible modes available. ++ values: ++ - name: None ++ description: > ++ BMC is under normal working condition. ++ - name: Manufacturing ++ description: > ++ Indicate that BMC is in manufacturing mode ++ and is allowed to perform any manufacturing related ++ activity ++ - name: ValidationUnsecure ++ description: > ++ Indicate that BMC is in validation mode, and can ++ execute any special validation related commands +-- +2.7.4 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0023-Add-host-interrupt-to-the-Host-State.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0023-Add-host-interrupt-to-the-Host-State.patch deleted file mode 100644 index 650fd3bc9..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0023-Add-host-interrupt-to-the-Host-State.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 9c94439a5a55efbb72bee10e9cfa0827dbedf511 Mon Sep 17 00:00:00 2001 -From: "Jason M. Bills" -Date: Mon, 3 Jun 2019 16:35:46 -0700 -Subject: [PATCH] Add host interrupt to the Host State - -This adds host Interrupt as possible Transition value for the -Host State. This is to support an interrupt signal to the host -firmware or software. - -Signed-off-by: Jason M. Bills ---- - xyz/openbmc_project/State/Host.interface.yaml | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/xyz/openbmc_project/State/Host.interface.yaml b/xyz/openbmc_project/State/Host.interface.yaml -index 1ceba13..3d71280 100644 ---- a/xyz/openbmc_project/State/Host.interface.yaml -+++ b/xyz/openbmc_project/State/Host.interface.yaml -@@ -28,6 +28,9 @@ enumerations: - description: > - The desired transition for host firmware - values: -+ - name: 'Interrupt' -+ description: > -+ Host firmware should be interrupted - - name: 'Off' - description: > - Host firmware should be off --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0025-Add-PreInterruptFlag-properity-in-DBUS.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0025-Add-PreInterruptFlag-properity-in-DBUS.patch new file mode 100644 index 000000000..d7e66abd2 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces/0025-Add-PreInterruptFlag-properity-in-DBUS.patch @@ -0,0 +1,39 @@ +From b7c487750c05dcc081219ccdd4ef539beef6aa30 Mon Sep 17 00:00:00 2001 +From: Ren Yu +Date: Mon, 29 Jul 2019 10:51:12 +0800 +Subject: [PATCH] Add PreInterruptFlag properity in DBUS. + +PreTimeoutInterruptOccurFlag in DBUS would be set 'true' +when watchdog pre-timeout interrupt occurred. + +Tested: +Enable command(raw 0x06 0x31) that get message flag +can set right bit about watchdog, +need record PreTimeoutInterruptOccurFlag +at xyz.openbmmc_project.State.Watchdog when watchdog +pre-timeout interrupt occurred. + +Signed-off-by: Ren Yu +--- + xyz/openbmc_project/State/Watchdog.interface.yaml | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/xyz/openbmc_project/State/Watchdog.interface.yaml b/xyz/openbmc_project/State/Watchdog.interface.yaml +index bf4cca0..6579368 100644 +--- a/xyz/openbmc_project/State/Watchdog.interface.yaml ++++ b/xyz/openbmc_project/State/Watchdog.interface.yaml +@@ -59,6 +59,11 @@ properties: + description: > + The timer user at the time of expiration. + default: 'Reserved' ++ - name: PreTimeoutInterruptOccurFlag ++ type: boolean ++ description: > ++ PreTimeoutInterruptOccurFlag that preTimeoutInterrupt action occurred. ++ default: false + + enumerations: + - name: Action +-- +2.7.4 + 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 89b8da753..40b00e70f 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,22 +1,18 @@ SRC_URI = "git://github.com/openbmc/phosphor-dbus-interfaces.git" -SRCREV = "1f0e2ce6e1cb78a59a0015b160816b71156b03c6" +SRCREV = "ddc9e9f9d6ed0282ec6c1421a706b45f3c09ebcc" 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://0007-ipmi-set-BIOS-id.patch \ - file://0009-Add-host-restart-cause-property.patch \ file://0010-Increase-the-default-watchdog-timeout-value.patch \ file://0012-Add-RestoreDelay-interface-for-power-restore-delay.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://0018-Define-post-code-interfaces-for-post-code-manager.patch \ - file://0019-Creating-the-Session-interface-for-Host-and-LAN.patch \ - file://0021-Add-interface-suppot-for-provisioning-modes.patch \ + file://0021-D-Bus-Intf-Security-modes-property-intf-update.patch \ file://0022-Add-chassis-power-cycle-and-reset-to-Chassis-State.patch \ - file://0023-Add-host-interrupt-to-the-Host-State.patch \ file://0024-Add-the-pre-timeout-interrupt-defined-in-IPMI-spec.patch \ + file://0025-Add-PreInterruptFlag-properity-in-DBUS.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 e8baaa23e..0e80b554a 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,7 +1,7 @@ [Unit] Description=Phosphor-Pid-Control Margin-based Fan Control Daemon -After=xyz.openbmc_project.EntityManager -After=xyz.openbmc_project.ObjectMapper +After=xyz.openbmc_project.EntityManager.service +After=xyz.openbmc_project.ObjectMapper.service [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 e1ec04ff6..30044eb6e 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 = "1dad21b935b8359806de9a9cc3aa7b7463cc8df3" +SRCREV = "a7ec8350d17b70153cebe666d3fbe88bddd02a1a" FILES_${PN} = "${bindir}/swampd ${bindir}/setsensor" 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 719c2562a..2efe911ae 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,8 +3,6 @@ EXTRA_OECONF += "--enable-fwupd_script" SYSTEMD_SERVICE_${PN}-updater += "fwupd@.service" -#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 \ diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/gpiodaemon/gpiodaemon.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/gpiodaemon/gpiodaemon.bb deleted file mode 100644 index cef2fdcaa..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/gpiodaemon/gpiodaemon.bb +++ /dev/null @@ -1,18 +0,0 @@ -SUMMARY = "Gpio daemon service for handling gpio operations" -DESCRIPTION = "Daemon allows to block gpio access under certain conditions" - -PV = "1.0+git${SRCPV}" - -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" - -SRCREV = "4373d99e1edcbb4c7233abde3a5e53690693007b" - -inherit cmake systemd -SYSTEMD_SERVICE_${PN} = "gpiodaemon.service" - -DEPENDS = "boost systemd sdbusplus phosphor-logging" 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 3f870103b..8d13272bb 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 = "fa1a5a38551bd1b9f04ad2d4f9fea2e5ade5cc4c" +SRCREV = "2c0feb0085ac3cc11c6fd77df7a8c7701f38fea5" 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 c2f3c9a0e..92731f439 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 @@ -22,13 +22,13 @@ } }, "2" : { - "name" : "eth2", - "is_valid" : true, + "name" : "RESERVED", + "is_valid" : false, "active_sessions" : 0, "channel_info" : { - "medium_type" : "lan-802.3", - "protocol_type" : "ipmb-1.0", - "session_supported" : "multi-session", + "medium_type" : "reserved", + "protocol_type" : "na", + "session_supported" : "session-less", "is_ipmi" : true } }, diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Modify-dbus-interface-for-power-control.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Modify-dbus-interface-for-power-control.patch deleted file mode 100644 index 236bd18f4..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Modify-dbus-interface-for-power-control.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 39df500f277eca01d6a0538d4db8ec34894d9441 Mon Sep 17 00:00:00 2001 -From: Yong Li -Date: Mon, 17 Sep 2018 12:59:12 +0800 -Subject: [PATCH] Modify dbus interface for power control - -Switch power control service namespace from "org" to "xyz", -to compatible with new intel-chassis services - -Signed-off-by: Yong Li ---- - chassishandler.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/chassishandler.cpp b/chassishandler.cpp -index 6002e7a..0e83bba 100644 ---- a/chassishandler.cpp -+++ b/chassishandler.cpp -@@ -786,8 +786,8 @@ ipmi_ret_t ipmi_get_chassis_status(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - ipmi_data_len_t data_len, - ipmi_context_t context) - { -- const char* objname = "/org/openbmc/control/power0"; -- const char* intf = "org.openbmc.control.Power"; -+ const char* objname = "/xyz/openbmc_project/Chassis/Control/Power0"; -+ const char* intf = "xyz.openbmc_project.Chassis.Control.Power"; - - sd_bus* bus = NULL; - sd_bus_message* reply = NULL; --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0010-fix-get-system-GUID-ipmi-command.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0010-fix-get-system-GUID-ipmi-command.patch index c1ec6ac6e..efee7cc26 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0010-fix-get-system-GUID-ipmi-command.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0010-fix-get-system-GUID-ipmi-command.patch @@ -1,56 +1,36 @@ -From 4953a9f2233fd24a28da84443cea6aebecd14fbc Mon Sep 17 00:00:00 2001 -From: Yong Li -Date: Mon, 17 Sep 2018 13:20:54 +0800 -Subject: [PATCH] fix "get system GUID" ipmi command +commit 72e6573f36fd3b9ce018e71b07bc1be63275d1f8 +Author: Vernon Mauery +Date: Fri Jun 21 12:27:20 2019 -0700 -Change-Id: I15c71607c24ad8b3e2c9065a5470002ecb1761bb -Signed-off-by: Jia, Chunhui -Signed-off-by: Yong Li ---- - apphandler.cpp | 7 ++----- - host-ipmid-whitelist.conf | 1 + - 2 files changed, 3 insertions(+), 5 deletions(-) + Fix 'Get System GUID' to use settings UUID + + The upstream Get System GUID command looks first for a BMC interface + and then assumes that the UUID interface is next to that. But that is + not the case on Intel systems where the system GUID is found in the + settings daemon. + + Change-Id: I924bd05e0a546f2b30288c1faf72157296ab6579 + Signed-off-by: Vernon Mauery diff --git a/apphandler.cpp b/apphandler.cpp -index f2889c5..9149373 100644 +index 280d0db..25af6bb 100644 --- a/apphandler.cpp +++ b/apphandler.cpp -@@ -48,7 +48,7 @@ extern sd_bus* bus; - - constexpr auto bmc_state_interface = "xyz.openbmc_project.State.BMC"; - constexpr auto bmc_state_property = "CurrentBMCState"; --constexpr auto bmc_interface = "xyz.openbmc_project.Inventory.Item.Bmc"; -+// phosphor-setting-manager is the unique service that holds this interface - constexpr auto bmc_guid_interface = "xyz.openbmc_project.Common.UUID"; - constexpr auto bmc_guid_property = "UUID"; - constexpr auto bmc_guid_len = 16; -@@ -546,8 +545,7 @@ ipmi_ret_t ipmi_app_get_sys_guid(ipmi_netfn_t netfn, ipmi_cmd_t cmd, +@@ -799,8 +799,6 @@ auto ipmiAppGetBtCapabilities() + + auto ipmiAppGetSystemGuid() -> ipmi::RspType> + { +- static constexpr auto bmcInterface = +- "xyz.openbmc_project.Inventory.Item.Bmc"; + static constexpr auto uuidInterface = "xyz.openbmc_project.Common.UUID"; + static constexpr auto uuidProperty = "UUID"; + +@@ -809,7 +807,7 @@ auto ipmiAppGetSystemGuid() -> ipmi::RspType> { // Get the Inventory object implementing BMC interface - ipmi::DbusObjectInfo bmcObject = -- ipmi::getDbusObject(bus, bmc_interface); -- -+ ipmi::getDbusObject(bus, bmc_guid_interface); + auto busPtr = getSdBus(); +- auto objectInfo = ipmi::getDbusObject(*busPtr, bmcInterface); ++ auto objectInfo = ipmi::getDbusObject(*busPtr, uuidInterface); + // Read UUID property value from bmcObject // UUID is in RFC4122 format Ex: 61a39523-78f2-11e5-9862-e6402cfc3223 - auto variant = -@@ -591,7 +589,6 @@ ipmi_ret_t ipmi_app_get_sys_guid(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - catch (const InternalFailure& e) - { - log("Failed in reading BMC UUID property", -- entry("INTERFACE=%s", bmc_interface), - entry("PROPERTY_INTERFACE=%s", bmc_guid_interface), - entry("PROPERTY=%s", bmc_guid_property)); - return IPMI_CC_UNSPECIFIED_ERROR; -diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf -index 2c37ac9..164edbe 100644 ---- a/host-ipmid-whitelist.conf -+++ b/host-ipmid-whitelist.conf -@@ -40,3 +40,4 @@ - 0x2C:0x06 //: - 0x2C:0x07 //: - 0x2C:0x10 //: -+0x30:0x41 //: --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0013-ipmi-add-set-bios-id-to-whitelist.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0013-ipmi-add-set-bios-id-to-whitelist.patch index ae10ab60a..396d2e949 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0013-ipmi-add-set-bios-id-to-whitelist.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0013-ipmi-add-set-bios-id-to-whitelist.patch @@ -10,16 +10,13 @@ Signed-off-by: Jia, Chunhui host-ipmid-whitelist.conf | 2 ++ 1 file changed, 2 insertions(+) -diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf -index 164edbe..db54a49 100644 ---- a/host-ipmid-whitelist.conf -+++ b/host-ipmid-whitelist.conf -@@ -41,3 +41,5 @@ +Index: phosphor-host-ipmid/host-ipmid-whitelist.conf +=================================================================== +--- phosphor-host-ipmid.orig/host-ipmid-whitelist.conf ++++ phosphor-host-ipmid/host-ipmid-whitelist.conf +@@ -47,3 +47,5 @@ + 0x2C:0x06 //: 0x2C:0x07 //: 0x2C:0x10 //: - 0x30:0x41 //: +0x30:0x26 //: +0x30:0x27 //: --- -2.16.2 - 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 deleted file mode 100644 index cba0cde32..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0021-Implement-IPMI-Commmand-Get-Host-Restart-Cause.patch +++ /dev/null @@ -1,143 +0,0 @@ -From 6d5a372e0cf98de4d97a88d2cd42a00b7a8f034f Mon Sep 17 00:00:00 2001 -From: Yong Li -Date: Sun, 16 Sep 2018 21:32:38 +0800 -Subject: [PATCH] Implement IPMI Commmand - Get Host Restart Cause. - -It supports to track the information about what -action last caused the system to restart. -Return value includes: restart_cause and channel_number. - -According to IPMI Spec, it includes 12 types as following: -1. Unknown 0x0 -2. IpmiCommand 0x1 -3. ResetButton 0x2 -4. PowerButton 0x3 -5. WatchdogTimer 0x4 -6. OEM 0x5 -7. PowerPolicyAlwaysOn 0x6 -8. PowerPolicyPreviousState 0x7 -9. PEF-Reset 0x8 -10. PEF-PowerCycle 0x9 -11. SoftReset 0xA -12. RTC-Wakeup 0xB - -Change-Id: Id3b32e271b85b5fc4c69d5ca40227f8f9c08ce48 -Signed-off-by: Kuiying Wang -Signed-off-by: Yong Li ---- - 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 d20b220..8a8cb26 100644 ---- a/chassishandler.cpp -+++ b/chassishandler.cpp -@@ -90,6 +90,11 @@ static constexpr auto chassisPOHStateIntf = - "xyz.openbmc_project.State.PowerOnHours"; - static constexpr auto pOHCounterProperty = "POHCounter"; - static constexpr auto match = "chassis0"; -+const static constexpr char* stateHostInterface = -+ "xyz.openbmc_project.State.Host"; -+const static constexpr char* hostRestartCauseInterface = -+ "xyz.openbmc_project.State.Host.HostRestartCause"; -+const static constexpr char* hostRestartCause = "HostRestartCause"; - const static constexpr char chassisCapIntf[] = - "xyz.openbmc_project.Control.ChassisCapabilities"; - const static constexpr char chassisCapFlagsProp[] = "CapabilitiesFlags"; -@@ -176,6 +181,13 @@ struct set_sys_boot_options_t - uint8_t data[SIZE_BOOT_OPTION]; - } __attribute__((packed)); - -+struct GetSysRestartCauseResponse -+{ -+ uint8_t restartCause; -+ uint8_t channelNum; -+ -+} __attribute__((packed)); -+ - int getHostNetworkData(get_sys_boot_options_response_t* respptr) - { - ipmi::PropertyMap properties; -@@ -1584,6 +1596,44 @@ ipmi_ret_t ipmi_chassis_set_sys_boot_options(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - return rc; - } - -+ipmi_ret_t ipmi_chassis_get_sys_restart_cause( -+ 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) -+{ -+ ipmi_ret_t rc = IPMI_CC_OK; -+ -+ GetSysRestartCauseResponse* resp = (GetSysRestartCauseResponse*)response; -+ std::fill(reinterpret_cast(resp), -+ reinterpret_cast(resp) + sizeof(*resp), 0); -+ if (*data_len != 0) -+ { -+ rc = IPMI_CC_REQ_DATA_LEN_INVALID; -+ return rc; -+ } -+ -+ try -+ { -+ sdbusplus::bus::bus bus{ipmid_get_sd_bus_connection()}; -+ ipmi::DbusObjectInfo hostObject = -+ ipmi::getDbusObject(bus, stateHostInterface); -+ ipmi::Value variant = -+ ipmi::getDbusProperty(bus, hostObject.second, hostObject.first, -+ hostRestartCauseInterface, hostRestartCause); -+ resp->restartCause = variant.get(); -+ } -+ -+ catch (std::exception& e) -+ { -+ log(e.what()); -+ rc = IPMI_CC_UNSPECIFIED_ERROR; -+ return rc; -+ } -+ resp->channelNum = 0; // Fix to primary channel. -+ *data_len = sizeof(GetSysRestartCauseResponse); -+ -+ return rc; -+} -+ - /** @brief implements Get POH counter command - * @parameter - * - none -@@ -1739,4 +1789,8 @@ void register_netfn_chassis_functions() - ipmi::chassis::cmdSetPowerRestorePolicy, - ipmi::Privilege::Operator, - ipmiChassisSetPowerRestorePolicy); -+ -+ // -+ 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 49b5ef8..2c42b11 100644 ---- a/chassishandler.hpp -+++ b/chassishandler.hpp -@@ -17,6 +17,7 @@ enum ipmi_netfn_chassis_cmds - // Set Power Restore Policy - IPMI_CMD_SET_RESTORE_POLICY = 0x06, - // 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_GET_POH_COUNTER = 0x0F, -diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf -index c1fca1d..94232de 100644 ---- a/host-ipmid-whitelist.conf -+++ b/host-ipmid-whitelist.conf -@@ -4,6 +4,7 @@ - 0x00:0x02 //: - 0x00:0x05 //: - 0x00:0x06 //: -+0x00:0x07 //: - 0x00:0x08 //: - 0x00:0x09 //: - 0x00:0x0F //: --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch deleted file mode 100644 index aba5eb095..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0049-Fix-Unspecified-error-on-ipmi-restart-cause-command.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 59287a8869b5253a1b4203e0cc8a92f063dcc7e6 Mon Sep 17 00:00:00 2001 -From: Yong Li -Date: Tue, 25 Sep 2018 16:08:22 +0800 -Subject: [PATCH] Fix "Unspecified error" on ipmi restart cause command - -Needs to convert the dbus value(enum) into ipmi value(uint8) - -Tested by: -ipmitool chassis restart_cause - -Signed-off-by: Yong Li ---- - chassishandler.cpp | 28 ++++++++++++++++++++++++++-- - 1 file changed, 26 insertions(+), 2 deletions(-) - -diff --git a/chassishandler.cpp b/chassishandler.cpp -index 40eb4f5..c3d4931 100644 ---- a/chassishandler.cpp -+++ b/chassishandler.cpp -@@ -106,7 +106,7 @@ static constexpr auto match = "chassis0"; - const static constexpr char* stateHostInterface = - "xyz.openbmc_project.State.Host"; - const static constexpr char* hostRestartCauseInterface = -- "xyz.openbmc_project.State.Host.HostRestartCause"; -+ "xyz.openbmc_project.State.Host"; - const static constexpr char* hostRestartCause = "HostRestartCause"; - const static constexpr char chassisCapIntf[] = - "xyz.openbmc_project.Control.ChassisCapabilities"; -@@ -1764,6 +1764,26 @@ ipmi_ret_t ipmi_chassis_set_sys_boot_options(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - return rc; - } - -+namespace restart_cause -+{ -+ -+using namespace sdbusplus::xyz::openbmc_project::State::server; -+ -+std::map dbusToIpmi = { -+ {Host::RestartCause::Unknown, 0x0}, -+ {Host::RestartCause::IpmiCommand, 0x1}, -+ {Host::RestartCause::ResetButton, 0x2}, -+ {Host::RestartCause::PowerButton, 0x3}, -+ {Host::RestartCause::WatchdogTimer, 0x4}, -+ {Host::RestartCause::OEM, 0x5}, -+ {Host::RestartCause::PowerPolicyAlwaysOn, 0x6}, -+ {Host::RestartCause::PowerPolicyPreviousState, 0x7}, -+ {Host::RestartCause::PEFReset, 0x8}, -+ {Host::RestartCause::PEFPowerCycle, 0x9}, -+ {Host::RestartCause::SoftReset, 0xa}, -+ {Host::RestartCause::RTCWakeup, 0xb}}; -+} // namespace restart_cause -+ - ipmi_ret_t ipmi_chassis_get_sys_restart_cause( - 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) -@@ -1787,7 +1807,11 @@ ipmi_ret_t ipmi_chassis_get_sys_restart_cause( - ipmi::Value variant = - ipmi::getDbusProperty(bus, hostObject.second, hostObject.first, - hostRestartCauseInterface, hostRestartCause); -- resp->restartCause = variant.get(); -+ -+ std::string restartCause = -+ sdbusplus::message::variant_ns::get(variant); -+ resp->restartCause = restart_cause::dbusToIpmi.at( -+ restart_cause::Host::convertRestartCauseFromString(restartCause)); - } - - catch (std::exception& e) --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0055-Implement-set-front-panel-button-enables-command.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0055-Implement-set-front-panel-button-enables-command.patch deleted file mode 100644 index fd7cf1851..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0055-Implement-set-front-panel-button-enables-command.patch +++ /dev/null @@ -1,176 +0,0 @@ -From b8b88a5c0f9e9cb6023cb8d5453e5cfadaa1a375 Mon Sep 17 00:00:00 2001 -From: Kuiying Wang -Date: Fri, 4 Jan 2019 10:50:21 +0800 -Subject: [PATCH] Implement set front panel button enables command - -Through modify buttons' property "Enabled" to disable/enable -corresponding button. -Currently support power and reset button. - -Test-By: ipmitool raw 0x0 0xa 0x2 //disable reset button - ipmitool raw 0x0 0xa 0x1 //disable power button - ipmitool raw 0x0 0xa 0x0 //enable all buttons - -Change-Id: Ice6f58edb898689f7a7fa08ad078d25fccaab27e -Signed-off-by: Kuiying Wang ---- - chassishandler.cpp | 98 +++++++++++++++++++++++++++++++++++++++ - chassishandler.hpp | 1 + - host-ipmid-whitelist.conf | 1 + - 3 files changed, 100 insertions(+) - -diff --git a/chassishandler.cpp b/chassishandler.cpp -index 4b42b3c..1a5b805 100644 ---- a/chassishandler.cpp -+++ b/chassishandler.cpp -@@ -112,6 +112,8 @@ const static constexpr char chassisSMDevAddrProp[] = "SMDeviceAddress"; - const static constexpr char chassisBridgeDevAddrProp[] = "BridgeDeviceAddress"; - static constexpr uint8_t chassisCapFlagMask = 0x0f; - static constexpr uint8_t chassisCapAddrMask = 0xfe; -+static constexpr uint8_t disableResetButton = 0x2; -+static constexpr uint8_t disablePowerButton = 0x1; - static constexpr const char* powerButtonIntf = - "xyz.openbmc_project.Chassis.Buttons.Power"; - static constexpr const char* powerButtonPath = -@@ -140,6 +142,19 @@ struct GetPOHCountResponse - uint8_t front_panel_button_cap_status; - } __attribute__((packed)) ipmi_get_chassis_status_t; - -+typedef struct -+{ -+ uint8_t disables; // Front Panel Button Enables -+ //[7:4] - reserved -+ //[3] - 1b = disable Standby (sleep) button for entering standby (sleep) -+ //(control can still be used to wake the system) -+ //[2] - 1b = disable Diagnostic Interrupt button -+ //[1] - 1b = disable Reset button -+ //[0] - 1b = disable Power off button for power off only (in the case there -+ // is a single combined power/standby (sleep) button, then this also -+ // disables sleep requests via that button) -+} __attribute__((packed)) IPMISetFrontPanelButtonEnablesReq; -+ - // Phosphor Host State manager - namespace State = sdbusplus::xyz::openbmc_project::State::server; - -@@ -1721,6 +1738,82 @@ ipmi_ret_t ipmi_chassis_set_power_restore_policy( - return ipmi::responseSuccess(power_policy::allSupport); - } - -+ipmi_ret_t ipmiSetFrontPanelButtonEnables(ipmi_netfn_t netfn, ipmi_cmd_t cmd, -+ ipmi_request_t request, -+ ipmi_response_t response, -+ ipmi_data_len_t data_len, -+ ipmi_context_t context) -+{ -+ bool enable = false; -+ constexpr const char* powerButtonIntf = -+ "xyz.openbmc_project.Chassis.Buttons.Power"; -+ constexpr const char* powerButtonPath = -+ "/xyz/openbmc_project/Chassis/Buttons/Power0"; -+ constexpr const char* resetButtonIntf = -+ "xyz.openbmc_project.Chassis.Buttons.Reset"; -+ constexpr const char* resetButtonPath = -+ "/xyz/openbmc_project/Chassis/Buttons/Reset0"; -+ using namespace chassis::internal; -+ -+ IPMISetFrontPanelButtonEnablesReq* req = -+ static_cast(request); -+ if (*data_len != 1) -+ { -+ *data_len = 0; -+ log("IPMI request len is invalid"); -+ return IPMI_CC_REQ_DATA_LEN_INVALID; -+ } -+ *data_len = 0; -+ if (req->disables & disablePowerButton) -+ { -+ // Disable power button -+ enable = false; -+ } -+ else -+ { -+ // Enable power button -+ enable = true; -+ } -+ // set power button Enabled property -+ try -+ { -+ auto service = ipmi::getService(dbus, powerButtonIntf, powerButtonPath); -+ ipmi::setDbusProperty(dbus, service, powerButtonPath, powerButtonIntf, -+ "Enabled", enable); -+ } -+ catch (sdbusplus::exception::SdBusError& e) -+ { -+ log(e.what()); -+ log("Fail to set power button Enabled property"); -+ return IPMI_CC_UNSPECIFIED_ERROR; -+ } -+ -+ if (req->disables & disableResetButton) -+ { -+ // disable reset button -+ enable = false; -+ } -+ else -+ { -+ // enable reset button -+ enable = true; -+ } -+ // set reset button Enabled property -+ try -+ { -+ auto service = ipmi::getService(dbus, resetButtonIntf, resetButtonPath); -+ ipmi::setDbusProperty(dbus, service, resetButtonPath, resetButtonIntf, -+ "Enabled", enable); -+ } -+ catch (sdbusplus::exception::SdBusError& e) -+ { -+ log(e.what()); -+ log("Fail to set reset button Enabled property"); -+ return IPMI_CC_UNSPECIFIED_ERROR; -+ } -+ return IPMI_CC_OK; -+} -+ - void register_netfn_chassis_functions() - { - createIdentifyTimer(); -@@ -1733,6 +1826,11 @@ void register_netfn_chassis_functions() - ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_GET_CHASSIS_CAP, NULL, - ipmi_get_chassis_cap, PRIVILEGE_USER); - -+ // Set Front Panel Button Enables -+ ipmi_register_callback(NETFUN_CHASSIS, -+ IPMI_CMD_SET_FRONT_PANEL_BUTTON_ENABLES, NULL, -+ ipmiSetFrontPanelButtonEnables, PRIVILEGE_ADMIN); -+ - // Set Chassis Capabilities - ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_SET_CHASSIS_CAP, NULL, - ipmi_set_chassis_cap, PRIVILEGE_USER); -diff --git a/chassishandler.hpp b/chassishandler.hpp -index 49b5ef8..f4a6bff 100644 ---- a/chassishandler.hpp -+++ b/chassishandler.hpp -@@ -19,6 +19,7 @@ enum ipmi_netfn_chassis_cmds - 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, - IPMI_CMD_GET_POH_COUNTER = 0x0F, - }; - -diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf -index e5cd0b5..d96d9ed 100644 ---- a/host-ipmid-whitelist.conf -+++ b/host-ipmid-whitelist.conf -@@ -6,6 +6,7 @@ - 0x00:0x07 //: - 0x00:0x08 //: - 0x00:0x09 //: -+0x00:0x0A //: - 0x00:0x0F //: - 0x04:0x02 //: - 0x04:0x2D //: --- -2.19.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0058-Add-AC-failed-bit-support-for-get-chassis-status-com.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0058-Add-AC-failed-bit-support-for-get-chassis-status-com.patch deleted file mode 100644 index 42bb682c4..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0058-Add-AC-failed-bit-support-for-get-chassis-status-com.patch +++ /dev/null @@ -1,76 +0,0 @@ -From f51bef8f7c5785405ee5c83a921efb1bc05e4947 Mon Sep 17 00:00:00 2001 -From: Yong Li -Date: Wed, 27 Mar 2019 16:11:25 +0800 -Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=9CAC=20failed=E2=80=9D=20bit=20sup?= - =?UTF-8?q?port=20for=20get=20chassis=20status=20command?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -PFail property is provided by power control service, -ture means the booting is from AC loss. - -Tested: -Remove the AC cable and reconnect it -Ipmitool chassis status to check the status: -Last Power Event : ac-failed - -Signed-off-by: Yong Li ---- - chassishandler.cpp | 26 ++++++++++++++++++++++++++ - 1 file changed, 26 insertions(+) - -diff --git a/chassishandler.cpp b/chassishandler.cpp -index 7a522ad..40d2018 100644 ---- a/chassishandler.cpp -+++ b/chassishandler.cpp -@@ -844,6 +844,7 @@ ipmi_ret_t ipmi_get_chassis_status(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - sd_bus_message* reply = NULL; - int r = 0; - int pgood = 0; -+ bool pFail = true; - char* busname = NULL; - ipmi_ret_t rc = IPMI_CC_OK; - ipmi_get_chassis_status_t chassis_status{}; -@@ -904,6 +905,26 @@ ipmi_ret_t ipmi_get_chassis_status(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - goto finish; - } - -+ r = sd_bus_get_property(bus, busname, objname, intf, "PFail", NULL, &reply, -+ "b"); -+ if (r < 0) -+ { -+ log("Failed to call sd_bus_get_property", -+ entry("PROPERTY=%s", "PFail"), entry("ERRNO=0x%X", -r), -+ entry("BUS=%s", busname), entry("PATH=%s", objname), -+ entry("INTERFACE=%s", intf)); -+ rc = IPMI_CC_UNSPECIFIED_ERROR; -+ goto finish; -+ } -+ -+ r = sd_bus_message_read(reply, "b", &pFail); -+ if (r < 0) -+ { -+ log("Failed to read PFail:", entry("ERRNO=0x%X", -r)); -+ rc = IPMI_CC_UNSPECIFIED_ERROR; -+ goto finish; -+ } -+ - s = dbusToIpmi.at(powerRestore); - - // Current Power State -@@ -952,6 +973,11 @@ ipmi_ret_t ipmi_get_chassis_status(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - - chassis_status.last_power_event = 0; - -+ if (pFail) -+ { -+ chassis_status.last_power_event |= 1; -+ } -+ - // Misc. Chassis State - // [7] – reserved - // [6] – 1b = Chassis Identify command and state info supported (Optional) --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0059-Move-Set-SOL-config-parameter-to-host-ipmid.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0059-Move-Set-SOL-config-parameter-to-host-ipmid.patch index 1dc55e2f4..5623d246d 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0059-Move-Set-SOL-config-parameter-to-host-ipmid.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0059-Move-Set-SOL-config-parameter-to-host-ipmid.patch @@ -1,6 +1,6 @@ -From 1c15df9d82254286d0773086836767f23711c5d9 Mon Sep 17 00:00:00 2001 +From 55db62a92dff4bfc3d34c590b33d9da4e7706b9d Mon Sep 17 00:00:00 2001 From: Cheng C Yang -Date: Tue, 2 Apr 2019 00:34:34 +0800 +Date: Wed, 3 Jul 2019 06:12:55 +0800 Subject: [PATCH] Move Set SOL config parameter to host-ipmid Move Set SOL config parameter command from net-ipmid to host-ipmid, @@ -23,16 +23,15 @@ to 0 and other properties will not reset to default value. Signed-off-by: Cheng C Yang --- host-ipmid-whitelist.conf | 1 + - include/ipmid/api.h | 1 + - transporthandler.cpp | 222 ++++++++++++++++++++++++++++++++++++++ - transporthandler.hpp | 97 +++++++++++++++++ - 4 files changed, 321 insertions(+) + transporthandler.cpp | 289 ++++++++++++++++++++++++++++++++++++++++++++++ + transporthandler.hpp | 33 ++++++ + 3 files changed, 323 insertions(+) diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf -index 2a83347..544b766 100644 +index 2b72d23..856588e 100644 --- a/host-ipmid-whitelist.conf +++ b/host-ipmid-whitelist.conf -@@ -41,6 +41,7 @@ +@@ -42,6 +42,7 @@ 0x0A:0x48 //: 0x0A:0x49 //: 0x0C:0x02 //: @@ -40,20 +39,8 @@ index 2a83347..544b766 100644 0x2C:0x00 //: 0x2C:0x01 //: 0x2C:0x02 //: -diff --git a/include/ipmid/api.h b/include/ipmid/api.h -index f08ee11..2f366b4 100644 ---- a/include/ipmid/api.h -+++ b/include/ipmid/api.h -@@ -113,6 +113,7 @@ enum ipmi_return_codes - IPMI_DCMI_CC_NO_ACTIVE_POWER_LIMIT = 0x80, - IPMI_WDOG_CC_NOT_INIT = 0x80, - IPMI_CC_SYSTEM_INFO_PARAMETER_NOT_SUPPORTED = 0x80, -+ IPMI_CC_SET_IN_PROGRESS_ACTIVE = 0x81, - IPMI_CC_SYSTEM_INFO_PARAMETER_SET_READ_ONLY = 0x82, - IPMI_CC_BUSY = 0xC0, - IPMI_CC_INVALID = 0xC1, diff --git a/transporthandler.cpp b/transporthandler.cpp -index 8f18b76..a693279 100644 +index bb624c4..25062ae 100644 --- a/transporthandler.cpp +++ b/transporthandler.cpp @@ -36,6 +36,9 @@ static const std::array ipAddressEnablesType = { @@ -61,37 +48,57 @@ index 8f18b76..a693279 100644 "xyz.openbmc_project.Network.EthernetInterface.IPAllowed.IPv4AndIPv6"}; +constexpr const char* solInterface = "xyz.openbmc_project.Ipmi.SOL"; -+constexpr const char* solPath = "/xyz/openbmc_project/ipmi/sol"; ++constexpr const char* solPath = "/xyz/openbmc_project/ipmi/sol/"; + std::map> channelConfig; using namespace phosphor::logging; -@@ -1633,6 +1636,219 @@ void createNetworkTimer() +@@ -1631,6 +1634,285 @@ void createNetworkTimer() } } -+static int setSOLParameter(std::string property, const ipmi::Value& value) ++static std::string ++ getSOLService(std::shared_ptr dbus, ++ const std::string& solPathWitheEthName) +{ -+ auto dbus = getSdBus(); -+ + static std::string solService{}; + if (solService.empty()) + { + try + { -+ solService = ipmi::getService(*dbus, solInterface, solPath); ++ solService = ++ ipmi::getService(*dbus, solInterface, solPathWitheEthName); + } + catch (const sdbusplus::exception::SdBusError& e) + { + solService.clear(); + phosphor::logging::log( + "Error: get SOL service failed"); -+ return -1; ++ return solService; + } + } ++ return solService; ++} ++ ++static int setSOLParameter(const std::string& property, ++ const ipmi::Value& value, const uint8_t& channelNum) ++{ ++ auto dbus = getSdBus(); ++ ++ std::string ethdevice = ipmi::getChannelName(channelNum); ++ ++ std::string solPathWitheEthName = std::string(solPath) + ethdevice; ++ ++ std::string service = getSOLService(dbus, solPathWitheEthName); ++ if (service.empty()) ++ { ++ phosphor::logging::log( ++ "Unable to get SOL service failed"); ++ return -1; ++ } + try + { -+ ipmi::setDbusProperty(*dbus, solService, solPath, solInterface, ++ ipmi::setDbusProperty(*dbus, service, solPathWitheEthName, solInterface, + property, value); + } + catch (sdbusplus::exception_t&) @@ -104,29 +111,26 @@ index 8f18b76..a693279 100644 + return 0; +} + -+static int getSOLParameter(std::string property, ipmi::Value& value) ++static int getSOLParameter(const std::string& property, ipmi::Value& value, ++ const uint8_t& channelNum) +{ + auto dbus = getSdBus(); + -+ static std::string solService{}; -+ if (solService.empty()) ++ std::string ethdevice = ipmi::getChannelName(channelNum); ++ ++ std::string solPathWitheEthName = std::string(solPath) + ethdevice; ++ ++ std::string service = getSOLService(dbus, solPathWitheEthName); ++ if (service.empty()) + { -+ try -+ { -+ solService = ipmi::getService(*dbus, solInterface, solPath); -+ } -+ catch (const sdbusplus::exception::SdBusError& e) -+ { -+ solService.clear(); -+ phosphor::logging::log( -+ "Error: get SOL service failed"); -+ return -1; -+ } ++ phosphor::logging::log( ++ "Unable to get SOL service failed"); ++ return -1; + } + try + { -+ value = ipmi::getDbusProperty(*dbus, solService, solPath, solInterface, -+ property); ++ value = ipmi::getDbusProperty(*dbus, service, solPathWitheEthName, ++ solInterface, property); + } + catch (sdbusplus::exception_t&) + { @@ -140,158 +144,208 @@ index 8f18b76..a693279 100644 + +void initializeSOLInProgress() +{ -+ if (setSOLParameter("Progress", static_cast(0)) < 0) ++ ipmi::ChannelInfo chInfo; ++ for (int chNum = 0; chNum < ipmi::maxIpmiChannels; chNum++) + { -+ phosphor::logging::log( -+ "Error initialize sol progress"); ++ if (!ipmi::isValidChannel(static_cast(chNum))) ++ { ++ continue; ++ } ++ ipmi_ret_t compCode = ++ ipmi::getChannelInfo(static_cast(chNum), chInfo); ++ if (compCode != IPMI_CC_OK || ++ chInfo.mediumType != ++ static_cast(ipmi::EChannelMediumType::lan8032)) ++ { ++ continue; ++ } ++ if (setSOLParameter("Progress", static_cast(0), chNum) < 0) ++ { ++ phosphor::logging::log( ++ "Error initialize sol progress"); ++ } + } +} + -+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 encryptMask = 0x80; ++static const constexpr uint8_t encryptShift = 7; ++static const constexpr uint8_t authMask = 0x40; ++static const constexpr uint8_t authShift = 6; ++static const constexpr uint8_t privilegeMask = 0xf; ++ ++namespace ipmi ++{ ++constexpr Cc ccParmNotSupported = 0x80; ++constexpr Cc ccSetInProgressActive = 0x81; ++constexpr Cc ccSystemInfoParameterSetReadOnly = 0x82; ++ ++static inline auto responseParmNotSupported() +{ -+ auto reqData = reinterpret_cast(request); ++ return response(ccParmNotSupported); ++} ++static inline auto responseSetInProgressActive() ++{ ++ return response(ccSetInProgressActive); ++} ++static inline auto responseSystemInfoParameterSetReadOnly() ++{ ++ return response(ccSystemInfoParameterSetReadOnly); ++} + -+ // Check request length first -+ switch (static_cast(reqData->paramSelector)) ++} // namespace ipmi ++ ++ipmi::RspType<> setSOLConfParams(ipmi::Context::ptr ctx, uint4_t chNum, ++ uint4_t reserved, uint8_t paramSelector, ++ uint8_t configParamData1, ++ std::optional configParamData2) ++{ ++ ipmi::ChannelInfo chInfo; ++ uint8_t channelNum = ipmi::convertCurrentChannelNum( ++ static_cast(chNum), ctx->channel); ++ if (reserved != 0 || ++ (!ipmi::isValidChannel(static_cast(channelNum)))) + { -+ case sol::Parameter::progress: -+ case sol::Parameter::enable: -+ case sol::Parameter::authentication: -+ { -+ if (*dataLen != sizeof(SetConfParamsRequest) - 1) -+ { -+ *dataLen = 0; -+ return IPMI_CC_REQ_DATA_LEN_INVALID; -+ } -+ break; -+ } -+ case sol::Parameter::accumulate: -+ case sol::Parameter::retry: -+ { -+ if (*dataLen != sizeof(SetConfParamsRequest)) -+ { -+ *dataLen = 0; -+ return IPMI_CC_REQ_DATA_LEN_INVALID; -+ } -+ break; -+ } -+ default: -+ break; ++ return ipmi::responseInvalidFieldRequest(); + } + -+ *dataLen = 0; ++ ipmi_ret_t compCode = ++ ipmi::getChannelInfo(static_cast(channelNum), chInfo); ++ if (compCode != IPMI_CC_OK || ++ chInfo.mediumType != ++ static_cast(ipmi::EChannelMediumType::lan8032)) ++ { ++ return ipmi::responseInvalidFieldRequest(); ++ } + -+ switch (static_cast(reqData->paramSelector)) ++ switch (static_cast(paramSelector)) + { + case sol::Parameter::progress: + { -+ uint8_t progress = reqData->value & progressMask; ++ if (configParamData2) ++ { ++ return ipmi::responseReqDataLenInvalid(); ++ } ++ uint8_t progress = configParamData1 & progressMask; + ipmi::Value currentProgress = 0; -+ if (getSOLParameter("Progress", currentProgress) < 0) ++ if (getSOLParameter("Progress", currentProgress, channelNum) < 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); + } + + if ((std::get(currentProgress) == 1) && (progress == 1)) + { -+ return IPMI_CC_SET_IN_PROGRESS_ACTIVE; ++ return ipmi::responseSetInProgressActive(); + } + -+ if (setSOLParameter("Progress", progress) < 0) ++ if (setSOLParameter("Progress", progress, channelNum) < 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); + } + break; + } + case sol::Parameter::enable: + { -+ bool enable = reqData->value & enableMask; -+ if (setSOLParameter("Enable", enable) < 0) ++ if (configParamData2) ++ { ++ return ipmi::responseReqDataLenInvalid(); ++ } ++ bool enable = configParamData1 & enableMask; ++ if (setSOLParameter("Enable", enable, channelNum) < 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); + } + break; + } + case sol::Parameter::authentication: + { -+ // if encryption is used authentication must also be used. -+ if (reqData->auth.encrypt && !reqData->auth.auth) ++ if (configParamData2) + { -+ return IPMI_CC_SYSTEM_INFO_PARAMETER_SET_READ_ONLY; ++ return ipmi::responseReqDataLenInvalid(); + } -+ else if (reqData->auth.privilege < ++ uint8_t encrypt = (configParamData1 & encryptMask) >> encryptShift; ++ uint8_t auth = (configParamData1 & authMask) >> authShift; ++ uint8_t privilege = configParamData1 & privilegeMask; ++ // For security considering encryption and authentication must be ++ // true. ++ if (!encrypt || !auth) ++ { ++ return ipmi::responseSystemInfoParameterSetReadOnly(); ++ } ++ else if (privilege < + static_cast(sol::Privilege::userPriv) || -+ reqData->auth.privilege > -+ static_cast(sol::Privilege::oemPriv)) ++ privilege > static_cast(sol::Privilege::oemPriv)) + { -+ return IPMI_CC_INVALID_FIELD_REQUEST; ++ return ipmi::responseInvalidFieldRequest(); + } + -+ if ((setSOLParameter("Privilege", reqData->auth.privilege) < 0) || -+ (setSOLParameter("ForceEncryption", -+ static_cast(reqData->auth.encrypt)) < -+ 0) || -+ (setSOLParameter("ForceAuthentication", -+ static_cast(reqData->auth.auth)) < 0)) ++ if (setSOLParameter("Privilege", privilege, channelNum) < 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); + } + + break; + } + case sol::Parameter::accumulate: + { -+ if (reqData->acc.threshold == 0) ++ if (!configParamData2) + { -+ return IPMI_CC_INVALID_FIELD_REQUEST; ++ return ipmi::responseReqDataLenInvalid(); + } -+ if (setSOLParameter("AccumulateIntervalMS", reqData->acc.interval) < -+ 0) ++ if (*configParamData2 == 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseInvalidFieldRequest(); + } -+ if (setSOLParameter("Threshold", reqData->acc.threshold) < 0) ++ if (setSOLParameter("AccumulateIntervalMS", configParamData1, ++ channelNum) < 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); ++ } ++ if (setSOLParameter("Threshold", *configParamData2, channelNum) < 0) ++ { ++ return ipmi::responseUnspecifiedError(); + } + break; + } + case sol::Parameter::retry: + { -+ if ((setSOLParameter("RetryCount", reqData->retry.count) < 0) || -+ (setSOLParameter("RetryIntervalMS", reqData->retry.interval) < -+ 0)) ++ if (!configParamData2) ++ { ++ return ipmi::responseReqDataLenInvalid(); ++ } ++ if ((setSOLParameter("RetryCount", (configParamData1 & 0x7), ++ channelNum) < 0) || ++ (setSOLParameter("RetryIntervalMS", *configParamData2, ++ channelNum) < 0)) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); + } + + break; + } + case sol::Parameter::port: + { -+ return IPMI_CC_SYSTEM_INFO_PARAMETER_SET_READ_ONLY; ++ return ipmi::responseSystemInfoParameterSetReadOnly(); + } + case sol::Parameter::nvbitrate: + case sol::Parameter::vbitrate: + case sol::Parameter::channel: + default: -+ return IPMI_CC_PARM_NOT_SUPPORTED; ++ return ipmi::responseParmNotSupported(); + } + -+ return IPMI_CC_OK; ++ return ipmi::responseSuccess(); +} + void register_netfn_transport_functions() { // As this timer is only for transport handler -@@ -1650,5 +1866,11 @@ void register_netfn_transport_functions() +@@ -1648,5 +1930,12 @@ void register_netfn_transport_functions() ipmi_register_callback(NETFUN_TRANSPORT, IPMI_CMD_GET_LAN, NULL, ipmi_transport_get_lan, PRIVILEGE_OPERATOR); -+ ipmi_register_callback(NETFUN_TRANSPORT, IPMI_CMD_SET_SOL_CONF_PARAMS, NULL, -+ setConfParams, PRIVILEGE_ADMIN); ++ ipmi::registerHandler(ipmi::prioOpenBmcBase, ipmi::netFnTransport, ++ ipmi::transport::cmdSetSolConfigParameters, ++ ipmi::Privilege::Admin, setSOLConfParams); + + // Initialize dbus property progress to 0 every time sol manager restart. + initializeSOLInProgress(); @@ -299,10 +353,17 @@ index 8f18b76..a693279 100644 return; } diff --git a/transporthandler.hpp b/transporthandler.hpp -index bd23391..3b5e9e1 100644 +index bd23391..1237658 100644 --- a/transporthandler.hpp +++ b/transporthandler.hpp -@@ -8,6 +8,8 @@ enum ipmi_netfn_storage_cmds +@@ -1,5 +1,6 @@ + #pragma once + ++#include + #include + #include + // IPMI commands for Transport net functions. +@@ -8,6 +9,8 @@ enum ipmi_netfn_storage_cmds // Get capability bits IPMI_CMD_SET_LAN = 0x01, IPMI_CMD_GET_LAN = 0x02, @@ -311,7 +372,7 @@ index bd23391..3b5e9e1 100644 }; // Command specific completion codes -@@ -186,3 +188,98 @@ void commitNetworkChanges(); +@@ -186,3 +189,33 @@ void commitNetworkChanges(); * @param[in] channel: channel number. */ void applyChanges(int channel); @@ -345,71 +406,6 @@ index bd23391..3b5e9e1 100644 + +constexpr uint8_t progressMask = 0x03; +constexpr uint8_t enableMask = 0x01; -+ -+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 -+{ -+ uint8_t interval; //!< Character accumulate interval. -+ uint8_t threshold; //!< Character send threshold. -+} __attribute__((packed)); -+ -+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)); -+ -+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 -+{ -+ uint8_t completionCode; //!< Completion code. -+} __attribute__((packed)); -- -2.17.1 +2.7.4 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 24f355d80..01a3e49b8 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,12 +1,12 @@ -From 3c95de833eba73b3585941ade42ad1775e723280 Mon Sep 17 00:00:00 2001 +From e8ad148601fc3b45fac9092fdd45c537433e662f Mon Sep 17 00:00:00 2001 From: Cheng C Yang -Date: Tue, 7 May 2019 08:03:56 +0800 +Date: Thu, 11 Jul 2019 00:32:58 +0800 Subject: [PATCH] Move Get SOL config parameter to host-ipmid Move Get SOL config parameter command from net-ipmid to host-ipmid. Tested: -Run command ipmitool sol info +Run command ipmitool sol info 1 Set in progress : set-complete Enabled : true Force Encryption : false @@ -18,21 +18,20 @@ Retry Count : 6 Retry Interval (ms) : 200 Volatile Bit Rate (kbps) : IPMI-Over-Serial-Setting Non-Volatile Bit Rate (kbps) : 115.2 -Payload Channel : 14 (0x0e) +Payload Channel : 1 (0x01) Payload Port : 623 Signed-off-by: Cheng C Yang --- host-ipmid-whitelist.conf | 1 + - transporthandler.cpp | 198 ++++++++++++++++++++++++++++++++++++++++++++-- - transporthandler.hpp | 27 ++++++- - 3 files changed, 217 insertions(+), 9 deletions(-) + transporthandler.cpp | 191 ++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 192 insertions(+) diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf -index 2ce44c6..383b412 100644 +index 44c2181..0fcac4e 100644 --- a/host-ipmid-whitelist.conf +++ b/host-ipmid-whitelist.conf -@@ -43,6 +43,7 @@ +@@ -41,6 +41,7 @@ 0x0A:0x49 //: 0x0C:0x02 //: 0x0C:0x21 //: @@ -41,22 +40,15 @@ index 2ce44c6..383b412 100644 0x2C:0x01 //: 0x2C:0x02 //: diff --git a/transporthandler.cpp b/transporthandler.cpp -index 850172d..0c1223a 100644 +index 25062ae..9ba2868 100644 --- a/transporthandler.cpp +++ b/transporthandler.cpp -@@ -38,6 +38,8 @@ static const std::array 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> channelConfig; - -@@ -1668,6 +1670,26 @@ static int setSOLParameter(std::string property, const ipmi::Value& value) +@@ -1719,6 +1719,28 @@ static int getSOLParameter(const std::string& property, ipmi::Value& value, return 0; } ++constexpr const char* consoleInterface = "xyz.openbmc_project.console"; ++constexpr const char* consolePath = "/xyz/openbmc_project/console"; +static int getSOLBaudRate(ipmi::Value& value) +{ + auto dbus = getSdBus(); @@ -77,134 +69,142 @@ index 850172d..0c1223a 100644 + return 0; +} + - static int getSOLParameter(std::string property, ipmi::Value& value) + void initializeSOLInProgress() { - auto dbus = getSdBus(); -@@ -1711,11 +1733,170 @@ void initializeSOLInProgress() - } + ipmi::ChannelInfo chInfo; +@@ -1913,6 +1935,171 @@ ipmi::RspType<> setSOLConfParams(ipmi::Context::ptr ctx, uint4_t chNum, + return ipmi::responseSuccess(); } --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. -+// 3. have unique object for every session based channel. -+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) ++static constexpr uint16_t ipmiStdPort = 623; ++static constexpr uint8_t solParameterRevision = 0x11; ++ipmi::RspType, std::optional> ++ getSOLConfParams(ipmi::Context::ptr ctx, uint4_t chNum, uint3_t reserved, ++ bool getParamRev, uint8_t paramSelector, ++ uint8_t setSelector, uint8_t blockSelector) +{ -+ auto reqData = reinterpret_cast(request); -+ std::vector outPayload; -+ -+ if (*dataLen < sizeof(GetSOLConfParamsRequest) - 2) ++ ipmi::ChannelInfo chInfo; ++ uint8_t channelNum = ipmi::convertCurrentChannelNum( ++ static_cast(chNum), ctx->channel); ++ if (reserved != 0 || ++ (!ipmi::isValidChannel(static_cast(channelNum))) || ++ (ipmi::EChannelSessSupported::none == ++ ipmi::getChannelSessionSupport(static_cast(channelNum)))) + { -+ *dataLen = 0; -+ return IPMI_CC_REQ_DATA_LEN_INVALID; ++ return ipmi::responseInvalidFieldRequest(); ++ } ++ ipmi_ret_t compCode = ++ ipmi::getChannelInfo(static_cast(channelNum), chInfo); ++ if (compCode != IPMI_CC_OK || ++ chInfo.mediumType != ++ static_cast(ipmi::EChannelMediumType::lan8032)) ++ { ++ return ipmi::responseInvalidFieldRequest(); + } + -+ *dataLen = 0; -+ -+ outPayload.push_back(solParameterRevision); -+ if (reqData->getParamRev) ++ if (getParamRev) + { -+ std::copy(outPayload.begin(), outPayload.end(), -+ static_cast(response)); -+ *dataLen = outPayload.size(); -+ return IPMI_CC_OK; ++ return ipmi::responseSuccess(solParameterRevision, std::nullopt, ++ std::nullopt); + } + + ipmi::Value value; -+ switch (static_cast(reqData->paramSelector)) ++ switch (static_cast(paramSelector)) + { + case sol::Parameter::progress: + { -+ if (getSOLParameter("Progress", value) < 0) ++ if (getSOLParameter("Progress", value, channelNum) < 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); + } -+ outPayload.push_back(std::get(value)); -+ break; ++ return ipmi::responseSuccess( ++ solParameterRevision, std::get(value), std::nullopt); + } + case sol::Parameter::enable: + { -+ if (getSOLParameter("Enable", value) < 0) ++ if (getSOLParameter("Enable", value, channelNum) < 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); + } -+ outPayload.push_back(static_cast(std::get(value))); -+ break; ++ return ipmi::responseSuccess( ++ solParameterRevision, ++ static_cast(std::get(value)), std::nullopt); + } + case sol::Parameter::authentication: + { + uint8_t authentication = 0; -+ if (getSOLParameter("Privilege", value) < 0) ++ if (getSOLParameter("Privilege", value, channelNum) < 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); + } + authentication = (std::get(value) & 0x0f); + -+ if (getSOLParameter("ForceAuthentication", value) < 0) ++ if (getSOLParameter("ForceAuthentication", value, channelNum) < 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); + } + authentication |= + (static_cast(std::get(value)) << 6); + -+ if (getSOLParameter("ForceEncryption", value) < 0) ++ if (getSOLParameter("ForceEncryption", value, channelNum) < 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); + } + authentication |= + (static_cast(std::get(value)) << 7); -+ outPayload.push_back(authentication); -+ break; ++ return ipmi::responseSuccess(solParameterRevision, authentication, ++ std::nullopt); + } + case sol::Parameter::accumulate: + { -+ if (getSOLParameter("AccumulateIntervalMS", value) < 0) ++ if (getSOLParameter("AccumulateIntervalMS", value, channelNum) < 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); + } -+ outPayload.push_back(std::get(value)); + -+ if (getSOLParameter("Threshold", value) < 0) ++ ipmi::Value value1; ++ if (getSOLParameter("Threshold", value1, channelNum) < 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); + } -+ outPayload.push_back(std::get(value)); -+ break; ++ return ipmi::responseSuccess(solParameterRevision, ++ std::get(value), ++ std::get(value1)); + } + case sol::Parameter::retry: + { -+ if (getSOLParameter("RetryCount", value) < 0) ++ if (getSOLParameter("RetryCount", value, channelNum) < 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); + } -+ outPayload.push_back(std::get(value) & retryCountMask); + -+ if (getSOLParameter("RetryIntervalMS", value) < 0) ++ ipmi::Value value1; ++ if (getSOLParameter("RetryIntervalMS", value1, channelNum) < 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); + } -+ outPayload.push_back(std::get(value)); -+ break; ++ return ipmi::responseSuccess( ++ solParameterRevision, std::get(value) & retryCountMask, ++ std::get(value1)); ++ } ++ case sol::Parameter::channel: ++ { ++ return ipmi::responseSuccess(solParameterRevision, channelNum, ++ std::nullopt); + } + case sol::Parameter::port: + { + uint16_t port = htole16(ipmiStdPort); + auto buffer = reinterpret_cast(&port); -+ std::copy(buffer, buffer + sizeof(port), -+ std::back_inserter(outPayload)); -+ break; ++ return ipmi::responseSuccess(solParameterRevision, buffer[0], ++ buffer[1]); + } + case sol::Parameter::nvbitrate: + { + if (getSOLBaudRate(value) < 0) + { -+ return IPMI_CC_UNSPECIFIED_ERROR; ++ return ipmi::responseUnspecifiedError(); + } + uint8_t bitRate = 0; + uint32_t* pBaudRate = std::get_if(&value); @@ -233,110 +233,28 @@ index 850172d..0c1223a 100644 + default: + break; + } -+ outPayload.push_back(bitRate); -+ break; ++ return ipmi::responseSuccess(solParameterRevision, bitRate, ++ std::nullopt); + } + default: -+ return IPMI_CC_PARM_NOT_SUPPORTED; ++ return ipmi::responseParmNotSupported(); + } -+ std::copy(outPayload.begin(), outPayload.end(), -+ static_cast(response)); -+ *dataLen = outPayload.size(); -+ -+ return IPMI_CC_OK; +} + -+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) + void register_netfn_transport_functions() { -- auto reqData = reinterpret_cast(request); -+ auto reqData = reinterpret_cast(request); - - // Check request length first - switch (static_cast(reqData->paramSelector)) -@@ -1724,7 +1905,7 @@ ipmi_ret_t setConfParams(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - case sol::Parameter::enable: - case sol::Parameter::authentication: - { -- if (*dataLen != sizeof(SetConfParamsRequest) - 1) -+ if (*dataLen != sizeof(SetSOLConfParamsRequest) - 1) - { - *dataLen = 0; - return IPMI_CC_REQ_DATA_LEN_INVALID; -@@ -1734,7 +1915,7 @@ ipmi_ret_t setConfParams(ipmi_netfn_t netfn, ipmi_cmd_t cmd, - case sol::Parameter::accumulate: - case sol::Parameter::retry: - { -- if (*dataLen != sizeof(SetConfParamsRequest)) -+ if (*dataLen != sizeof(SetSOLConfParamsRequest)) - { - *dataLen = 0; - return IPMI_CC_REQ_DATA_LEN_INVALID; -@@ -1865,7 +2046,10 @@ void register_netfn_transport_functions() - ipmi_transport_get_lan, PRIVILEGE_OPERATOR); + // As this timer is only for transport handler +@@ -1934,6 +2121,10 @@ void register_netfn_transport_functions() + ipmi::transport::cmdSetSolConfigParameters, + ipmi::Privilege::Admin, setSOLConfParams); - ipmi_register_callback(NETFUN_TRANSPORT, IPMI_CMD_SET_SOL_CONF_PARAMS, NULL, -- setConfParams, PRIVILEGE_ADMIN); -+ setSOLConfParams, PRIVILEGE_ADMIN); ++ ipmi::registerHandler(ipmi::prioOpenBmcBase, ipmi::netFnTransport, ++ ipmi::transport::cmdGetSolConfigParameters, ++ ipmi::Privilege::User, getSOLConfParams); + -+ ipmi_register_callback(NETFUN_TRANSPORT, IPMI_CMD_GET_SOL_CONF_PARAMS, NULL, -+ getSOLConfParams, PRIVILEGE_ADMIN); - // Initialize dbus property progress to 0 every time sol manager restart. initializeSOLInProgress(); -diff --git a/transporthandler.hpp b/transporthandler.hpp -index 3b5e9e1..a21862b 100644 ---- a/transporthandler.hpp -+++ b/transporthandler.hpp -@@ -1,6 +1,7 @@ - #pragma once - - #include -+#include - #include - // 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)); --struct SetConfParamsRequest -+struct SetSOLConfParamsRequest - { - #if BYTE_ORDER == LITTLE_ENDIAN - uint8_t channelNumber : 4; //!< Channel number. -@@ -279,7 +280,29 @@ struct SetConfParamsRequest - }; - } __attribute__((packed)); - --struct SetConfParamsResponse -+struct SetSOLConfParamsResponse - { - uint8_t completionCode; //!< Completion code. - } __attribute__((packed)); -+ -+struct GetSOLConfParamsRequest -+{ -+#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)); -+ -+static constexpr uint16_t ipmiStdPort = 623; -+static constexpr uint8_t solParameterRevision = 0x11; -- 2.7.4 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0061-Use-xyz.openbmc_project.State.Chassis-for-IPMI-chass.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0061-Use-xyz.openbmc_project.State.Chassis-for-IPMI-chass.patch deleted file mode 100644 index 877c5336a..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0061-Use-xyz.openbmc_project.State.Chassis-for-IPMI-chass.patch +++ /dev/null @@ -1,127 +0,0 @@ -From 514b76d1c05d7ed7fb7e1df27833e423e04c9a1c Mon Sep 17 00:00:00 2001 -From: "Jason M. Bills" -Date: Tue, 21 May 2019 09:57:16 -0700 -Subject: [PATCH] Use xyz.openbmc_project.State.Chassis for IPMI chassis status - -Instead of directly using pgood on dbus, this change uses the -xyz.openbmc_project.State.Chassis "CurrentPowerState" property -for the IPMI chassis status command. This will allow us to -remove pgood from dbus. - -Tested: -Ran IPMI chassis commands and confirmed that they behave as -expected: -ipmitool power status -Chassis Power is on - -ipmitool power off -Chassis Power Control: Down/Off - -ipmitool power status -Chassis Power is off - -ipmitool power on -Chassis Power Control: Up/On - -ipmitool power status -Chassis Power is on - -Change-Id: I7836c16b76c3b309f176186f3e2453082e4cd1af -Signed-off-by: Jason M. Bills ---- - chassishandler.cpp | 61 ++++++++++++++++++++++++++++++++++++------------------ - 1 file changed, 41 insertions(+), 20 deletions(-) - -diff --git a/chassishandler.cpp b/chassishandler.cpp -index 1738ccc..e4e842d 100644 ---- a/chassishandler.cpp -+++ b/chassishandler.cpp -@@ -824,44 +824,65 @@ std::optional getPowerRestorePolicy() - */ - std::optional getPowerStatus() - { -- constexpr const char* powerControlObj = -- "/xyz/openbmc_project/Chassis/Control/Power0"; -- constexpr const char* powerControlIntf = -- "xyz.openbmc_project.Chassis.Control.Power"; - bool powerGood = false; - std::shared_ptr busp = getSdBus(); - try - { -+ constexpr const char* chassisStatePath = -+ "/xyz/openbmc_project/state/chassis0"; -+ constexpr const char* chassisStateIntf = -+ "xyz.openbmc_project.State.Chassis"; - auto service = -- ipmi::getService(*busp, powerControlIntf, powerControlObj); -+ ipmi::getService(*busp, chassisStateIntf, chassisStatePath); - -- ipmi::Value variant = ipmi::getDbusProperty( -- *busp, service, powerControlObj, powerControlIntf, "pgood"); -- powerGood = static_cast(std::get(variant)); -+ ipmi::Value variant = -+ ipmi::getDbusProperty(*busp, service, chassisStatePath, -+ chassisStateIntf, "CurrentPowerState"); -+ std::string powerState = std::get(variant); -+ if (powerState == "xyz.openbmc_project.State.Chassis.PowerState.On") -+ { -+ powerGood = true; -+ } - } - catch (const std::exception& e) - { - try - { -- // FIXME: some legacy modules use the older path; try that next -- constexpr const char* legacyPwrCtrlObj = -- "/org/openbmc/control/power0"; -- constexpr const char* legacyPwrCtrlIntf = -- "org.openbmc.control.Power"; -+ // FIXME: some modules use pgood; try that next -+ constexpr const char* powerControlObj = -+ "/xyz/openbmc_project/Chassis/Control/Power0"; -+ constexpr const char* powerControlIntf = -+ "xyz.openbmc_project.Chassis.Control.Power"; - auto service = -- ipmi::getService(*busp, legacyPwrCtrlIntf, legacyPwrCtrlObj); -+ ipmi::getService(*busp, powerControlIntf, powerControlObj); - - ipmi::Value variant = ipmi::getDbusProperty( -- *busp, service, legacyPwrCtrlObj, legacyPwrCtrlIntf, "pgood"); -+ *busp, service, powerControlObj, powerControlIntf, "pgood"); - powerGood = static_cast(std::get(variant)); - } - catch (const std::exception& e) - { -- log("Failed to fetch pgood property", -- entry("ERROR=%s", e.what()), -- entry("PATH=%s", powerControlObj), -- entry("INTERFACE=%s", powerControlIntf)); -- return std::nullopt; -+ try -+ { -+ // FIXME: some legacy modules use the older path; try that next -+ constexpr const char* legacyPwrCtrlObj = -+ "/org/openbmc/control/power0"; -+ constexpr const char* legacyPwrCtrlIntf = -+ "org.openbmc.control.Power"; -+ auto service = ipmi::getService(*busp, legacyPwrCtrlIntf, -+ legacyPwrCtrlObj); -+ -+ ipmi::Value variant = -+ ipmi::getDbusProperty(*busp, service, legacyPwrCtrlObj, -+ legacyPwrCtrlIntf, "pgood"); -+ powerGood = static_cast(std::get(variant)); -+ } -+ catch (const std::exception& e) -+ { -+ log("Failed to fetch pgood property", -+ entry("ERROR=%s", e.what())); -+ return std::nullopt; -+ } - } - } - return std::make_optional(powerGood); --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0062-Update-IPMI-Chassis-Control-command.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0062-Update-IPMI-Chassis-Control-command.patch index 498233881..f29111758 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0062-Update-IPMI-Chassis-Control-command.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0062-Update-IPMI-Chassis-Control-command.patch @@ -1,4 +1,4 @@ -From f11928c6b39052c679c9300e9d836837ef60be06 Mon Sep 17 00:00:00 2001 +From 00fb92edcb4229eeb5b46c4eb206ba7d70e241fc Mon Sep 17 00:00:00 2001 From: "Jason M. Bills" Date: Mon, 3 Jun 2019 17:01:47 -0700 Subject: [PATCH] Update IPMI Chassis Control command @@ -19,11 +19,11 @@ ipmitool power soft: soft power-off requested from system software Change-Id: Ic9fba3ca4abd9a758eb88f1e6ee09f7ca64ff80a Signed-off-by: Jason M. Bills --- - chassishandler.cpp | 138 +++++++++++++++++++++-------------------------------- - 1 file changed, 54 insertions(+), 84 deletions(-) + chassishandler.cpp | 206 ++++++++++++++--------------------------------------- + 1 file changed, 52 insertions(+), 154 deletions(-) diff --git a/chassishandler.cpp b/chassishandler.cpp -index e4e842d..d71b95f 100644 +index 88bf84b..ad564e2 100644 --- a/chassishandler.cpp +++ b/chassishandler.cpp @@ -31,6 +31,7 @@ @@ -134,7 +134,84 @@ index e4e842d..d71b95f 100644 } namespace power_policy -@@ -1138,61 +1143,26 @@ ipmi::RspType<> ipmiChassisControl(uint8_t chassisControl) +@@ -1033,76 +1038,6 @@ ipmi::RspType("Failed to set property in SoftPowerOff object", +- entry("ERRNO=0x%X", -rc)); +- } +- +- // TODO openbmc/openbmc#1661 - Mapper refactor +- // free(busname); +- return rc; +-} +- +-//---------------------------------------------------------------------- +-// Create file to indicate there is no need for softoff notification to host +-//---------------------------------------------------------------------- +-void indicate_no_softoff_needed() +-{ +- fs::path path{HOST_INBAND_REQUEST_DIR}; +- if (!fs::is_directory(path)) +- { +- fs::create_directory(path); +- } +- +- // Add the host instance (default 0 for now) to the file name +- std::string file{HOST_INBAND_REQUEST_FILE}; +- auto size = std::snprintf(nullptr, 0, file.c_str(), 0); +- size++; // null +- std::unique_ptr buf(new char[size]); +- std::snprintf(buf.get(), size, file.c_str(), 0); +- +- // Append file name to directory and create it +- path /= buf.get(); +- std::ofstream(path.c_str()); +-} +- + /** @brief Implementation of chassis control command + * + * @param - chassisControl command byte +@@ -1115,61 +1050,24 @@ ipmi::RspType<> ipmiChassisControl(uint8_t chassisControl) switch (chassisControl) { case CMD_POWER_ON: @@ -204,8 +281,6 @@ index e4e842d..d71b95f 100644 + rc = initiateHostStateTransition(State::Host::Transition::Off); + break; + case CMD_PULSE_DIAGNOSTIC_INTR: -+ rc = -+ initiateHostStateTransition(State::Host::Transition::Interrupt); break; default: diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Enable-watchdog-to-save-useflag-after-host-power-off.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Enable-watchdog-to-save-useflag-after-host-power-off.patch new file mode 100644 index 000000000..6a7b056ab --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Enable-watchdog-to-save-useflag-after-host-power-off.patch @@ -0,0 +1,29 @@ +diff --git a/app/watchdog.cpp b/app/watchdog.cpp +index 2938d23..bc5df29 100644 +--- a/app/watchdog.cpp ++++ b/app/watchdog.cpp +@@ -445,23 +445,21 @@ ipmi_ret_t ipmi_app_watchdog_get(ipmi_netfn_t netfn, ipmi_cmd_t cmd, + wdTimerUseToIpmiTimerUse(wd_prop.expiredTimerUse)); + } + ++ res.expire_flags = timerUseExpirationFlags; + if (wd_prop.enabled) + { + res.timer_use |= wd_running; + res.present_countdown = htole16(wd_prop.timeRemaining / 100); +- res.expire_flags = 0; + } + else + { + if (wd_prop.expiredTimerUse == WatchdogService::TimerUse::Reserved) + { + res.present_countdown = res.initial_countdown; +- res.expire_flags = 0; + } + else + { + res.present_countdown = 0; +- res.expire_flags = timerUseExpirationFlags; + } + } + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Update-provisioning-mode-filter-logic.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Update-provisioning-mode-filter-logic.patch new file mode 100644 index 000000000..57a31c991 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Update-provisioning-mode-filter-logic.patch @@ -0,0 +1,286 @@ +From 3279300bb9afd1f169b35b7830d7f054045ab35f Mon Sep 17 00:00:00 2001 +From: Richard Marian Thomaiyar +Date: Tue, 18 Jun 2019 19:42:30 +0530 +Subject: [PATCH] Update provisioning mode filter logic + +Updated provisioning mode filtering logic support. Based on the +RestrictionMode property, Host (system) interface commands will be +filtered as per the allowed list in ProvisionedHostWhitelist once +POST complete is achieved. No commands will be allowed in +ProvisionedHostDisabled after POST complete and in all other cases +filterning logic will not be applied. + +Tested +1. Verified the filtering logic through EFI shell and made sure +filtering logic is applied when RestrictionMode is in +ProvisionedHostWhitelist mode +2. Verified no filtering logic is applied in normal modes +3. Made sure BIOS is able to execute commands, which are not in +whitelist (Note: New whitelist conf is under review). + +Change-Id: I7a14e827d70e2d8d6975e600a0fd00e2a790bc22 +Signed-off-by: Richard Marian Thomaiyar +--- + whitelist-filter.cpp | 155 ++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 122 insertions(+), 33 deletions(-) + +diff --git a/whitelist-filter.cpp b/whitelist-filter.cpp +index 9f1e7c8..2c56087 100644 +--- a/whitelist-filter.cpp ++++ b/whitelist-filter.cpp +@@ -25,6 +25,7 @@ namespace + */ + class WhitelistFilter + { ++ + public: + WhitelistFilter(); + ~WhitelistFilter() = default; +@@ -35,17 +36,26 @@ class WhitelistFilter + + private: + void postInit(); +- void cacheRestrictedMode(); ++ void cacheRestrictedAndPostCompleteMode(); + void handleRestrictedModeChange(sdbusplus::message::message& m); ++ void handlePostCompleteChange(sdbusplus::message::message& m); + ipmi::Cc filterMessage(ipmi::message::Request::ptr request); + +- bool restrictedMode = true; ++ sdbusplus::xyz::openbmc_project::Control::Security::server:: ++ RestrictionMode::Modes restrictionMode = ++ sdbusplus::xyz::openbmc_project::Control::Security::server:: ++ RestrictionMode::Modes::ProvisionedHostWhitelist; ++ bool postCompleted = false; + std::shared_ptr bus; + std::unique_ptr objects; ++ std::unique_ptr postCompleteObj; + std::unique_ptr modeChangeMatch; ++ std::unique_ptr postCompleteMatch; + + static constexpr const char restrictionModeIntf[] = + "xyz.openbmc_project.Control.Security.RestrictionMode"; ++ static constexpr const char* systemOsStatusIntf = ++ "xyz.openbmc_project.State.OperatingSystem.Status"; + }; + + WhitelistFilter::WhitelistFilter() +@@ -63,16 +73,22 @@ WhitelistFilter::WhitelistFilter() + post_work([this]() { postInit(); }); + } + +-void WhitelistFilter::cacheRestrictedMode() ++void WhitelistFilter::cacheRestrictedAndPostCompleteMode() + { + using namespace sdbusplus::xyz::openbmc_project::Control::Security::server; + std::string restrictionModeSetting; + std::string restrictionModeService; ++ std::string systemOsStatusPath; ++ std::string systemOsStatusService; + try + { + restrictionModeSetting = objects->map.at(restrictionModeIntf).at(0); + restrictionModeService = + objects->service(restrictionModeSetting, restrictionModeIntf); ++ ++ systemOsStatusPath = postCompleteObj->map.at(systemOsStatusIntf).at(0); ++ systemOsStatusService = ++ postCompleteObj->service(systemOsStatusPath, systemOsStatusIntf); + } + catch (const std::out_of_range& e) + { +@@ -80,26 +96,50 @@ void WhitelistFilter::cacheRestrictedMode() + "Could not look up restriction mode interface from cache"); + return; + } ++ + bus->async_method_call( + [this](boost::system::error_code ec, ipmi::Value v) { + if (ec) + { + log("Error in RestrictionMode Get"); + // Fail-safe to true. +- restrictedMode = true; ++ restrictionMode = ++ RestrictionMode::Modes::ProvisionedHostWhitelist; + return; + } + auto mode = std::get(v); +- auto restrictionMode = +- RestrictionMode::convertModesFromString(mode); +- restrictedMode = +- (restrictionMode == RestrictionMode::Modes::Whitelist); +- log((restrictedMode ? "Set restrictedMode = true" +- : "Set restrictedMode = false")); ++ restrictionMode = RestrictionMode::convertModesFromString(mode); ++ log( ++ "Read restriction mode", ++ entry("VALUE=%d", static_cast(restrictionMode))); + }, + restrictionModeService, restrictionModeSetting, + "org.freedesktop.DBus.Properties", "Get", restrictionModeIntf, + "RestrictionMode"); ++ ++ bus->async_method_call( ++ [this](boost::system::error_code ec, const ipmi::Value& v) { ++ if (ec) ++ { ++ log("Error in OperatingSystemState Get"); ++ postCompleted = true; ++ return; ++ } ++ auto value = std::get(v); ++ if (value == "Standby") ++ { ++ postCompleted = true; ++ } ++ else ++ { ++ postCompleted = false; ++ } ++ log("Read POST complete value", ++ entry("VALUE=%d", postCompleted)); ++ }, ++ systemOsStatusService, systemOsStatusPath, ++ "org.freedesktop.DBus.Properties", "Get", systemOsStatusIntf, ++ "OperatingSystemState"); + } + + void WhitelistFilter::handleRestrictedModeChange(sdbusplus::message::message& m) +@@ -112,23 +152,44 @@ void WhitelistFilter::handleRestrictedModeChange(sdbusplus::message::message& m) + { + if (property.first == "RestrictionMode") + { +- RestrictionMode::Modes restrictionMode = +- RestrictionMode::convertModesFromString( +- std::get(property.second)); +- restrictedMode = +- (restrictionMode == RestrictionMode::Modes::Whitelist); +- log((restrictedMode +- ? "Updated restrictedMode = true" +- : "Updated restrictedMode = false")); ++ restrictionMode = RestrictionMode::convertModesFromString( ++ std::get(property.second)); ++ log( ++ "Updated restriction mode", ++ entry("VALUE=%d", static_cast(restrictionMode))); ++ } ++ } ++} ++void WhitelistFilter::handlePostCompleteChange(sdbusplus::message::message& m) ++{ ++ std::string intf; ++ std::vector> propertyList; ++ m.read(intf, propertyList); ++ for (const auto& property : propertyList) ++ { ++ if (property.first == "OperatingSystemState") ++ { ++ std::string value = std::get(property.second); ++ if (value == "Standby") ++ { ++ postCompleted = true; ++ } ++ else ++ { ++ postCompleted = false; ++ } ++ log(postCompleted ? "Updated to POST Complete" ++ : "Updated to !POST Complete"); + } + } + } +- + void WhitelistFilter::postInit() + { + objects = std::make_unique( + *bus, std::vector({restrictionModeIntf})); +- if (!objects) ++ postCompleteObj = std::make_unique( ++ *bus, std::vector({systemOsStatusIntf})); ++ if (!objects || !postCompleteObj) + { + log( + "Failed to create settings object; defaulting to restricted mode"); +@@ -136,37 +197,65 @@ void WhitelistFilter::postInit() + } + + // Initialize restricted mode +- cacheRestrictedMode(); ++ cacheRestrictedAndPostCompleteMode(); + // Wait for changes on Restricted mode +- std::string filterStr; ++ std::string filterStrModeChange; ++ std::string filterStrPostComplete; + try + { +- filterStr = sdbusplus::bus::match::rules::propertiesChanged( ++ filterStrModeChange = sdbusplus::bus::match::rules::propertiesChanged( + objects->map.at(restrictionModeIntf).at(0), restrictionModeIntf); ++ filterStrPostComplete = sdbusplus::bus::match::rules::propertiesChanged( ++ postCompleteObj->map.at(systemOsStatusIntf).at(0), ++ systemOsStatusIntf); + } + catch (const std::out_of_range& e) + { +- log("Failed to determine restriction mode filter string"); ++ log("Failed to determine restriction mode / POST complete " ++ "filter string"); + return; + } + modeChangeMatch = std::make_unique( +- *bus, filterStr, [this](sdbusplus::message::message& m) { ++ *bus, filterStrModeChange, [this](sdbusplus::message::message& m) { + handleRestrictedModeChange(m); + }); ++ postCompleteMatch = std::make_unique( ++ *bus, filterStrPostComplete, [this](sdbusplus::message::message& m) { ++ handlePostCompleteChange(m); ++ }); + } + + ipmi::Cc WhitelistFilter::filterMessage(ipmi::message::Request::ptr request) + { +- if (request->ctx->channel == ipmi::channelSystemIface && restrictedMode) ++ using namespace sdbusplus::xyz::openbmc_project::Control::Security::server; ++ ++ if (request->ctx->channel == ipmi::channelSystemIface && ++ (restrictionMode != RestrictionMode::Modes::None && ++ restrictionMode != RestrictionMode::Modes::Provisioning)) + { +- if (!std::binary_search( +- whitelist.cbegin(), whitelist.cend(), +- std::make_pair(request->ctx->netFn, request->ctx->cmd))) ++ if (!postCompleted) + { +- log("Net function not whitelisted", +- entry("NETFN=0x%X", int(request->ctx->netFn)), +- entry("CMD=0x%X", int(request->ctx->cmd))); +- return ipmi::ccInsufficientPrivilege; ++ // Allow all commands, till POST is not completed ++ return ipmi::ccSuccess; ++ } ++ switch (restrictionMode) ++ { ++ case RestrictionMode::Modes::ProvisionedHostWhitelist: ++ { ++ if (!std::binary_search( ++ whitelist.cbegin(), whitelist.cend(), ++ std::make_pair(request->ctx->netFn, request->ctx->cmd))) ++ { ++ log( ++ "Net function not whitelisted", ++ entry("NETFN=0x%X", int(request->ctx->netFn)), ++ entry("CMD=0x%X", int(request->ctx->cmd))); ++ return ipmi::ccInsufficientPrivilege; ++ } ++ break; ++ } ++ default: // for whitelist, blacklist & HostDisabled ++ return ipmi::ccInsufficientPrivilege; + } + } + return ipmi::ccSuccess; +-- +2.7.4 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/host-ipmid-whitelist.conf b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/host-ipmid-whitelist.conf new file mode 100644 index 000000000..deed53b0b --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/host-ipmid-whitelist.conf @@ -0,0 +1,50 @@ +#:: +0x00:0x01 //: +0x00:0x07 //: +0x00:0x09 //: +0x00:0x0F //: +0x04:0x02 //: +0x04:0x2D //: +0x04:0x2F //: +0x06:0x01 //: +0x06:0x04 //: +0x06:0x07 //: +0x06:0x08 //: +0x06:0x22 //: +0x06:0x24 //: +0x06:0x25 //: +0x06:0x2F //: +0x06:0x31 //: +0x06:0x35 //: +0x06:0x36 //: +0x06:0x37 //: +0x06:0x42 //: +0x06:0x4E //: +0x06:0x54 //: +0x0A:0x10 //: +0x0A:0x11 //: +0x0A:0x20 //: +0x0A:0x22 //: +0x0A:0x23 //: +0x0A:0x40 //: +0x0A:0x42 //: +0x0A:0x44 //: +0x0A:0x48 //: +0x0A:0x49 //: +0x0C:0x02 //: +0x0C:0x22 //: +0x2C:0x00 //: +0x2C:0x01 //: +0x2C:0x02 //: +0x2C:0x03 //: +0x2C:0x06 //: +0x2C:0x07 //: +0x2C:0x10 //: +0x30:0x27 //: +0x30:0x31 //: +0x30:0x55 //: +0x30:0x9A //: +0x30:0xB0 //: +0x30:0xE9 //: + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/phosphor-ipmi-host.service b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/phosphor-ipmi-host.service index d855eaa5b..b09bbf890 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/phosphor-ipmi-host.service +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/phosphor-ipmi-host.service @@ -7,8 +7,10 @@ Wants=mapper-wait@-xyz-openbmc_project-control-host0-boot-one_time.service After=mapper-wait@-xyz-openbmc_project-control-host0-boot-one_time.service Wants=mapper-wait@-xyz-openbmc_project-control-host0-power_restore_policy.service After=mapper-wait@-xyz-openbmc_project-control-host0-power_restore_policy.service -Wants=mapper-wait@-xyz-openbmc_project-control-host0-restriction_mode.service -After=mapper-wait@-xyz-openbmc_project-control-host0-restriction_mode.service +Wants=mapper-wait@-xyz-openbmc_project-control-security-restriction_mode.service +After=mapper-wait@-xyz-openbmc_project-control-security-restriction_mode.service +Wants=mapper-wait@-xyz-openbmc_project-state-os.service +After=mapper-wait@-xyz-openbmc_project-state-os.service Wants=clear-once.service After=clear-once.service 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 a6a142ec8..d8f9203c9 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,25 +3,24 @@ 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 = "0b979b61c12ffe6ab8a27acf8ad2a0165d687195" +SRCREV = "894d022017215acceafc9e3f21379534f5396d21" SRC_URI += "file://phosphor-ipmi-host.service \ + file://host-ipmid-whitelist.conf \ file://0009-IPv6-Network-changes.patch \ file://0010-fix-get-system-GUID-ipmi-command.patch \ file://0013-ipmi-add-set-bios-id-to-whitelist.patch \ - file://0021-Implement-IPMI-Commmand-Get-Host-Restart-Cause.patch \ file://0039-ipmi-add-oem-command-get-AIC-FRU-to-whitelist.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://0059-Move-Set-SOL-config-parameter-to-host-ipmid.patch \ file://0060-Move-Get-SOL-config-parameter-to-host-ipmid.patch \ - file://0061-Use-xyz.openbmc_project.State.Chassis-for-IPMI-chass.patch \ file://0062-Update-IPMI-Chassis-Control-command.patch \ file://0063-Save-the-pre-timeout-interrupt-in-dbus-property.patch \ + file://0064-Enable-watchdog-to-save-useflag-after-host-power-off.patch \ + file://0064-Update-provisioning-mode-filter-logic.patch \ " # remove the softpoweroff service since we do not need it @@ -35,6 +34,9 @@ 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_configure_append(){ + cp -f ${WORKDIR}/host-ipmid-whitelist.conf ${S} +} 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 13d908ad1..f33be5760 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 = "8188d7651c23502f88f9bf850ab7e549f6463997" +SRCREV = "bbfd00abdbc6d2f7c0389eae91cc055a1d4fe0c3" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0007-Adding-support-for-GetSessionInfo-command.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0007-Adding-support-for-GetSessionInfo-command.patch deleted file mode 100644 index bbbe6ae4f..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0007-Adding-support-for-GetSessionInfo-command.patch +++ /dev/null @@ -1,418 +0,0 @@ -From b05fb3231810865ef1b6e627bb0452ae7a6c61f8 Mon Sep 17 00:00:00 2001 -From: ssekar -Date: Wed, 12 Dec 2018 16:04:15 +0530 -Subject: [PATCH 1/2] Adding support for GetSessionInfo command - -Description: user can get all session info (remote ip,port, -session id, priv, etc) using this command. - -Verification :we can get all active and non active session -info by session handle session id. -Updated the Remote IP addr and Port update for sessioninfo. -Unit testing are done. - -Change-Id: I662ef2b9f0c1d6bda331eb6481d7b9f34534541b -Signed-off-by: ssekar ---- - comm_module.cpp | 8 +++ - command/session_cmds.cpp | 147 +++++++++++++++++++++++++++++++++++++++ - command/session_cmds.hpp | 55 +++++++++++++++ - message_handler.cpp | 1 + - sessions_manager.cpp | 55 +++++++++++++++ - sessions_manager.hpp | 7 ++ - socket_channel.hpp | 17 +++++ - 7 files changed, 290 insertions(+) - -diff --git a/comm_module.cpp b/comm_module.cpp -index acc9089..7a1a17d 100644 ---- a/comm_module.cpp -+++ b/comm_module.cpp -@@ -53,6 +53,14 @@ void sessionSetupCommands() - &closeSession, - session::Privilege::CALLBACK, - false}, -+ // Session Info Command -+ { -+ { -+ (static_cast(message::PayloadType::IPMI) << 16) | -+ static_cast(command::NetFns::APP) | 0x3D -+ }, -+ &getSessionInfo, session::Privilege::USER, false -+ }, - }; - - for (auto& iter : commands) -diff --git a/command/session_cmds.cpp b/command/session_cmds.cpp -index 8606ce5..4beeb6e 100644 ---- a/command/session_cmds.cpp -+++ b/command/session_cmds.cpp -@@ -8,6 +8,14 @@ - namespace command - { - -+// Defined as per IPMI sepcification -+static constexpr uint8_t searchCurrentSession = 0x00; -+static constexpr uint8_t searchSessionByHandle = 0xFE; -+static constexpr uint8_t searchSessionByID = 0xFF; -+ -+static constexpr uint8_t ipmi15VerSession = 0x00; -+static constexpr uint8_t ipmi20VerSession = 0x01; -+ - std::vector - setSessionPrivilegeLevel(const std::vector& inPayload, - const message::Handler& handler) -@@ -92,4 +100,143 @@ std::vector closeSession(const std::vector& inPayload, - return outPayload; - } - -+std::vector getSessionInfo(const std::vector& inPayload, -+ const message::Handler& handler) -+ -+{ -+ std::vector outPayload(sizeof(GetSessionInfoResponse)); -+ auto request = -+ reinterpret_cast(inPayload.data()); -+ auto response = -+ reinterpret_cast(outPayload.data()); -+ uint32_t reqSessionID = handler.sessionID; -+ response->completionCode = IPMI_CC_OK; -+ if (inPayload.size() == 1 && request->sessionIndex != 0) -+ { -+ if (request->sessionIndex <= session::MAX_SESSION_COUNT) -+ { -+ reqSessionID = std::get(singletonPool) -+ .getSessionIDbyHandle(request->sessionIndex); -+ } -+ else -+ { -+ response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST; -+ outPayload.resize(sizeof(response->completionCode)); -+ return std::move(outPayload); -+ } -+ } -+ -+ // Here we look for session info according to session index parameter -+ switch (request->sessionIndex) -+ { -+ // Look for current active session which this cmd is received over -+ case searchCurrentSession: -+ // Request data should only contain session index byte -+ if (inPayload.size() != 1) -+ { -+ response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID; -+ outPayload.resize(sizeof(response->completionCode)); -+ return std::move(outPayload); -+ } -+ // To look for current active session which the command came over, -+ // the session ID cannot be 0. -+ if (0 == reqSessionID) -+ { -+ response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST; -+ outPayload.resize(sizeof(response->completionCode)); -+ return std::move(outPayload); -+ } -+ break; -+ case searchSessionByHandle: -+ // Request data should only contain session index byte and Session -+ // handle -+ if (inPayload.size() != 2) -+ { -+ response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID; -+ outPayload.resize(sizeof(response->completionCode)); -+ return std::move(outPayload); -+ } -+ -+ // Retrieve session id based on session handle -+ if (request->sessionHandle <= session::MAX_SESSION_COUNT) -+ { -+ reqSessionID = -+ std::get(singletonPool) -+ .getSessionIDbyHandle(request->sessionHandle); -+ } -+ else -+ { -+ response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST; -+ outPayload.resize(sizeof(response->completionCode)); -+ return std::move(outPayload); -+ } -+ break; -+ case searchSessionByID: -+ // Request data should only contain session index byte and Session -+ // handle -+ if (inPayload.size() != sizeof(GetSessionInfoRequest)) -+ { -+ response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID; -+ outPayload.resize(sizeof(response->completionCode)); -+ return std::move(outPayload); -+ } -+ reqSessionID = endian::from_ipmi(request->sessionID); -+ -+ break; -+ default: -+ if (inPayload.size() != 1) -+ { -+ response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID; -+ outPayload.resize(sizeof(response->completionCode)); -+ return std::move(outPayload); -+ } -+ } -+ -+ response->totalSessionCount = session::MAX_SESSION_COUNT; -+ response->activeSessioncount = -+ std::get(singletonPool).getNoOfActiveSession(); -+ response->sessionHandle = 0; -+ if (reqSessionID != 0) -+ { -+ -+ std::shared_ptr sessionInfo; -+ try -+ { -+ sessionInfo = std::get(singletonPool) -+ .getSession(reqSessionID); -+ } -+ catch (std::exception& e) -+ { -+ response->completionCode = IPMI_CC_UNSPECIFIED_ERROR; -+ outPayload.resize(sizeof(response->completionCode)); -+ return std::move(outPayload); -+ } -+ response->sessionHandle = std::get(singletonPool) -+ .getSessionHandle(reqSessionID); -+ uint8_t userId = ipmi::ipmiUserGetUserId(sessionInfo->userName); -+ if (userId == ipmi::invalidUserId) -+ { -+ response->completionCode = IPMI_CC_UNSPECIFIED_ERROR; -+ outPayload.resize(sizeof(response->completionCode)); -+ return std::move(outPayload); -+ } -+ response->userID = userId; // userId; -+ response->privLevel = static_cast(sessionInfo->curPrivLevel); -+ response->chanNum = sessionInfo->chNum; // byte7 3:0 -+ response->ipmiVer = ipmi20VerSession; // byte7 7:4 -+ response->remoteIpAddr = -+ sessionInfo->channelPtr->getRemoteAddressInbytes(); -+ response->remotePort = -+ sessionInfo->channelPtr->getPort(); // remoteSessionPort; -+ -+ std::cerr << "\nSessionInfo:" << (int)reqSessionID; -+ // TODO: Filling the Remote MACAddress -+ } -+ else -+ { -+ outPayload.resize(4); -+ } -+ return std::move(outPayload); -+} -+ - } // namespace command -diff --git a/command/session_cmds.hpp b/command/session_cmds.hpp -index 9737fdb..741de23 100644 ---- a/command/session_cmds.hpp -+++ b/command/session_cmds.hpp -@@ -116,4 +116,59 @@ struct CloseSessionResponse - std::vector closeSession(const std::vector& inPayload, - const message::Handler& handler); - -+/** -+ * @struct GetSessionInfoRequest -+ * -+ * IPMI Request data for getSession info command -+ */ -+struct GetSessionInfoRequest -+{ -+ uint8_t sessionIndex; -+ union -+ { -+ uint8_t sessionHandle; -+ uint32_t sessionID; -+ }; -+} __attribute__((packed)); -+ -+/** -+ * @struct getSessionInfoResponse -+ * -+ * IPMI Response data for getSession info command -+ */ -+struct GetSessionInfoResponse -+{ -+ uint8_t completionCode; -+ uint8_t sessionHandle; -+ uint8_t totalSessionCount; -+ uint8_t activeSessioncount; -+ uint8_t userID; -+ uint8_t privLevel; -+#if BYTE_ORDER == LITTLE_ENDIAN -+ uint8_t chanNum : 4; -+ uint8_t ipmiVer : 4; -+#endif -+#if BYTE_ORDER == BIG_ENDIAN -+ uint8_t ipmiVer : 4; -+ uint8_t chanNum : 4; -+#endif -+ uint32_t remoteIpAddr; // for channel private data -+ uint8_t remoteMACAddr[6]; -+ uint16_t remotePort; -+} __attribute__((packed)); -+ -+/** -+ * @brief GetSessionInfo Command -+ * -+ * This command is used to get the session information based on -+ * session handle or session ID. Retreive all session information. -+ -+ * @param[in] inPayload - Request Data for the command -+ * @param[in] handler - Reference to the Message Handler -+ * -+ * @return Response data for the command -+ */ -+std::vector getSessionInfo(const std::vector& inPayload, -+ const message::Handler& handler); -+ - } // namespace command -diff --git a/message_handler.cpp b/message_handler.cpp -index e2aafb3..b335236 100644 ---- a/message_handler.cpp -+++ b/message_handler.cpp -@@ -43,6 +43,7 @@ bool Handler::receive() - sessionID = inMessage->bmcSessionID; - inMessage->rcSessionID = session->getRCSessionID(); - session->updateLastTransactionTime(); -+ session->channelPtr = channel; - - return true; - } -diff --git a/sessions_manager.cpp b/sessions_manager.cpp -index 95a8a15..9f3210b 100644 ---- a/sessions_manager.cpp -+++ b/sessions_manager.cpp -@@ -88,6 +88,9 @@ std::shared_ptr - } - sessionID = session->getBMCSessionID(); - sessionsMap.emplace(sessionID, session); -+ storeSessionHandle(sessionID); -+ -+ - return session; - } - -@@ -149,12 +152,15 @@ std::shared_ptr Manager::getSession(SessionID sessionID, - - void Manager::cleanStaleEntries() - { -+ uint8_t sessionIndex = 0; - for (auto iter = sessionsMap.begin(); iter != sessionsMap.end();) - { - auto session = iter->second; - if ((session->getBMCSessionID() != SESSION_ZERO) && - !(session->isSessionActive())) - { -+ sessionIndex = getSessionHandle(session->getBMCSessionID()); -+ sessionHandleMap[sessionIndex] = 0; - iter = sessionsMap.erase(iter); - } - else -@@ -164,4 +170,53 @@ void Manager::cleanStaleEntries() - } - } - -+uint8_t Manager::storeSessionHandle(SessionID bmcSessionID) -+{ -+ // Zero handler is reserved for invalid session. -+ //index starts with 1, for direct usage. Index 0 reserved -+ for (uint8_t i = 1; i <= MAX_SESSION_COUNT; i++) -+ { -+ if (sessionHandleMap[i] == 0) -+ { -+ sessionHandleMap[i] = bmcSessionID; -+ break; -+ } -+ } -+ return 0; -+} -+ -+uint32_t Manager::getSessionIDbyHandle(uint8_t sessionHandle) const -+{ -+ if (sessionHandle <= MAX_SESSION_COUNT) -+ { -+ return sessionHandleMap[sessionHandle]; -+ } -+ return 0; -+} -+ -+uint8_t Manager::getSessionHandle(SessionID bmcSessionID) const -+{ -+ -+ for (uint8_t i = 1; i <= MAX_SESSION_COUNT; i++) -+ { -+ if (sessionHandleMap[i] == bmcSessionID) -+ { -+ return i; -+ } -+ } -+ return 0; -+} -+uint8_t Manager::getNoOfActiveSession() const -+{ -+ uint8_t count = 0; -+ for (const auto& it : sessionsMap) -+ { -+ const auto& session = it.second; -+ if (session->state == State::ACTIVE) -+ { -+ count++; -+ } -+ } -+ return count; -+} - } // namespace session -diff --git a/sessions_manager.hpp b/sessions_manager.hpp -index 9fd38b1..f6ed1c3 100644 ---- a/sessions_manager.hpp -+++ b/sessions_manager.hpp -@@ -82,8 +82,15 @@ class Manager - std::shared_ptr - getSession(SessionID sessionID, - RetrieveOption option = RetrieveOption::BMC_SESSION_ID); -+ uint8_t getNoOfActiveSession() const; -+ uint8_t getSessionHandle(SessionID bmcSessionID) const; -+ uint8_t storeSessionHandle(SessionID bmcSessionID); -+ uint32_t getSessionIDbyHandle(uint8_t sessionHandle) const; - - private: -+ //+1 for session, as 0 is reserved for sessionless command -+ std::array sessionHandleMap; -+ - /** - * @brief Session Manager keeps the session objects as a sorted - * associative container with Session ID as the unique key -diff --git a/socket_channel.hpp b/socket_channel.hpp -index ebe0c8f..349701e 100644 ---- a/socket_channel.hpp -+++ b/socket_channel.hpp -@@ -64,6 +64,23 @@ class Channel - return endpoint.port(); - } - -+ /** -+ * @brief Return the binary representation of the remote IPv4 address -+ * -+ * getSessionInfo needs to return the remote IPv4 addresses of each session -+ * -+ * @return A uint32_t representation of the remote IPv4 address -+ */ -+ std::uint32_t getRemoteAddressInbytes() -+ { -+ const boost::asio::ip::address& addr = endpoint.address(); -+ if (addr.is_v4()) -+ { -+ return addr.to_v4().to_uint(); -+ } -+ return 0; -+ } -+ - /** - * @brief Read the incoming packet - * --- -2.17.1 - 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 deleted file mode 100644 index c6b87bf4f..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0008-Sync-GetSession-Info-cmd-based-on-Upstream-review.patch +++ /dev/null @@ -1,282 +0,0 @@ -From a413e390563205476656a9005ca447f5b626872f Mon Sep 17 00:00:00 2001 -From: Suryakanth Sekar -Date: Wed, 6 Mar 2019 10:35:56 +0530 -Subject: [PATCH 2/2] Sync GetSession Info cmd based on Upstream review - -Signed-off-by: Suryakanth Sekar ---- - comm_module.cpp | 12 +++---- - command/session_cmds.cpp | 71 ++++++++++++++++++---------------------- - sessions_manager.cpp | 10 +++--- - sessions_manager.hpp | 2 +- - socket_channel.hpp | 33 ++++++++++--------- - 5 files changed, 59 insertions(+), 69 deletions(-) - -diff --git a/comm_module.cpp b/comm_module.cpp -index 7a1a17d..2546583 100644 ---- a/comm_module.cpp -+++ b/comm_module.cpp -@@ -54,13 +54,11 @@ void sessionSetupCommands() - session::Privilege::CALLBACK, - false}, - // Session Info Command -- { -- { -- (static_cast(message::PayloadType::IPMI) << 16) | -- static_cast(command::NetFns::APP) | 0x3D -- }, -- &getSessionInfo, session::Privilege::USER, false -- }, -+ {{(static_cast(message::PayloadType::IPMI) << 16) | -+ static_cast(command::NetFns::APP) | 0x3D}, -+ &getSessionInfo, -+ session::Privilege::USER, -+ false}, - }; - - for (auto& iter : commands) -diff --git a/command/session_cmds.cpp b/command/session_cmds.cpp -index 4beeb6e..0c3a4ed 100644 ---- a/command/session_cmds.cpp -+++ b/command/session_cmds.cpp -@@ -8,7 +8,7 @@ - namespace command - { - --// Defined as per IPMI sepcification -+// Defined as per IPMI specification - static constexpr uint8_t searchCurrentSession = 0x00; - static constexpr uint8_t searchSessionByHandle = 0xFE; - static constexpr uint8_t searchSessionByID = 0xFF; -@@ -111,20 +111,6 @@ std::vector getSessionInfo(const std::vector& inPayload, - reinterpret_cast(outPayload.data()); - uint32_t reqSessionID = handler.sessionID; - response->completionCode = IPMI_CC_OK; -- if (inPayload.size() == 1 && request->sessionIndex != 0) -- { -- if (request->sessionIndex <= session::MAX_SESSION_COUNT) -- { -- reqSessionID = std::get(singletonPool) -- .getSessionIDbyHandle(request->sessionIndex); -- } -- else -- { -- response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST; -- outPayload.resize(sizeof(response->completionCode)); -- return std::move(outPayload); -- } -- } - - // Here we look for session info according to session index parameter - switch (request->sessionIndex) -@@ -132,29 +118,22 @@ std::vector getSessionInfo(const std::vector& inPayload, - // Look for current active session which this cmd is received over - case searchCurrentSession: - // Request data should only contain session index byte -- if (inPayload.size() != 1) -+ if (inPayload.size() != sizeof(request->sessionIndex)) - { - response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID; - outPayload.resize(sizeof(response->completionCode)); -- return std::move(outPayload); -- } -- // To look for current active session which the command came over, -- // the session ID cannot be 0. -- if (0 == reqSessionID) -- { -- response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST; -- outPayload.resize(sizeof(response->completionCode)); -- return std::move(outPayload); -+ return outPayload; - } - break; - case searchSessionByHandle: - // Request data should only contain session index byte and Session - // handle -- if (inPayload.size() != 2) -+ if (inPayload.size() != (sizeof(request->sessionIndex) + -+ sizeof(request->sessionHandle))) - { - response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID; - outPayload.resize(sizeof(response->completionCode)); -- return std::move(outPayload); -+ return outPayload; - } - - // Retrieve session id based on session handle -@@ -168,7 +147,7 @@ std::vector getSessionInfo(const std::vector& inPayload, - { - response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST; - outPayload.resize(sizeof(response->completionCode)); -- return std::move(outPayload); -+ return outPayload; - } - break; - case searchSessionByID: -@@ -178,23 +157,38 @@ std::vector getSessionInfo(const std::vector& inPayload, - { - response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID; - outPayload.resize(sizeof(response->completionCode)); -- return std::move(outPayload); -+ return outPayload; - } - reqSessionID = endian::from_ipmi(request->sessionID); - - break; - default: -- if (inPayload.size() != 1) -+ if (inPayload.size() == sizeof(request->sessionIndex)) -+ { -+ if (request->sessionIndex <= session::MAX_SESSION_COUNT) -+ { -+ reqSessionID = -+ std::get(singletonPool) -+ .getSessionIDbyHandle(request->sessionIndex); -+ } -+ else -+ { -+ response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID; -+ outPayload.resize(sizeof(response->completionCode)); -+ return outPayload; -+ } -+ } -+ else - { - response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID; - outPayload.resize(sizeof(response->completionCode)); -- return std::move(outPayload); -+ return outPayload; - } - } - - response->totalSessionCount = session::MAX_SESSION_COUNT; - response->activeSessioncount = -- std::get(singletonPool).getNoOfActiveSession(); -+ std::get(singletonPool).getActiveSessionCount(); - response->sessionHandle = 0; - if (reqSessionID != 0) - { -@@ -207,9 +201,9 @@ std::vector getSessionInfo(const std::vector& inPayload, - } - catch (std::exception& e) - { -- response->completionCode = IPMI_CC_UNSPECIFIED_ERROR; -+ response->completionCode = IPMI_CC_REQ_DATA_LEN_INVALID; - outPayload.resize(sizeof(response->completionCode)); -- return std::move(outPayload); -+ return outPayload; - } - response->sessionHandle = std::get(singletonPool) - .getSessionHandle(reqSessionID); -@@ -218,25 +212,24 @@ std::vector getSessionInfo(const std::vector& inPayload, - { - response->completionCode = IPMI_CC_UNSPECIFIED_ERROR; - outPayload.resize(sizeof(response->completionCode)); -- return std::move(outPayload); -+ return outPayload; - } - response->userID = userId; // userId; - response->privLevel = static_cast(sessionInfo->curPrivLevel); - response->chanNum = sessionInfo->chNum; // byte7 3:0 - response->ipmiVer = ipmi20VerSession; // byte7 7:4 -- response->remoteIpAddr = -- sessionInfo->channelPtr->getRemoteAddressInbytes(); - response->remotePort = - sessionInfo->channelPtr->getPort(); // remoteSessionPort; -+ response->remoteIpAddr = -+ sessionInfo->channelPtr->getRemoteAddressInBytes(); - -- std::cerr << "\nSessionInfo:" << (int)reqSessionID; - // TODO: Filling the Remote MACAddress - } - else - { - outPayload.resize(4); - } -- return std::move(outPayload); -+ return outPayload; - } - - } // namespace command -diff --git a/sessions_manager.cpp b/sessions_manager.cpp -index 9f3210b..c6897c6 100644 ---- a/sessions_manager.cpp -+++ b/sessions_manager.cpp -@@ -152,15 +152,13 @@ std::shared_ptr Manager::getSession(SessionID sessionID, - - void Manager::cleanStaleEntries() - { -- uint8_t sessionIndex = 0; - for (auto iter = sessionsMap.begin(); iter != sessionsMap.end();) - { - auto session = iter->second; - if ((session->getBMCSessionID() != SESSION_ZERO) && - !(session->isSessionActive())) - { -- sessionIndex = getSessionHandle(session->getBMCSessionID()); -- sessionHandleMap[sessionIndex] = 0; -+ sessionHandleMap[getSessionHandle(session->getBMCSessionID())] = 0; - iter = sessionsMap.erase(iter); - } - else -@@ -172,8 +170,8 @@ void Manager::cleanStaleEntries() - - uint8_t Manager::storeSessionHandle(SessionID bmcSessionID) - { -- // Zero handler is reserved for invalid session. -- //index starts with 1, for direct usage. Index 0 reserved -+ // Handler index 0 is reserved for invalid session. -+ // index starts with 1, for direct usage. Index 0 reserved - for (uint8_t i = 1; i <= MAX_SESSION_COUNT; i++) - { - if (sessionHandleMap[i] == 0) -@@ -206,7 +204,7 @@ uint8_t Manager::getSessionHandle(SessionID bmcSessionID) const - } - return 0; - } --uint8_t Manager::getNoOfActiveSession() const -+uint8_t Manager::getActiveSessionCount() const - { - uint8_t count = 0; - for (const auto& it : sessionsMap) -diff --git a/sessions_manager.hpp b/sessions_manager.hpp -index f6ed1c3..3ff213e 100644 ---- a/sessions_manager.hpp -+++ b/sessions_manager.hpp -@@ -82,7 +82,7 @@ class Manager - std::shared_ptr - getSession(SessionID sessionID, - RetrieveOption option = RetrieveOption::BMC_SESSION_ID); -- uint8_t getNoOfActiveSession() const; -+ uint8_t getActiveSessionCount() const; - uint8_t getSessionHandle(SessionID bmcSessionID) const; - uint8_t storeSessionHandle(SessionID bmcSessionID); - uint32_t getSessionIDbyHandle(uint8_t sessionHandle) const; -diff --git a/socket_channel.hpp b/socket_channel.hpp -index 349701e..8b64740 100644 ---- a/socket_channel.hpp -+++ b/socket_channel.hpp -@@ -107,14 +107,15 @@ class Channel - * - * @return A uint32_t representation of the remote IPv4 address - */ -- std::uint32_t getRemoteAddressInbytes() -+ 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(&remoteSockAddr); -+ v4addr = ntohl(saddr->sin_addr.s_addr); - } -- return 0; -+ return v4addr; - } - - /** --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch index c90cccf34..dc7f7357c 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch @@ -1,6 +1,6 @@ -From 6b9aaf0304aed06e4b5ac53e7c163089568d4171 Mon Sep 17 00:00:00 2001 +From 97c21a556702a0d65096b30c07ef23f15cb6a7d9 Mon Sep 17 00:00:00 2001 From: Cheng C Yang -Date: Sat, 23 Mar 2019 04:03:07 +0800 +Date: Wed, 3 Jul 2019 07:39:47 +0800 Subject: [PATCH] Add dbus interface for sol commands Add dbus interface for sol config parameters so that after move set/get @@ -25,22 +25,24 @@ to 0 and other properties will not reset to default value. Signed-off-by: Cheng C Yang --- - command/payload_cmds.cpp | 1 + - command/sol_cmds.cpp | 84 --------------------------------- - sol/sol_manager.cpp | 119 +++++++++++++++++++++++++++++++++++++++++++++++ + command/payload_cmds.cpp | 3 ++ + command/sol_cmds.cpp | 84 ------------------------------- + sol/sol_manager.cpp | 125 +++++++++++++++++++++++++++++++++++++++++++++++ sol/sol_manager.hpp | 1 + sol_module.cpp | 6 --- - 5 files changed, 121 insertions(+), 90 deletions(-) + 5 files changed, 129 insertions(+), 90 deletions(-) diff --git a/command/payload_cmds.cpp b/command/payload_cmds.cpp -index 3b5b4f8..570cdff 100644 +index c32a510..17167a7 100644 --- a/command/payload_cmds.cpp +++ b/command/payload_cmds.cpp -@@ -34,6 +34,7 @@ std::vector activatePayload(const std::vector& inPayload, +@@ -34,6 +34,9 @@ std::vector activatePayload(const std::vector& inPayload, return outPayload; } -+ std::get(singletonPool).updateSOLParameter(); ++ std::get(singletonPool) ++ .updateSOLParameter(ipmi::convertCurrentChannelNum( ++ ipmi::currentChNum, getInterfaceIndex())); if (!std::get(singletonPool).enable) { response->completionCode = IPMI_CC_PAYLOAD_TYPE_DISABLED; @@ -140,7 +142,7 @@ index a8fa410..804b5ea 100644 const message::Handler& handler) { diff --git a/sol/sol_manager.cpp b/sol/sol_manager.cpp -index 2046fe4..de36723 100644 +index 2046fe4..eedd28a 100644 --- a/sol/sol_manager.cpp +++ b/sol/sol_manager.cpp @@ -12,7 +12,13 @@ @@ -152,12 +154,12 @@ index 2046fe4..de36723 100644 +#include + +constexpr const char* solInterface = "xyz.openbmc_project.Ipmi.SOL"; -+constexpr const char* solPath = "/xyz/openbmc_project/ipmi/sol"; ++constexpr const char* solPath = "/xyz/openbmc_project/ipmi/sol/"; +constexpr const char* PROP_INTF = "org.freedesktop.DBus.Properties"; namespace sol { -@@ -93,6 +99,119 @@ void Manager::stopHostConsole() +@@ -93,6 +99,125 @@ void Manager::stopHostConsole() } } @@ -221,17 +223,19 @@ index 2046fe4..de36723 100644 + return properties; +} + -+void Manager::updateSOLParameter() ++void Manager::updateSOLParameter(uint8_t channelNum) +{ + std::variant value; + sdbusplus::bus::bus dbus(ipmid_get_sd_bus_connection()); + static std::string solService{}; + ipmi::PropertyMap properties; ++ std::string ethdevice = ipmi::getChannelName(channelNum); ++ std::string solPathWitheEthName = solPath + ethdevice; + if (solService.empty()) + { + try + { -+ solService = getService(dbus, solInterface, solPath); ++ solService = getService(dbus, solInterface, solPathWitheEthName); + } + catch (const std::runtime_error& e) + { @@ -243,8 +247,8 @@ index 2046fe4..de36723 100644 + } + try + { -+ properties = -+ getAllDbusProperties(dbus, solService, solPath, solInterface); ++ properties = getAllDbusProperties(dbus, solService, solPathWitheEthName, ++ solInterface); + } + catch (const std::runtime_error&) + { @@ -257,8 +261,12 @@ index 2046fe4..de36723 100644 + + enable = std::get(properties["Enable"]); + ++ forceEncrypt = std::get(properties["ForceEncryption"]); ++ ++ forceAuth = std::get(properties["ForceAuthentication"]); ++ + solMinPrivilege = static_cast( -+ std::get(properties["Authentication"])); ++ std::get(properties["Privilege"])); + + accumulateInterval = + std::get((properties["AccumulateIntervalMS"])) * @@ -278,14 +286,14 @@ index 2046fe4..de36723 100644 session::SessionID sessionID) { diff --git a/sol/sol_manager.hpp b/sol/sol_manager.hpp -index 5d96890..b7eb89e 100644 +index 5d96890..00da9fb 100644 --- a/sol/sol_manager.hpp +++ b/sol/sol_manager.hpp @@ -248,6 +248,7 @@ class Manager * @return 0 on success and errno on failure. */ int writeConsoleSocket(const std::vector& input) const; -+ void updateSOLParameter(void); ++ void updateSOLParameter(uint8_t channelNum); private: SOLPayloadMap payloadMap; @@ -307,5 +315,5 @@ index 8200e74..2b1fb46 100644 {{(static_cast(message::PayloadType::IPMI) << 16) | static_cast(::command::NetFns::TRANSPORT) | 0x22}, -- -2.16.2 +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 214bea189..05f10d980 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 @@ -2,8 +2,8 @@ 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 = "b31e969504645f653b58b676d56b01d632dc395c" +SRC_URI += "git://github.com/openbmc/phosphor-net-ipmid" +SRCREV = "0a269046d0d9fcd690ccbb129ae58a3c1450b04e" USERADD_PACKAGES = "${PN}" # add a group called ipmi @@ -20,10 +20,7 @@ SYSTEMD_SERVICE_${PN} += " \ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += " file://0006-Modify-dbus-namespace-of-chassis-control-for-guid.patch \ - file://0007-Adding-support-for-GetSessionInfo-command.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..b27961109 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 @@ -3,7 +3,7 @@ DESCRIPTION = "The Node Manager Proxy provides a simple interface for communicat with Management Engine via IPMB" SRC_URI = "git://git@github.com/Intel-BMC/node-manager;protocol=ssh" -SRCREV = "2ab90332828614c95e0ce22c0c95285734b55b65" +SRCREV = "06e8a1072b05d42e63cf70e2ceac7390578c051d" PV = "0.1+git${SRCPV}" LICENSE = "Apache-2.0" 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 65f578338..177f5c98f 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 @@ -2,7 +2,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" -SRCREV = "6a4cd36c0d46df11bdcd3b897bcc9c87e549a076" +SRCREV = "34d959285a3ca12c4bfefa4040d82d571c78843b" PV = "0.1+git${SRCPV}" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/phosphor-u-boot-mgr/phosphor-u-boot-mgr_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/phosphor-u-boot-mgr/phosphor-u-boot-mgr_git.bb new file mode 100644 index 000000000..c35289a57 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/phosphor-u-boot-mgr/phosphor-u-boot-mgr_git.bb @@ -0,0 +1,18 @@ +SUMMARY = "Phosphor U-Boot environment manager" +DESCRIPTION = "Daemon to read or write U-Boot environment variables" + +PV = "1.0+git${SRCPV}" + +S = "${WORKDIR}/git/phosphor-u-boot-env-mgr" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" + +SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh" + +SRCREV = "4611d8dcba0c0dc92156bbafdb50607aaff122ab" + +inherit cmake systemd +SYSTEMD_SERVICE_${PN} = "xyz.openbmc_project.U_Boot.Environment.Manager.service" + +DEPENDS = "boost sdbusplus phosphor-logging" 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 c7f78b1e3..e97c40c1c 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 @@ -18,11 +18,24 @@ # provide a couple of places in the RO root filesystem # that can be made RW with an overlayfs +log() { + [ -c /dev/kmsg ] && echo "init: $@" > /dev/kmsg + echo "init: $@" +} + # start with /proc and /tmp mounted [ -e /proc/mounts ] || mount -t proc proc /proc grep -q /tmp /proc/mounts || mount -t tmpfs -o rw,nosuid,nodev tmp /tmp grep -q /sys /proc/mounts || mount -t sysfs -o rw,nosuid,nodev,noexec sys /sys +if grep -q debug-init /proc/cmdline; then + exec > /tmp/init.log 2>&1 + set -x +else + # silent bob + exec >/dev/null 2>&1 +fi + # list of things that need to be rw at boot NV_OVERLAYS="/etc /var /home" @@ -61,86 +74,100 @@ nvrw() { mount -t overlay -o "$opts" "$mname" "$p" } -targetted_clean() { - local LOG_TAG="restore-defaults" - # Do not delete server certificates for the web server or ssh - echo "removing targetted contents:" - cd "${RWFS_MNT}/etc" - for file in *; do - case $file in - # The only files that stay are here: - CA|RestoreDefaultConfiguration|dropbear|sdr|server.pem);; - # All else get removed. - *) echo "remove $file" - rm -rf $file;; - esac - done +targeted_clean() { + log "restore-defaults: targeted_clean" + # Do not delete FRU info, ssh/ssl certs, or machine-id + ( + cd "${RWFS_MNT}/etc" + find . ! -regex '.*\(/ssl\|/dropbear\|/machine-id\(_bkup\)\?\|/fru\).*' -exec rm -rf {} + + ) # nothing should be in the workdir, but clear it just in case rm -rf "${RWFS_MNT}/etc.work" - # Log files remaining - but not to stdout. - echo "Files remaining: $(ls)" + # clean everything out of /home + rm -rf "${RWFS_MNT}/home" "${RWFS_MNT}/home.work" # clean everything out of /var rm -rf "${RWFS_MNT}/var" "${RWFS_MNT}/var.work" + + echo "Files remaining: $(find $RWFS_MNT/)" + sync } full_clean() { + log "restore-defaults: full_clean" local OVL='' for OVL in $NV_OVERLAYS; do rm -rf "${RWFS_MNT}${OVL}" "${RWFS_MNT}${OVL}.work" done + sync } - -# check for full factory reset: if so, ubiformat $NV_MTD_DEV -bootflags="0x$(sed -n 's/^.*bootflags=\([0-9a-f]*\).*$/\1/p' /proc/cmdline)" -bootflags=$((bootflags + 0)) -let "restore_op = $bootflags & 0x3" -if [ $restore_op -eq 3 ]; then - ubiformat -y "$NV_MTD_DEV" -fi - # attach a UBI device to the MTD device -NV_UBI_DEV="/dev/ubi${NV_MTD_NUM}" -if [ ! -e $NV_UBI_DEV ]; then - if ! ubiattach -m "$NV_MTD_NUM" -d "$NV_MTD_NUM"; then - # the attach failed, so format the MTD device and try again - echo "Warning! Failed to attach $NV_UBI_DEV to $NV_MTD_DEV." - echo "UBI-formatting $NV_MTD_DEV to attach again. Data on this device will be lost." - ubiformat -y "$NV_MTD_DEV" - ubiattach -m "$NV_MTD_NUM" -d "$NV_MTD_NUM" +prepare_ubi_volume() { + local nv_num="$1" + local mtd="/dev/mtd${nv_num}" + local ubi="/dev/ubi${nv_num}" + if [ ! -e $ubi ]; then + if ! ubiattach -m "$nv_num" -d "$nv_num"; then + # the attach failed, so format the MTD device and try again + log "Warning! Failed to attach $ubi to $mtd." + log "UBI-formatting $mtd to attach again. Data on this device will be lost." + ubiformat -y "$mtd" + ubiattach -m "$nv_num" -d "$nv_num" + fi fi -fi -# make a UBI volume on the UBI device -NV_UBI_VOL="${NV_UBI_DEV}_0" -if [ ! -e $NV_UBI_VOL ]; then - ubimkvol "$NV_UBI_DEV" -N "$NV_MTD" -m -fi + # make a UBI volume on the UBI device + local vol="${ubi}_0" + if [ ! -e $vol ]; then + ubimkvol "$ubi" -N "$mtd" -m + fi +} + +reformat_ubi_volume() { + local nv_num="$1" + local mnt="$2" + local ubi="/dev/ubi${nv_num}" + local vol="${ubi}_0" + # unmount the volume to reformat it + umount -f "$mnt" + ubidetach -m $nv_num + ubiformat -y "$ubi" + prepare_ubi_volume $nv_num + # remount the UBIFS on the UBI volume + mount -t ubifs "$vol" "$mnt" + if [ $? -ne 0 ]; then + log "Failed to mount reformatted NV volume; system unstable" + fi +} # mount a UBIFS on the UBI volume -mount -t ubifs "$NV_UBI_VOL" "$RWFS_MNT" +prepare_ubi_volume $NV_MTD_NUM +mount -t ubifs "/dev/ubi${NV_MTD_NUM}_0" "$RWFS_MNT" +if [ $? -ne 0 ]; then + log "Failed to mount NV volume; attempting recovery" + reformat_ubi_volume $NV_MTD_NUM $RWFS_MNT +fi +# check for full factory reset: if so, ubiformat $NV_MTD_DEV +RESTORE_FLAG=$RWFS_MNT/.restore_op +restore_op=$(cat $RESTORE_FLAG) # read from NV +restore_op=${restore_op:-0} # set default value 0 +restore_op=$((restore_op & 3)) # mask off 2 bits if [ $restore_op -eq 1 ]; then - targetted_clean + targeted_clean elif [ $restore_op -eq 2 ]; then full_clean +elif [ $restore_op -eq 3 ]; then + log "restore-defaults: reformat" + reformat_ubi_volume $NV_MTD_NUM $RWFS_MNT fi +rm -f $RESTORE_FLAG for FS in $NV_OVERLAYS; do nvrw "$FS" done -# make sure that /etc/fw_env.config mirrors our current uboot environment -UENV_MTD_INFO=$(grep UENV /proc/mtd) -if [ -n "$UENV_MTD_INFO" ]; then - UENV_MTD_INFO=$(echo "$UENV_MTD_INFO" | sed 's,^\([^:]*\): \([0-9a-f]*\) \([0-9a-f]*\) .*,/dev/\1 0 0x\2 0x\3,') - if ! grep -q "^${UENV_MTD_INFO}$" /etc/fw_env.config; then - echo "${UENV_MTD_INFO}" > /etc/fw_env.config - echo "Updated fw_env.config" - fi -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 @@ -163,41 +190,28 @@ if [ ! -s "$MACHINE_ID" ]; then else generate_machine_id fi - echo "Remounted /etc for machine-id origin mismatch" + log "Remounted /etc for machine-id origin mismatch" else generate_machine_id fi fi # mount persistent NV filesystem, where immortal settings live +SOFS_MNT=/var/sofs if ! grep -q sofs /proc/mounts; then - mkdir -p /var/sofs + mkdir -p $SOFS_MNT SOFS_MTD=sofs - SOFS_MTD_DEV="$(mtd_by_name ${SOFS_MTD})" SOFS_MTD_NUM="$(mtdnum_by_name ${SOFS_MTD})" - SOFS_UBI_DEV="/dev/ubi${SOFS_MTD_NUM}" - - # attach a UBI device to the MTD device - if [ ! -e $SOFS_UBI_DEV ]; then - if ! ubiattach -m "$SOFS_MTD_NUM" -d "$SOFS_MTD_NUM"; then - # the attach failed, so format the MTD device and try again - echo "Warning! Failed to attach $SOFS_UBI_DEV to $SOFS_MTD_DEV." - echo "UBI-formatting $SOFS_MTD_DEV to attach again. Data on this device will be lost." - ubiformat -y "$SOFS_MTD_DEV" - ubiattach -m "$SOFS_MTD_NUM" -d "$SOFS_MTD_NUM" - fi - fi - - # make a UBI volume on the UBI device - SOFS_UBI_VOL="${SOFS_UBI_DEV}_0" - if [ ! -e $SOFS_UBI_VOL ]; then - ubimkvol "$SOFS_UBI_DEV" -N "$SOFS_MTD" -m - fi # mount a UBIFS on the UBI volume - mount -t ubifs "$SOFS_UBI_VOL" /var/sofs + prepare_ubi_volume $SOFS_MTD_NUM + mount -t ubifs "/dev/ubi${SOFS_MTD_NUM}_0" "$SOFS_MNT" + if [ $? -ne 0 ]; then + log "Failed to mount SOFS volume; attempting recovery" + reformat_ubi_volume $SOFS_MTD_NUM $SOFS_MNT + fi fi -echo "Finished mounting non-volatile overlays" +log "Finished mounting non-volatile overlays" exec /lib/systemd/systemd diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/prov-mode-mgr/prov-mode-mgr_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/prov-mode-mgr/prov-mode-mgr_git.bb new file mode 100644 index 000000000..a37d3ec9c --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/prov-mode-mgr/prov-mode-mgr_git.bb @@ -0,0 +1,18 @@ +SUMMARY = "Provision mode daemon - RestrictionMode" +DESCRIPTION = "Daemon allows to configure RestrictionMode property" + +PV = "1.0+git${SRCPV}" + +S = "${WORKDIR}/git/prov-mode-mgr" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" + +SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh" + +SRCREV = "4611d8dcba0c0dc92156bbafdb50607aaff122ab" + +inherit cmake systemd +SYSTEMD_SERVICE_${PN} = "xyz.openbmc_project.RestrictionMode.Manager.service" + +DEPENDS = "boost sdbusplus phosphor-logging" 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 2cdc93e29..fcdef4e02 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,6 @@ # Enable downstream autobump SRC_URI = "git://github.com/openbmc/phosphor-sel-logger.git" -SRCREV = "c4a336fb15464b9f4a7328c02cb43285a6eb1e58" +SRCREV = "3d300fca24b30864b3e9a4f5768cfe5e769458ae" # Enable threshold monitoring EXTRA_OECMAKE += "-DSEL_LOGGER_MONITOR_THRESHOLD_EVENTS=ON" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend index ca3c2eba0..3e3282f6f 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend @@ -1,7 +1,7 @@ -SRCREV = "52497fd0fbd8adfe099a99f23515cd0341898e2e" +SRCREV = "1cbd1c6da17a85ec7213744cf2d1e56fcba3e34e" SRC_URI = "git://github.com/openbmc/dbus-sensors.git" DEPENDS_append = " libgpiod" #todo(cheng) remove this when synced upstream -SYSTEMD_SERVICE_${PN} += " xyz.openbmc_project.psusensor.service" +SYSTEMD_SERVICE_${PN} += " xyz.openbmc_project.mcutempsensor.service" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native.bbappend deleted file mode 100644 index 436623234..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native.bbappend +++ /dev/null @@ -1,4 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -SRC_URI += "file://defaults.yaml \ - " 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 deleted file mode 100644 index 05d3df07e..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-defaults-native/defaults.yaml +++ /dev/null @@ -1,209 +0,0 @@ -/xyz/openbmc_project/control/minimum_ship_level_required: - - Interface: xyz.openbmc_project.Control.MinimumShipLevel - Properties: - MinimumShipLevelRequired: - Default: 'true' - -/xyz/openbmc_project/control/host0/auto_reboot: - - Interface: xyz.openbmc_project.Control.Boot.RebootPolicy - Properties: - AutoReboot: - Default: 'false' - -/xyz/openbmc_project/control/host0/boot: - - Interface: xyz.openbmc_project.Control.Boot.Source - Properties: - BootSource: - Default: Source::Sources::Default - - Interface: xyz.openbmc_project.Control.Boot.Mode - Properties: - BootMode: - Default: Mode::Modes::Regular - -/xyz/openbmc_project/control/host0/boot/one_time: - - Interface: xyz.openbmc_project.Control.Boot.Source - Properties: - BootSource: - Default: Source::Sources::Default - - Interface: xyz.openbmc_project.Control.Boot.Mode - Properties: - BootMode: - Default: Mode::Modes::Regular - - Interface: xyz.openbmc_project.Object.Enable - Properties: - Enabled: - Default: 'true' - -/xyz/openbmc_project/control/host0/power_cap: - - Interface: xyz.openbmc_project.Control.Power.Cap - Properties: - PowerCap: - Default: 0 - Validation: - Type: "range" - Validator: "0..1000" - Unit: "Watts" - PowerCapEnable: - Default: 'false' - -/xyz/openbmc_project/control/host0/power_restore_policy: - - Interface: xyz.openbmc_project.Control.Power.RestorePolicy - Properties: - PowerRestorePolicy: - Default: RestorePolicy::Policy::AlwaysOff - -/xyz/openbmc_project/control/power_restore_delay: - - Interface: xyz.openbmc_project.Control.Power.RestoreDelay - Properties: - PowerRestoreDelay: - Default: 0 - -/xyz/openbmc_project/control/host0/acpi_power_state: - - Interface: xyz.openbmc_project.Control.Power.ACPIPowerState - Properties: - SysACPIStatus: - Default: ACPIPowerState::ACPI::Unknown - DevACPIStatus: - Default: ACPIPowerState::ACPI::Unknown - -/xyz/openbmc_project/time/owner: - - Interface: xyz.openbmc_project.Time.Owner - Properties: - TimeOwner: - Default: Owner::Owners::BMC - -/xyz/openbmc_project/time/sync_method: - - Interface: xyz.openbmc_project.Time.Synchronization - Properties: - TimeSyncMethod: - Default: Synchronization::Method::NTP - -/xyz/openbmc_project/network/host0/intf: - - Interface: xyz.openbmc_project.Network.MACAddress - Properties: - MACAddress: - Default: '"00:00:00:00:00:00"' - Validation: - Type: "regex" - Validator: '^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$' - -#needs to implement address validation TODO openbmc/issues/2046 -/xyz/openbmc_project/network/host0/intf/addr: - - Interface: xyz.openbmc_project.Network.IP - Properties: - Address: - Default: '"0.0.0.0"' - PrefixLength: - Default: 0 - Validation: - Type: "range" - Validator: 0..128 - Unit: "bits" - Origin: - Default: IP::AddressOrigin::Static - Gateway: - Default: '"0.0.0.0"' - Type: - Default: IP::Protocol::IPv4 - -/xyz/openbmc_project/control/host0/restriction_mode: - - Interface: xyz.openbmc_project.Control.Security.RestrictionMode - Properties: - RestrictionMode: - Default: RestrictionMode::Modes::Provisioning - -/xyz/openbmc_project/control/host0/TPMEnable: - - Interface: xyz.openbmc_project.Control.TPM.Policy - Properties: - TPMEnable: - Default: 'false' - -/xyz/openbmc_project/control/power_supply_redundancy: - - Interface: xyz.openbmc_project.Control.PowerSupplyRedundancy - Properties: - PowerSupplyRedundancyEnabled: - Default: 'true' - -/xyz/openbmc_project/control/host0/turbo_allowed: - - Interface: xyz.openbmc_project.Control.Host.TurboAllowed - Properties: - TurboAllowed: - Default: 'true' - -/xyz/openbmc_project/control/host0/systemGUID: - - Interface: xyz.openbmc_project.Common.UUID - Properties: - UUID: - Default: '"00000000-0000-0000-0000-000000000000"' - -/xyz/openbmc_project/bios: - - Interface: xyz.openbmc_project.Inventory.Item.Bios - Properties: - BiosId: - Default: '"NA"' - -/xyz/openbmc_project/control/processor_error_config: - - Interface: xyz.openbmc_project.Control.Processor.ErrConfig - Properties: - ResetCfg: - Default: 0 - ResetErrorOccurrenceCounts: - Default: 0 - -/com/intel/control/ocotshutdown_policy_config: - - Interface: com.intel.Control.OCOTShutdownPolicy - Properties: - OCOTPolicy: - Default: OCOTShutdownPolicy::Policy::NoShutdownOnOCOT - -/xyz/openbmc_project/control/chassis_capabilities_config: - - Interface: xyz.openbmc_project.Control.ChassisCapabilities - Properties: - CapabilitiesFlags: - Default: 0 - FRUDeviceAddress: - Default: 0x20 - SDRDeviceAddress: - Default: 0x20 - SELDeviceAddress: - Default: 0x20 - SMDeviceAddress: - Default: 0x20 - BridgeDeviceAddress: - Default: 0x20 - -/xyz/openbmc_project/control/thermal_mode: - - Interface: xyz.openbmc_project.Control.ThermalMode - Properties: - Current: - Default: '"Performance"' - Supported: - Default: '{"Acoustic", "Performance"}' - -/xyz/openbmc_project/control/cfm_limit: - - Interface: xyz.openbmc_project.Control.CFMLimit - Properties: - Limit: - Default: 0 - -/xyz/openbmc_project/ipmi/sol: - - Interface: xyz.openbmc_project.Ipmi.SOL - Properties: - Progress: - Default: 0 - Enable: - Default: 'true' - ForceEncryption: - Default: 'true' - ForceAuthentication: - Default: 'true' - Privilege: - Default: 4 - AccumulateIntervalMS: - Default: 12 - Threshold: - Default: 96 - RetryCount: - Default: 6 - RetryIntervalMS: - Default: 20 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager/0001-settings-initialize-data-file-with-default-setting.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager/0001-settings-initialize-data-file-with-default-setting.patch deleted file mode 100644 index fcf2415d6..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager/0001-settings-initialize-data-file-with-default-setting.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 9e99aa4f72f4420e03ec2e4a29816eae43c5e748 Mon Sep 17 00:00:00 2001 -From: "Jia, Chunhui" -Date: Tue, 29 May 2018 16:16:06 +0800 -Subject: [PATCH] [settings] initialize data file with default setting - -Current code trys to load settings from file at startup. When file -does not exist, it will just use default setting. However, it will -still load default on next reboot because no one create files. - -This change creates file as well when daemon loads default so next -time daemon could load/save from file. - -Signed-off-by: Jia, Chunhui ---- - settings_manager.mako.hpp | 3 +++ - 1 file changed, 3 insertions(+) - mode change 100644 => 100755 settings_manager.mako.hpp - -diff --git a/settings_manager.mako.hpp b/settings_manager.mako.hpp -old mode 100644 -new mode 100755 -index 09a5a1f..cd592a0 ---- a/settings_manager.mako.hpp -+++ b/settings_manager.mako.hpp -@@ -323,6 +323,9 @@ class Manager - else - { - initSetting${index}(); -+ std::ofstream ostr(path.c_str(), std::ios::out); -+ cereal::JSONOutputArchive oarchive(ostr); -+ oarchive(*std::get<${index}>(settings)); //create file with default - } - } - catch (cereal::Exception& e) --- -2.16.2 - 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 deleted file mode 100644 index f5c924b31..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/phosphor-settings-manager_%.bbappend +++ /dev/null @@ -1,9 +0,0 @@ -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/settings/settings_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/settings/settings_git.bb index aadb48fbf..50f644f37 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/settings/settings_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/settings/settings_git.bb @@ -1,7 +1,7 @@ SUMMARY = "Settings" -SRC_URI = "git://git-amr-2.devtools.intel.com:29418/openbmc-provingground.git;protocol=ssh" -SRCREV = "4373d99e1edcbb4c7233abde3a5e53690693007b" +SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh" +SRCREV = "4611d8dcba0c0dc92156bbafdb50607aaff122ab" PV = "0.1+git${SRCPV}" LICENSE = "Apache-2.0" 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 index 99cac7931..736277dce 100644 --- 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 @@ -9,7 +9,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh" -SRCREV = "4373d99e1edcbb4c7233abde3a5e53690693007b" +SRCREV = "4611d8dcba0c0dc92156bbafdb50607aaff122ab" inherit cmake systemd SYSTEMD_SERVICE_${PN} = "specialmodemgr.service" 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 52ebdfd88..30d92ea38 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/srvcfg-manager/srvcfg-manager_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/srvcfg-manager/srvcfg-manager_git.bb @@ -9,7 +9,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh" -SRCREV = "4373d99e1edcbb4c7233abde3a5e53690693007b" +SRCREV = "4611d8dcba0c0dc92156bbafdb50607aaff122ab" inherit cmake systemd SYSTEMD_SERVICE_${PN} = "srvcfg-manager.service" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0001-Modify-dbus-interface-for-power-control.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0001-Modify-dbus-interface-for-power-control.patch deleted file mode 100644 index fac9b52f1..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0001-Modify-dbus-interface-for-power-control.patch +++ /dev/null @@ -1,38 +0,0 @@ -From d34a2a5f6ca0564275ed0e2664624525cad64585 Mon Sep 17 00:00:00 2001 -From: Yong Li -Date: Fri, 13 Jul 2018 09:08:52 +0800 -Subject: [PATCH] Modify dbus interface for power control -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Switch power control service namespace from “org” to “xyz”, -to compatible with new intel-chassis services - -Change-Id: I1bf5e218f72eb9fd4fb6f203c35479818d12b1fa -Signed-off-by: Yong Li ---- - chassis_state_manager.cpp | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/chassis_state_manager.cpp b/chassis_state_manager.cpp -index 03dd176..05e2440 100644 ---- a/chassis_state_manager.cpp -+++ b/chassis_state_manager.cpp -@@ -63,10 +63,11 @@ void Chassis::determineInitialState() - { - sdbusplus::message::variant pgood = -1; - auto method = this->bus.new_method_call( -- "org.openbmc.control.Power", "/org/openbmc/control/power0", -+ "xyz.openbmc_project.Chassis.Control.Power", -+ "/xyz/openbmc_project/Chassis/Control/Power0", - "org.freedesktop.DBus.Properties", "Get"); - -- method.append("org.openbmc.control.Power", "pgood"); -+ method.append("xyz.openbmc_project.Chassis.Control.Power", "pgood"); - try - { - auto reply = this->bus.call(method); --- -2.7.4 - 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 deleted file mode 100644 index 2adff372e..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0002-Capture-host-restart-cause.patch +++ /dev/null @@ -1,338 +0,0 @@ -From ed64fe7379a259a822aca69e70426a2b07aad25d Mon Sep 17 00:00:00 2001 -From: Kuiying Wang -Date: Tue, 7 Aug 2018 16:43:00 +0800 -Subject: [PATCH] Capture host restart cause - -Capture host restart cause on power/reset button pressed, -ipmi command/webui, host OS reboot(Ctrl-Alt-Del), -and power restore policy settings. -Save the restart cause into file system, -and restore it when BMC boot up. - -Signed-off-by: Kuiying Wang -Signed-off-by: Yong Li ---- - 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 7919ec5..051a0c0 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -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]) - --AC_ARG_VAR(HOST_STATE_PERSIST_PATH, [Path of file for storing requested host state.]) -+AC_ARG_VAR(HOST_STATE_PERSIST_PATH, [Path of file for storing host state.]) - AS_IF([test "x$HOST_STATE_PERSIST_PATH" == "x"], \ -- [HOST_STATE_PERSIST_PATH="/var/lib/phosphor-state-manager/requestedHostTransition"]) -+ [HOST_STATE_PERSIST_PATH="/var/lib/phosphor-state-manager/hostState"]) - AC_DEFINE_UNQUOTED([HOST_STATE_PERSIST_PATH], ["$HOST_STATE_PERSIST_PATH"], \ - [Path of file for storing requested host state.]) - -diff --git a/discover_system_state.cpp b/discover_system_state.cpp -index 3a38152..0b5798a 100644 ---- a/discover_system_state.cpp -+++ b/discover_system_state.cpp -@@ -12,6 +12,7 @@ - #include "settings.hpp" - #include "xyz/openbmc_project/Common/error.hpp" - #include "xyz/openbmc_project/Control/Power/RestorePolicy/server.hpp" -+#include - - namespace phosphor - { -@@ -181,6 +182,10 @@ int main(int argc, char** argv) - log("power_policy=ALWAYS_POWER_ON, powering host on"); - setProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition", - convertForMessage(server::Host::Transition::On)); -+ -+ setProperty( -+ bus, hostPath, HOST_BUSNAME, "HostRestartCause", -+ convertForMessage(server::Host::RestartCause::PowerPolicyAlwaysOn)); - } - else if (RestorePolicy::Policy::Restore == - RestorePolicy::convertPolicyFromString(powerPolicy)) -@@ -192,6 +197,15 @@ int main(int argc, char** argv) - getProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition"); - setProperty(bus, hostPath, HOST_BUSNAME, "RequestedHostTransition", - hostReqState); -+ -+ if (server::Host::convertTransitionFromString(hostReqState) == -+ server::Host::Transition::On) -+ { -+ setProperty( -+ bus, hostPath, HOST_BUSNAME, "HostRestartCause", -+ convertForMessage( -+ server::Host::RestartCause::PowerPolicyPreviousState)); -+ } - } - - return 0; -diff --git a/host_state_manager.cpp b/host_state_manager.cpp -index 7d661dd..0e00e78 100644 ---- a/host_state_manager.cpp -+++ b/host_state_manager.cpp -@@ -308,6 +308,15 @@ bool Host::deserialize(const fs::path& path) - } - } - -+void Host::restoreHostRestartCause() -+{ -+ if (!deserialize(HOST_STATE_PERSIST_PATH)) -+ { -+ // set to default value -+ server::Host::hostRestartCause(server::Host::RestartCause::Unknown); -+ } -+} -+ - Host::Transition Host::requestedHostTransition(Transition value) - { - log("Host State transaction request", -@@ -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); - } - -+Host::RestartCause Host::hostRestartCause(RestartCause value) -+{ -+ auto retVal = server::Host::hostRestartCause(value); -+ serialize(); -+ return retVal; -+} -+ - } // namespace manager - } // namespace state - } // namespace phosphor -diff --git a/host_state_manager.hpp b/host_state_manager.hpp -index 2b00777..afd8aa3 100644 ---- a/host_state_manager.hpp -+++ b/host_state_manager.hpp -@@ -32,6 +32,22 @@ using namespace phosphor::logging; - namespace sdbusRule = sdbusplus::bus::match::rules; - namespace fs = std::experimental::filesystem; - -+const static constexpr char* powerButtonPath = -+ "/xyz/openbmc_project/Chassis/Buttons/Power0"; -+const static constexpr char* powerButtonIntf = -+ "xyz.openbmc_project.Chassis.Buttons.Power"; -+const static constexpr char* resetButtonPath = -+ "/xyz/openbmc_project/Chassis/Buttons/Reset0"; -+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,8 +75,93 @@ class Host : public HostInherit - sdbusRule::interface("org.freedesktop.systemd1.Manager"), - std::bind(std::mem_fn(&Host::sysStateChange), this, - std::placeholders::_1)), -- settings(bus) -+ settings(bus), -+ powerButtonPressedSignal( -+ bus, -+ sdbusRule::type::signal() + sdbusRule::member("Pressed") + -+ sdbusRule::path(powerButtonPath) + -+ sdbusRule::interface(powerButtonIntf), -+ [this](sdbusplus::message::message& msg) { -+ phosphor::logging::log( -+ "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( -+ "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( -+ "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 props; -+ std::vector 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(value); -+ } -+ -+ else if (key == "post_complete") -+ { -+ bool postState = -+ sdbusplus::message::variant_ns::get(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,8 +170,29 @@ class Host : public HostInherit - - attemptsLeft(BOOT_COUNT_MAX_ALLOWED); - -+ 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 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(pgoodProp); -+ } -+ catch (const sdbusplus::exception::SdBusError& e) -+ { -+ log("Error performing call to get pgood", -+ entry("NAME=%s", e.name()), -+ entry("ERROR=%s", e.what())); -+ } - } - - /** @brief Set value of HostTransition */ -@@ -85,6 +207,9 @@ class Host : public HostInherit - /** @brief Set value of CurrentHostState */ - HostState currentHostState(HostState value) override; - -+ /** @brief Set value of HostRestartCause */ -+ RestartCause hostRestartCause(RestartCause value) override; -+ - /** - * @brief Set host reboot count to default - * -@@ -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())); - } - - /** @brief Function required by Cereal to perform deserialization. -@@ -208,7 +335,8 @@ class Host : public HostInherit - std::string reqTranState; - std::string bootProgress; - std::string osState; -- archive(reqTranState, bootProgress, osState); -+ std::string restartCause; -+ archive(reqTranState, bootProgress, osState, restartCause); - 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 +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)); - } - - /** @brief Serialize and persist requested host state -@@ -239,6 +369,9 @@ class Host : public HostInherit - */ - bool deserialize(const fs::path& path); - -+ /** @brief Used to restore HostRestartCause value from persisted file */ -+ void restoreHostRestartCause(); -+ - /** @brief Persistent sdbusplus DBus bus connection. */ - sdbusplus::bus::bus& bus; - -@@ -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 --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0003-Use-warm-reboot-for-the-Reboot-host-state-transition.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0003-Use-warm-reboot-for-the-Reboot-host-state-transition.patch deleted file mode 100644 index 40722c3c9..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0003-Use-warm-reboot-for-the-Reboot-host-state-transition.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 8a7f73a0688524c71023da89e8cb5578dac16f5d Mon Sep 17 00:00:00 2001 -From: Yong Li -Date: Fri, 8 Mar 2019 17:21:49 +0800 -Subject: [PATCH] Use warm-reboot for the Reboot host state transition - -The same as reset button pressing, the pgood signal will keep on during the reboot - -Tested By: -ipmitool chassis power reset -The pgood(gpio219) will be keep high during the reset process - -Signed-off-by: Yong Li ---- - host_state_manager.cpp | 20 +++++++++++++------- - 1 file changed, 13 insertions(+), 7 deletions(-) - -diff --git a/host_state_manager.cpp b/host_state_manager.cpp -index 03d210d..8fac348 100644 ---- a/host_state_manager.cpp -+++ b/host_state_manager.cpp -@@ -44,8 +44,9 @@ constexpr auto HOST_STATE_SOFT_POWEROFF_TGT = "obmc-host-shutdown@0.target"; - constexpr auto HOST_STATE_POWEROFF_TGT = "obmc-host-stop@0.target"; - constexpr auto HOST_STATE_POWERON_TGT = "obmc-host-start@0.target"; - constexpr auto HOST_STATE_POWERON_MIN_TGT = "obmc-host-startmin@0.target"; --constexpr auto HOST_STATE_REBOOT_TGT = "obmc-host-reboot@0.target"; -+constexpr auto HOST_STATE_REBOOT_TGT = "obmc-host-warm-reset@0.target"; - constexpr auto HOST_STATE_QUIESCE_TGT = "obmc-host-quiesce@0.target"; -+constexpr auto hostStateRebootService = "intel-power-warm-reset@0.service"; - - constexpr auto ACTIVE_STATE = "active"; - constexpr auto ACTIVATING_STATE = "activating"; -@@ -168,6 +169,7 @@ bool Host::stateActive(const std::string& target) - - const auto& currentStateStr = - sdbusplus::message::variant_ns::get(currentState); -+ - return currentStateStr == ACTIVE_STATE || - currentStateStr == ACTIVATING_STATE; - } -@@ -236,18 +238,22 @@ void Host::sysStateChange(sdbusplus::message::message& msg) - // Read the msg and populate each variable - msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult); - -- if ((newStateUnit == HOST_STATE_POWEROFF_TGT) && -- (newStateResult == "done") && -- (!stateActive(HOST_STATE_POWERON_MIN_TGT))) -+ if (((newStateUnit == HOST_STATE_POWEROFF_TGT) && -+ (newStateResult == "done") && -+ (!stateActive(HOST_STATE_POWERON_MIN_TGT))) || -+ ((newStateUnit == hostStateRebootService) && -+ (newStateResult == "done"))) - { - log("Received signal that host is off"); - this->currentHostState(server::Host::HostState::Off); - this->bootProgress(bootprogress::Progress::ProgressStages::Unspecified); - this->operatingSystemState(osstatus::Status::OSStatus::Inactive); - } -- else if ((newStateUnit == HOST_STATE_POWERON_MIN_TGT) && -- (newStateResult == "done") && -- (stateActive(HOST_STATE_POWERON_MIN_TGT))) -+ else if (((newStateUnit == HOST_STATE_POWERON_MIN_TGT) && -+ (newStateResult == "done") && -+ (stateActive(HOST_STATE_POWERON_MIN_TGT))) || -+ ((newStateUnit == HOST_STATE_REBOOT_TGT) && -+ (newStateResult == "done"))) - { - log("Received signal that host is running"); - this->currentHostState(server::Host::HostState::Running); --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/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 deleted file mode 100644 index 31cb31079..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/0004-Add-Power-Restore-delay-support.patch +++ /dev/null @@ -1,141 +0,0 @@ -From 0edff651156ae63b6a73d9cb81e5e76cc6ae501a Mon Sep 17 00:00:00 2001 -From: Yong Li -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 ---- - 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 --#include - #include - #include - #include -@@ -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 variant; -+ reply.read(variant); -+ delay = sdbusplus::message::variant_ns::get(variant); -+ } -+ catch (sdbusplus::exception_t&) -+ { -+ phosphor::logging::log( -+ "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("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("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("getPowerRestoreDelay failed!"); -+ delay = 0; -+ } -+ - if (RestorePolicy::Policy::AlwaysOn == - RestorePolicy::convertPolicyFromString(powerPolicy)) - { -+ applyPowerRestoreDelay(delay); -+ - log("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/phosphor-reboot-host@.service b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reboot-host@.service deleted file mode 100644 index ffde01ca3..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reboot-host@.service +++ /dev/null @@ -1,18 +0,0 @@ -[Unit] -Description=Reboot host%i -Wants=obmc-host-stop@%i.target -After=obmc-host-stop@%i.target - -[Service] -#ExecStart={base_bindir}/systemctl start obmc-host-start@%i.target -# This service is starting another target that conflicts with the -# target this service is running in. OpenBMC needs a refactor of -# how it does its host reset path. Until then, this short term -# solution does the job. -# Since this is a part of the reboot target, call the startmin -# target which does the minimum required to start the host. -ExecStart=/bin/sh -c "sleep 10 && systemctl start obmc-host-startmin@%i.target" - - -[Install] -WantedBy=obmc-host-reboot@%i.target diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-check@.service b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-check@.service deleted file mode 100644 index 13b8f0fca..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-check@.service +++ /dev/null @@ -1,19 +0,0 @@ -[Unit] -Description=Check Host%i status on BMC reset -Wants=mapper-wait@-xyz-openbmc_project-control-host%i.service -After=mapper-wait@-xyz-openbmc_project-control-host%i.service -Wants=obmc-host-reset-running@%i.target -Before=obmc-host-reset-running@%i.target -Wants=op-reset-chassis-on@%i.service -After=op-reset-chassis-on@%i.service -Conflicts=obmc-host-stop@%i.target -ConditionPathExists=/run/openbmc/chassis@%i-on - -[Service] -RemainAfterExit=yes -Type=oneshot -ExecStart=/bin/sh -c "if [ $(busctl get-property `mapper get-service /xyz/openbmc_project/Chassis/Control/Power%i` /xyz/openbmc_project/Chassis/Control/Power%i xyz.openbmc_project.Chassis.Control.Power vrd_good | sed 's/i\s*[1]/on/' | grep on | wc -l) != 0 ]; then mkdir -p /run/openbmc/ && touch /run/openbmc/host@%i-on; fi" -SyslogIdentifier=phosphor-host-check - -[Install] -WantedBy=obmc-host-reset@%i.target diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-reboot-attempts@.service b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-reboot-attempts@.service deleted file mode 100644 index 87c750c57..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager/phosphor-reset-host-reboot-attempts@.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Reset host reboot counter -Wants=mapper-wait@-xyz-openbmc_project-state-host%i.service -After=mapper-wait@-xyz-openbmc_project-state-host%i.service -ConditionPathExists=!/run/openbmc/host@%i-on - -[Service] -Restart=no -Type=oneshot -ExecStart=/bin/sh -c "busctl set-property `mapper get-service /xyz/openbmc_project/state/host%i` /xyz/openbmc_project/state/host%i xyz.openbmc_project.Control.Boot.RebootAttempts AttemptsLeft u 3" -StartLimitInterval=0 - -[Install] -WantedBy=obmc-host-start@%i.target 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 deleted file mode 100644 index 63155ce0d..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-state-manager_%.bbappend +++ /dev/null @@ -1,10 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -SRC_URI += "file://0001-Modify-dbus-interface-for-power-control.patch \ - file://phosphor-reboot-host@.service \ - file://phosphor-reset-host-reboot-attempts@.service \ - file://phosphor-reset-host-check@.service \ - file://0002-Capture-host-restart-cause.patch \ - file://0003-Use-warm-reboot-for-the-Reboot-host-state-transition.patch \ - 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 e272fdc96..e863b14e7 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 @@ -7,7 +7,7 @@ inherit cmake systemd DEPENDS = "boost sdbusplus" PV = "0.1+git${SRCPV}" -SRCREV = "4373d99e1edcbb4c7233abde3a5e53690693007b" +SRCREV = "4611d8dcba0c0dc92156bbafdb50607aaff122ab" S = "${WORKDIR}/git/callback-manager" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch index 5c2879d8f..0af64698a 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch @@ -1,4 +1,4 @@ -From 726be648df955f5ae94f34391adc0e88f6956345 Mon Sep 17 00:00:00 2001 +From a519a128b9a44b1798419bf3a653d58e266c60fb Mon Sep 17 00:00:00 2001 From: Radivoje Jovanovic Date: Mon, 2 Jul 2018 19:23:25 -0700 Subject: [PATCH] Added suport for multiple user manager services @@ -11,20 +11,20 @@ Signed-off-by: Richard Marian Thomaiyar (srvc, groupsMgr, privMgr); initUserObjects(); - } + // emit the signal diff --git a/user_mgr.hpp b/user_mgr.hpp -index c78174d..9d9c842 100644 +index b25e9f2..c24733b 100644 --- a/user_mgr.hpp +++ b/user_mgr.hpp @@ -21,6 +21,7 @@ @@ -596,7 +593,7 @@ index c78174d..9d9c842 100644 using AccountPolicyIface = sdbusplus::xyz::openbmc_project::User::server::AccountPolicy; -@@ -71,8 +70,10 @@ class UserMgr : public UserMgrIface, AccountPolicyIface +@@ -76,8 +75,10 @@ class UserMgr : public Ifaces * * @param[in] bus - sdbusplus handler * @param[in] path - D-Bus path @@ -608,7 +605,7 @@ index c78174d..9d9c842 100644 /** @brief create user method. * This method creates a new user as requested -@@ -181,6 +182,8 @@ class UserMgr : public UserMgrIface, AccountPolicyIface +@@ -186,6 +187,8 @@ class UserMgr : public Ifaces /** @brief object path */ const std::string path; 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 2cc081433..327be045d 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 = "75b5a6fc4c0c06f43623fe0e746fd55e667dceb3" +#SRC_URI = "git://github.com/openbmc/phosphor-user-manager;nobranch=1" +SRCREV = "1af1223304dbf7aaecd5f238227abee95cce8b39" SRC_URI += " \ diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/virtual-media/virtual-media.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/virtual-media/virtual-media.bb new file mode 100644 index 000000000..f50ec86d1 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/virtual-media/virtual-media.bb @@ -0,0 +1,21 @@ +SUMMARY = "Virtual Media Service" +DESCRIPTION = "Virtual Media Service" + +SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh;nobranch=1" +SRCREV = "0de77d616866a6251ce7e36db3285fda76b13873" + +S = "${WORKDIR}/git/virtual-media/" +PV = "1.0+git${SRCPV}" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" + +SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.VirtualMedia.service" + +DEPENDS = "udev boost nlohmann-json systemd sdbusplus" + +inherit cmake systemd + +EXTRA_OECMAKE += "-DYOCTO_DEPENDENCIES=ON" + +FULL_OPTIMIZATION = "-Os -pipe -flto -fno-rtti" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Add-redfish-log-support-for-IPMI-watchdog-timeout-ac.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Add-redfish-log-support-for-IPMI-watchdog-timeout-ac.patch deleted file mode 100644 index 28995d14b..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Add-redfish-log-support-for-IPMI-watchdog-timeout-ac.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 38faf5c040660e752741dcf7f03e4bb1e9f3411b Mon Sep 17 00:00:00 2001 -From: Yong Li -Date: Thu, 4 Apr 2019 18:24:54 +0800 -Subject: [PATCH] Add redfish log support for IPMI watchdog timeout actions - -The current plan is that only threshold sensor events -will be logged to the IPMI SEL, -and all other events will be logged to the Redfish Event Log. - -Tested: -Config IPMI watchdog: OEM hard reset after 10 seconds: -ipmitool raw 0x06 0x24 0x5 0x1 0x0 0x0 0x64 0x00 -Start watchdog: -Ipmitool mc watchdog reset -Check the redfish logs in 10 seconds: -https://BMCIP/redfish/v1/Systems/system/LogServices/EventLog/Entries - -Signed-off-by: Yong Li ---- - watchdog.cpp | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/watchdog.cpp b/watchdog.cpp -index bc3ba95..4774fd8 100644 ---- a/watchdog.cpp -+++ b/watchdog.cpp -@@ -1,5 +1,7 @@ - #include "watchdog.hpp" - -+#include -+ - #include - #include - #include -@@ -101,6 +103,13 @@ void Watchdog::timeOutHandler() - action = fallback->action; - } - -+ // Log into redfish event log -+ sd_journal_send("MESSAGE=IPMIWatchdog: Timed out ACTION=%s", -+ convertForMessage(action).c_str(), "PRIORITY=%i", LOG_INFO, -+ "REDFISH_MESSAGE_ID=%s", "OpenBMC.0.1.IPMIWatchdog", -+ "REDFISH_MESSAGE_ARGS=%s", -+ convertForMessage(action).c_str(), NULL); -+ - expiredTimerUse(currentTimerUse()); - - auto target = actionTargetMap.find(action); --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Move-Phosphor-Watchdog-to-Not-Use-Service-Files.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Move-Phosphor-Watchdog-to-Not-Use-Service-Files.patch new file mode 100644 index 000000000..627dacef1 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Move-Phosphor-Watchdog-to-Not-Use-Service-Files.patch @@ -0,0 +1,198 @@ +From d15cf914ad51207021451b12863d4b7585f4666c Mon Sep 17 00:00:00 2001 +From: James Feist +Date: Mon, 17 Jun 2019 12:00:58 -0700 +Subject: [PATCH] Move Phosphor-Watchdog to Not Use Service Files + +Our power control does not use service files, update it +so that it calls properties directly. + +According to EPS, change the messageArgs in redfish about watchdog +action and pre-interrupt action. + +Tested: used ipmi to create watchdog event and system +was restarted. + +Set a watchdog (Timer action and pre-interrupt action both are none). + ipmitool raw 0x06 0x24 0x05 0x00 0x00 0x00 0x30 0x00 +Get the watchdog. + ipmitool mc watchdog get +Start the watchdog. + ipmitool mc watchdog reset +When timer expired, check messageArgs in Redfish with below url: +https://IP/redfish/v1/Systems/system/LogServices/EventLog/Entries. + +Signed-off-by: James Feist +Signed-off-by: Ren Yu +--- + watchdog.cpp | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 108 insertions(+), 8 deletions(-) + +diff --git a/watchdog.cpp b/watchdog.cpp +index 9090760..4c8e480 100644 +--- a/watchdog.cpp ++++ b/watchdog.cpp +@@ -1,11 +1,14 @@ + #include "watchdog.hpp" + ++#include ++ + #include + #include + #include + #include + #include + #include ++#include + + namespace phosphor + { +@@ -18,10 +21,44 @@ using namespace phosphor::logging; + using sdbusplus::exception::SdBusError; + using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure; + +-// systemd service to kick start a target. +-constexpr auto SYSTEMD_SERVICE = "org.freedesktop.systemd1"; +-constexpr auto SYSTEMD_ROOT = "/org/freedesktop/systemd1"; +-constexpr auto SYSTEMD_INTERFACE = "org.freedesktop.systemd1.Manager"; ++const static constexpr char* powerActionHardReset = ++ "xyz.openbmc_project.State.Watchdog.Action.HardReset"; ++const static constexpr char* powerActionOff = ++ "xyz.openbmc_project.State.Watchdog.Action.PowerOff"; ++const static constexpr char* powerActionPowerCycle = ++ "xyz.openbmc_project.State.Watchdog.Action.PowerCycle"; ++const static constexpr char* powerActionNone = ++ "xyz.openbmc_project.State.Watchdog.Action.None"; ++const static constexpr char* preInterruptNoAction = ++ "xyz.openbmc_project.State.Watchdog.PreTimeoutInterruptAction.None"; ++ ++const static constexpr char* hardResteDescription = ++ "Hard Reset - System reset due to Watchdog timeout"; ++const static constexpr char* powerOffDescription = ++ "Power Down - System power down due to Watchdog timeout"; ++const static constexpr char* powerCycleDescription = ++ "Power Cycle - System power cycle due to Watchdog timeout"; ++const static constexpr char* timerExpiredDescription = "Timer expired"; ++const static constexpr char* preInterruptDescription = "Timer interrupt"; ++ ++namespace restart ++{ ++static constexpr const char* busName = "xyz.openbmc_project.Settings"; ++static constexpr const char* path = ++ "/xyz/openbmc_project/control/host0/restart_cause"; ++static constexpr const char* interface = ++ "xyz.openbmc_project.Common.RestartCause"; ++static constexpr const char* property = "RestartCause"; ++} // namespace restart ++ ++// chassis state manager service ++namespace chassis ++{ ++static constexpr const char* busName = "xyz.openbmc_project.State.Chassis"; ++static constexpr const char* path = "/xyz/openbmc_project/state/chassis0"; ++static constexpr const char* interface = "xyz.openbmc_project.State.Chassis"; ++static constexpr const char* request = "RequestedPowerTransition"; ++} // namespace chassis + + void Watchdog::resetTimeRemaining(bool enableWatchdog) + { +@@ -102,12 +139,51 @@ uint64_t Watchdog::interval(uint64_t value) + // Optional callback function on timer expiration + void Watchdog::timeOutHandler() + { ++ PreTimeoutInterruptAction preTimeoutInterruptAction = preTimeoutInterrupt(); + Action action = expireAction(); ++ std::string actionMessageArgs{}; ++ + if (!this->enabled()) + { + action = fallback->action; + } + ++ if (convertForMessage(action) == powerActionHardReset) ++ { ++ actionMessageArgs = hardResteDescription; ++ } ++ else if (convertForMessage(action) == powerActionOff) ++ { ++ actionMessageArgs = powerOffDescription; ++ } ++ else if (convertForMessage(action) == powerActionPowerCycle) ++ { ++ actionMessageArgs = powerCycleDescription; ++ } ++ else if (convertForMessage(action) == powerActionNone) ++ { ++ actionMessageArgs = timerExpiredDescription; ++ } ++ else ++ { ++ actionMessageArgs = "Reserved"; ++ } ++ ++ // Log into redfish event log ++ sd_journal_send("MESSAGE=IPMIWatchdog: Timed out ACTION=%s", ++ convertForMessage(action).c_str(), "PRIORITY=%i", LOG_INFO, ++ "REDFISH_MESSAGE_ID=%s", "OpenBMC.0.1.IPMIWatchdog", ++ "REDFISH_MESSAGE_ARGS=%s", actionMessageArgs.c_str(), NULL); ++ ++ if (preInterruptNoAction != convertForMessage(preTimeoutInterruptAction)) ++ { ++ sd_journal_send("MESSAGE=IPMIWatchdog: Pre Timed out Interrupt=%s", ++ convertForMessage(preTimeoutInterruptAction).c_str(), ++ "PRIORITY=%i", LOG_INFO, "REDFISH_MESSAGE_ID=%s", ++ "OpenBMC.0.1.IPMIWatchdog", "REDFISH_MESSAGE_ARGS=%s", ++ preInterruptDescription, NULL); ++ } ++ + expiredTimerUse(currentTimerUse()); + + auto target = actionTargetMap.find(action); +@@ -128,10 +204,11 @@ void Watchdog::timeOutHandler() + + try + { +- auto method = bus.new_method_call(SYSTEMD_SERVICE, SYSTEMD_ROOT, +- SYSTEMD_INTERFACE, "StartUnit"); +- method.append(target->second); +- method.append("replace"); ++ auto method = ++ bus.new_method_call(chassis::busName, chassis::path, ++ "org.freedesktop.DBus.Properties", "Set"); ++ method.append(chassis::interface, chassis::request, ++ std::variant(target->second)); + + bus.call_noreply(method); + } +@@ -142,6 +219,29 @@ void Watchdog::timeOutHandler() + entry("ERROR=%s", e.what())); + commit(); + } ++ ++ // set restart cause for watchdog HardReset & PowerCycle actions ++ if ((action == Watchdog::Action::HardReset) || ++ (action == Watchdog::Action::PowerCycle)) ++ { ++ try ++ { ++ auto method = bus.new_method_call( ++ restart::busName, restart::path, ++ "org.freedesktop.DBus.Properties", "Set"); ++ method.append( ++ restart::interface, restart::property, ++ std::variant("xyz.openbmc_project.State.Host." ++ "RestartCause.WatchdogTimer")); ++ bus.call(method); ++ } ++ catch (sdbusplus::exception_t& e) ++ { ++ log("Failed to set HostRestartCause property", ++ entry("ERROR=%s", e.what())); ++ commit(); ++ } ++ } + } + + tryFallbackOrDisable(); +-- +2.7.4 + 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 deleted file mode 100644 index 05374e9db..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Add-restart-cause-support.patch +++ /dev/null @@ -1,82 +0,0 @@ -From af3a7d07b801c22a03350897c2186b1ee9507ff2 Mon Sep 17 00:00:00 2001 -From: Yong Li -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 ---- - 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 - #include - #include -+#include - - 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(); - } -+ -+ // set restart cause for watchdog HardReset & PowerCycle actions -+ if ((action == Watchdog::Action::HardReset) || -+ (action == Watchdog::Action::PowerCycle)) -+ { -+ sdbusplus::message::variant 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("Failed to set HostRestartCause property", -+ entry("ERROR=%s", e.what())); -+ commit(); -+ } -+ } - } - - tryFallbackOrDisable(); --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Stop-the-watchdog-when-the-host-is-going-to-off.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Stop-the-watchdog-when-the-host-is-going-to-off.patch new file mode 100644 index 000000000..016cf063a --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0002-Stop-the-watchdog-when-the-host-is-going-to-off.patch @@ -0,0 +1,118 @@ +From b05da90d7023199e23daf8fbb49455138332f241 Mon Sep 17 00:00:00 2001 +From: Ren Yu +Date: Wed, 24 Jul 2019 16:21:13 +0800 +Subject: [PATCH] Stop the watchdog when the host is going to off + +After the host is off, check the WDT status, if it is running, +needs to stop it + +Tested: +Set a watchdog with a long time expiration(Timer action is none, +Timer Use is OEM and Initial Countdown is 435.1 second). + ipmitool raw 0x06 0x24 0x05 0x00 0x00 0x00 0xff 0x10 +Get the watchdog. + ipmitool mc watchdog get +Start the watchdog. + ipmitool mc watchdog reset +Host off. + ipmitool chassis power off +Get the watchdog. + ipmitool mc watchdog get +Check the watchdog status, expect watchdog is stoped. + +Signed-off-by: Ren Yu +--- + watchdog.cpp | 21 +++++++++++++++++++++ + watchdog.hpp | 23 ++++++++++++++++++++++- + 2 files changed, 43 insertions(+), 1 deletion(-) + +diff --git a/watchdog.cpp b/watchdog.cpp +index 4c8e480..fa58ef4 100644 +--- a/watchdog.cpp ++++ b/watchdog.cpp +@@ -21,6 +21,10 @@ using namespace phosphor::logging; + using sdbusplus::exception::SdBusError; + using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure; + ++const static constexpr char* currentPowerState = "CurrentPowerState"; ++const static constexpr char* powerStatusOff = ++ "xyz.openbmc_project.State.Chassis.PowerState.Off"; ++ + const static constexpr char* powerActionHardReset = + "xyz.openbmc_project.State.Watchdog.Action.HardReset"; + const static constexpr char* powerActionOff = +@@ -60,6 +64,23 @@ static constexpr const char* interface = "xyz.openbmc_project.State.Chassis"; + static constexpr const char* request = "RequestedPowerTransition"; + } // namespace chassis + ++void Watchdog::powerStateChangedHandler( ++ const std::map>& props) ++{ ++ const auto iter = props.find(currentPowerState); ++ if (iter != props.end()) ++ { ++ const std::string* powerState = std::get_if(&iter->second); ++ if (powerState && (*powerState == powerStatusOff)) ++ { ++ if (timerEnabled()) ++ { ++ enabled(false); ++ } ++ } ++ } ++} ++ + void Watchdog::resetTimeRemaining(bool enableWatchdog) + { + timeRemaining(interval()); +diff --git a/watchdog.hpp b/watchdog.hpp +index 7de9bb3..dcbecd1 100644 +--- a/watchdog.hpp ++++ b/watchdog.hpp +@@ -68,7 +68,18 @@ class Watchdog : public WatchdogInherits + WatchdogInherits(bus, objPath), + bus(bus), actionTargetMap(std::move(actionTargetMap)), + fallback(std::move(fallback)), minInterval(minInterval), +- timer(event, std::bind(&Watchdog::timeOutHandler, this)) ++ timer(event, std::bind(&Watchdog::timeOutHandler, this)), ++ powerStateChangedSignal( ++ bus, ++ sdbusplus::bus::match::rules::propertiesChanged( ++ "/xyz/openbmc_project/state/chassis0", ++ "xyz.openbmc_project.State.Chassis"), ++ [this](sdbusplus::message::message& msg) { ++ std::string objectName; ++ std::map> props; ++ msg.read(objectName, props); ++ powerStateChangedHandler(props); ++ }) + { + // We set the watchdog interval with the default value. + interval(interval()); +@@ -77,6 +88,12 @@ class Watchdog : public WatchdogInherits + tryFallbackOrDisable(); + } + ++ /** @brief Disable watchdog when power status change meet ++ * the specific requirement ++ */ ++ void powerStateChangedHandler( ++ const std::map>& props); ++ + /** @brief Resets the TimeRemaining to the configured Interval + * Optionally enables the watchdog. + * +@@ -165,6 +182,10 @@ class Watchdog : public WatchdogInherits + /** @brief Contained timer object */ + sdeventplus::utility::Timer timer; + ++ /** @brief Optional Callback handler when power status change meet ++ * the specific requirement */ ++ sdbusplus::bus::match_t powerStateChangedSignal; ++ + /** @brief Optional Callback handler on timer expirartion */ + void timeOutHandler(); + +-- +2.7.4 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0003-Add-redfish-log-support-for-IPMI-watchdog-pre-timeou.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0003-Add-redfish-log-support-for-IPMI-watchdog-pre-timeou.patch deleted file mode 100644 index 309a8c646..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0003-Add-redfish-log-support-for-IPMI-watchdog-pre-timeou.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 46e8e4fe6cb48145152e37380a4064c8957d2ff7 Mon Sep 17 00:00:00 2001 -From: Ren Yu -Date: Tue, 28 May 2019 17:04:10 +0800 -Subject: [PATCH] Add redfish log support for IPMI watchdog pre-timeout - interrupt - -Tested: -Config IPMI watchdog: BIOS FRB2 Power Cycle after 1 seconds: -ipmitool raw 0x06 0x24 0x01 0x13 0x0 0x2 0xa 0x00 -Start watchdog: -Ipmitool mc watchdog reset -Check the redfish logs in 1 seconds: -https://BMCIP/redfish/v1/Systems/system/LogServices/EventLog/Entries - -Signed-off-by: Ren Yu ---- - watchdog.cpp | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/watchdog.cpp b/watchdog.cpp -index d893237..5062049 100644 ---- a/watchdog.cpp -+++ b/watchdog.cpp -@@ -104,6 +104,8 @@ uint64_t Watchdog::timeRemaining(uint64_t value) - // Optional callback function on timer expiration - void Watchdog::timeOutHandler() - { -+ PreTimeoutInterruptAction preTimeoutInterruptAction = preTimeoutInterrupt(); -+ - Action action = expireAction(); - if (!this->enabled()) - { -@@ -117,6 +119,12 @@ void Watchdog::timeOutHandler() - "REDFISH_MESSAGE_ARGS=%s", - convertForMessage(action).c_str(), NULL); - -+ sd_journal_send("MESSAGE=IPMIWatchdog: Pre Timed out Interrupt=%s", -+ convertForMessage(preTimeoutInterruptAction).c_str(), -+ "PRIORITY=%i", LOG_INFO, "REDFISH_MESSAGE_ID=%s", -+ "OpenBMC.0.1.IPMIWatchdog", "REDFISH_MESSAGE_ARGS=%s", -+ convertForMessage(preTimeoutInterruptAction).c_str(), NULL); -+ - expiredTimerUse(currentTimerUse()); - - auto target = actionTargetMap.find(action); --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/obmc-enable-host-watchdog@.service b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/obmc-enable-host-watchdog@.service deleted file mode 100644 index 87a662f7c..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/obmc-enable-host-watchdog@.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Start FRB2 Watchdog%i -Wants=obmc-host-started@%i.target -After=obmc-host-started@%i.target -Wants=mapper-wait@-xyz-openbmc_project-watchdog-host%i.service -After=mapper-wait@-xyz-openbmc_project-watchdog-host%i.service -Conflicts=obmc-host-stop@%i.target -ConditionPathExists=!/run/openbmc/host@%i-on - -[Service] -Restart=always -ExecStart=/usr/bin/env frb2-watchdog -ExecStopPost=/bin/sh -c "busctl call `mapper get-service /xyz/openbmc_project/watchdog/host%i` /xyz/openbmc_project/watchdog/host%i org.freedesktop.DBus.Properties Set ssv xyz.openbmc_project.State.Watchdog Enabled b false" -SyslogIdentifier=obmc-enable-host-watchdog diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service new file mode 100644 index 000000000..5ef1a4179 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service @@ -0,0 +1,16 @@ +[Unit] +Description=Phosphor Watchdog + +[Service] +ExecStart=/usr/bin/env phosphor-watchdog --continue --service=xyz.openbmc_project.Watchdog \ + --path=/xyz/openbmc_project/watchdog/host0 \ + --action_target=xyz.openbmc_project.State.Watchdog.Action.HardReset=xyz.openbmc_project.State.Chassis.Transition.Reset \ + --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerOff=xyz.openbmc_project.State.Chassis.Transition.Off \ + --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerCycle=xyz.openbmc_project.State.Chassis.Transition.PowerCycle + +SyslogIdentifier=phosphor-watchdog +BusName =xyz.openbmc_project.Watchdog +Type=dbus + +[Install] +WantedBy=basic.target diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service deleted file mode 100644 index 251c2257b..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Phosphor %I watchdog - -[Service] -Restart=no -EnvironmentFile={envfiledir}/obmc/watchdog/%I -ExecStart=/usr/bin/env phosphor-watchdog --continue --service=${{SERVICE}} --path=${{DEVPATH}} \ - --action_target=xyz.openbmc_project.State.Watchdog.Action.HardReset=obmc-host-warm-reset@0.target \ - --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerOff=obmc-host-shutdown@0.target \ - --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerCycle=obmc-host-reboot@0.target - -SyslogIdentifier=phosphor-watchdog 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 c117102ee..caaca2670 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,9 +1,10 @@ FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" -SRC_URI += "file://0001-Add-redfish-log-support-for-IPMI-watchdog-timeout-ac.patch \ - file://0002-Add-restart-cause-support.patch \ - file://0003-Add-redfish-log-support-for-IPMI-watchdog-pre-timeou.patch \ +SRCREV = "c35135d32f9cb84b62de7b72eee3a2e87b4b3d4d" +SRC_URI += "file://0001-Move-Phosphor-Watchdog-to-Not-Use-Service-Files.patch \ + file://0002-Stop-the-watchdog-when-the-host-is-going-to-off.patch \ " # Remove the override to keep service running after DC cycle SYSTEMD_OVERRIDE_${PN}_remove = "poweron.conf:phosphor-watchdog@poweron.service.d/poweron.conf" +SYSTEMD_SERVICE_${PN} = "phosphor-watchdog.service" 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 f4b054acf..97270e982 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,6 +1,6 @@ FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" #SRC_URI = "git://github.com/openbmc/phosphor-webui.git" -SRCREV = "e4ae854c217344b4f35717e922083a253f43bfa0" +SRCREV = "ae0353989abe7d9194dba47ca26d803fe11f46b6" SRC_URI += "file://0004-Implement-force-boot-to-bios-in-server-power-control.patch" -- cgit v1.2.3