From 2a64b8ae9b952b18b4aef38cb7c41ce6dba16c50 Mon Sep 17 00:00:00 2001 From: "Jason M. Bills" Date: Mon, 24 May 2021 12:54:37 -0700 Subject: Update to internal 0.52 Signed-off-by: Jason M. Bills --- .../classes/obmc-phosphor-full-fitimage.bbclass | 32 +- .../meta-common/classes/print-src.bbclass | 7 + meta-openbmc-mods/meta-common/conf/layer.conf | 2 +- .../recipes-connectivity/openssl/openssl_1.1.1j.bb | 211 ------- .../recipes-connectivity/openssl/openssl_1.1.1k.bb | 211 +++++++ ...Fix-double-free-in-netgroupcache-BZ-27462.patch | 44 -- .../recipes-core/glibc/glibc_%.bbappend | 1 - .../recipes-core/ipmi/intel-ipmi-oem_%.bbappend | 2 +- .../recipes-core/libpeci/libpeci_%.bbappend | 2 +- .../meta-common/recipes-core/safec/safec_3.4.bb | 2 +- .../recipes-extended/pam/libpam_%.bbappend | 6 + .../sdbusplus/sdbusplus_%.bbappend | 3 + .../libvncserver/libvncserver_%.bbappend | 2 +- .../host-misc-comm-manager_git.bb | 2 +- .../intel-pfr/intel-blocksign-native.bb | 2 +- .../recipes-intel/smbios/smbios-mdrv2.bb | 2 +- .../recipes-kernel/linux/linux-aspeed_%.bbappend | 2 +- ...ing-channel-specific-privilege-to-network.patch | 31 +- .../0004-Improved-IPv6-netmask-parsing.patch | 127 ---- .../network/phosphor-network_%.bbappend | 3 +- ...001-Improve-initialization-of-I2C-sensors.patch | 26 +- ...ty-manager-Add-support-to-update-assetTag.patch | 226 +------ .../0003-Add-logs-to-fwVersionIsSame.patch | 56 ++ .../configuration/entity-manager_%.bbappend | 3 +- .../console/obmc-console/obmc-console@.service | 9 +- .../dbus/phosphor-dbus-interfaces_%.bbappend | 2 +- .../fans/phosphor-pid-control_%.bbappend | 2 +- ...image-by-ID-and-inhibit-removal-of-bmc_ac.patch | 153 ----- ...image-by-ID-and-inhibit-removal-of-bmc_ac.patch | 175 ++++++ .../flash/phosphor-software-manager_%.bbappend | 1 + .../host/phosphor-host-postd_git.bbappend | 2 +- ...rtMedia-action-response-for-POST-in-proxy.patch | 30 - ...status-code-from-InsertMedia-REST-methods.patch | 182 ++++++ ...Bmcweb-handle-permission-denied-exception.patch | 44 ++ .../0005-Fix-unmounting-image-in-proxy-mode.patch | 32 + ...-Add-PhysicalContext-to-Thermal-resources.patch | 135 +++++ ...g-RedFish-event-for-Invalid-login-attempt.patch | 67 ++ ...uting-logic-into-host-console-connection-.patch | 59 ++ ...b-crashes-if-socket-directory-not-present.patch | 44 ++ ...0039-Fix-comparison-for-proxy-legacy-mode.patch | 51 ++ ...003-Move-EventService-init-to-later-stage.patch | 50 -- ...tyle-subscription-support-to-eventservice.patch | 32 +- .../0006-Add-EventService-SSE-filter-support.patch | 8 +- .../interfaces/bmcweb/eventservice/README | 3 - ...nc_ReadingUnit_with_Redfish_Sensor_Schema.patch | 227 ------- ...OST-and-DELETE-in-MetricReportDefinitions.patch | 671 --------------------- .../interfaces/bmcweb/telemetry/README | 3 - .../recipes-phosphor/interfaces/bmcweb_%.bbappend | 19 +- ...-IPv6-Router-Address-Configuration-comman.patch | 120 ---- .../ipmi/phosphor-ipmi-host_%.bbappend | 1 - .../ipmi/phosphor-ipmi-kcs_%.bbappend | 2 +- .../0009-Add-dbus-interface-for-sol-commands.patch | 317 ---------- .../ipmi/phosphor-ipmi-net_%.bbappend | 3 +- .../leds/intel-led-manager-config-native.bb | 2 +- .../recipes-phosphor/pmci/libmctp-intel_git.bb | 2 +- .../recipes-phosphor/pmci/libpldm-intel_git.bb | 2 +- .../recipes-phosphor/pmci/mctp-emulator.bb | 2 +- .../recipes-phosphor/pmci/mctp-wrapper.bb | 2 +- .../meta-common/recipes-phosphor/pmci/mctpd.bb | 2 +- .../meta-common/recipes-phosphor/pmci/mctpwplus.bb | 2 +- .../recipes-phosphor/pmci/nvmemi-daemon.bb | 2 +- .../meta-common/recipes-phosphor/pmci/pldmd.bb | 2 +- .../recipes-phosphor/pmci/pmci-launcher.bb | 2 +- .../preinit-mounts/preinit-mounts/init | 5 + .../sel-logger/phosphor-sel-logger_%.bbappend | 2 +- .../sensors/dbus-sensors_%.bbappend | 2 +- .../state/phosphor-post-code-manager_git.bbappend | 2 +- .../telemetry/telemetry_%.bbappend | 2 +- .../users/phosphor-user-manager_%.bbappend | 2 +- ...ize-phosphor-watchdog-for-Intel-platforms.patch | 38 +- .../webui/phosphor-webui_%.bbappend | 2 +- .../recipes-phosphor/webui/webui-vue_%.bbappend | 2 +- .../recipes-support/curl/curl_7.74.0.bb | 85 --- .../recipes-support/curl/curl_7.76.0.bb | 85 +++ ...d-target-to-only-build-tests-not-run-them.patch | 45 ++ ...k-header-files-of-openssl-only-if-enable_.patch | 36 ++ .../nettle/nettle/dlopen-test.patch | 29 + .../recipes-support/nettle/nettle/run-ptest | 36 ++ .../recipes-support/nettle/nettle_3.7.2.bb | 57 ++ .../recipes-utilities/i3c-tools/i3c-tools.bb | 2 +- .../0001-Extend-VR-Watchdog-timeout.patch | 34 +- .../chassis/x86-power-control_%.bbappend | 2 +- 82 files changed, 1555 insertions(+), 2382 deletions(-) create mode 100644 meta-openbmc-mods/meta-common/classes/print-src.bbclass delete mode 100644 meta-openbmc-mods/meta-common/recipes-connectivity/openssl/openssl_1.1.1j.bb create mode 100644 meta-openbmc-mods/meta-common/recipes-connectivity/openssl/openssl_1.1.1k.bb delete mode 100644 meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0034-Fix-double-free-in-netgroupcache-BZ-27462.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0004-Improved-IPv6-netmask-parsing.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0003-Add-logs-to-fwVersionIsSame.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0015-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0018-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Change-InsertMedia-action-response-for-POST-in-proxy.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Invalid-status-code-from-InsertMedia-REST-methods.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0004-Bmcweb-handle-permission-denied-exception.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0005-Fix-unmounting-image-in-proxy-mode.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0011-bmcweb-Add-PhysicalContext-to-Thermal-resources.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0012-Log-RedFish-event-for-Invalid-login-attempt.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0013-Add-UART-routing-logic-into-host-console-connection-.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-bmcweb-crashes-if-socket-directory-not-present.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-comparison-for-proxy-legacy-mode.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0003-Move-EventService-init-to-later-stage.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0001-Sync_ReadingUnit_with_Redfish_Sensor_Schema.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Correct-the-IPv6-Router-Address-Configuration-comman.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-support/curl/curl_7.74.0.bb create mode 100644 meta-openbmc-mods/meta-common/recipes-support/curl/curl_7.76.0.bb create mode 100644 meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/Add-target-to-only-build-tests-not-run-them.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/check-header-files-of-openssl-only-if-enable_.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/dlopen-test.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/run-ptest create mode 100644 meta-openbmc-mods/meta-common/recipes-support/nettle/nettle_3.7.2.bb (limited to 'meta-openbmc-mods/meta-common') diff --git a/meta-openbmc-mods/meta-common/classes/obmc-phosphor-full-fitimage.bbclass b/meta-openbmc-mods/meta-common/classes/obmc-phosphor-full-fitimage.bbclass index 0fdad5b5c..6e0411a5c 100644 --- a/meta-openbmc-mods/meta-common/classes/obmc-phosphor-full-fitimage.bbclass +++ b/meta-openbmc-mods/meta-common/classes/obmc-phosphor-full-fitimage.bbclass @@ -77,7 +77,7 @@ fitimage_emit_section_kernel() { if [ -n "${kernel_csum}" ]; then hash_blk=$(cat << EOF - hash@1 { + hash-1 { algo = "${kernel_csum}"; }; EOF @@ -91,7 +91,7 @@ EOF fi cat << EOF >> ${1} - kernel@${2} { + kernel-${2} { description = "Linux kernel"; data = /incbin/("${3}"); type = "kernel"; @@ -117,7 +117,7 @@ fitimage_emit_section_dtb() { dtb_csum="${4}" if [ -n "${dtb_csum}" ]; then hash_blk=$(cat << EOF - hash@1 { + hash-1 { algo = "${dtb_csum}"; }; EOF @@ -125,7 +125,7 @@ EOF fi cat << EOF >> ${1} - fdt@${2} { + fdt-${2} { description = "Flattened Device Tree blob"; data = /incbin/("${3}"); type = "flat_dt"; @@ -148,7 +148,7 @@ fitimage_emit_section_setup() { setup_csum="${4}" if [ -n "${setup_csum}" ]; then hash_blk=$(cat << EOF - hash@1 { + hash-1 { algo = "${setup_csum}"; }; EOF @@ -156,7 +156,7 @@ EOF fi cat << EOF >> ${1} - setup@${2} { + setup-${2} { description = "Linux setup.bin"; data = /incbin/("${3}"); type = "x86_setup"; @@ -182,7 +182,7 @@ fitimage_emit_section_ramdisk() { ramdisk_csum="${4}" if [ -n "${ramdisk_csum}" ]; then hash_blk=$(cat << EOF - hash@1 { + hash-1 { algo = "${ramdisk_csum}"; }; EOF @@ -218,7 +218,7 @@ EOF esac cat << EOF >> ${1} - ramdisk@${2} { + ramdisk-${2} { description = "${INITRAMFS_IMAGE}"; data = /incbin/("${3}"); type = "ramdisk"; @@ -248,7 +248,7 @@ fitimage_emit_section_config() { conf_csum="${7}" if [ -n "${conf_csum}" ]; then hash_blk=$(cat << EOF - hash@1 { + hash-1 { algo = "${conf_csum}"; }; EOF @@ -260,7 +260,7 @@ EOF # Test if we have any DTBs at all conf_desc="Linux kernel" - kernel_line="kernel = \"kernel@${2}\";" + kernel_line="kernel = \"kernel-${2}\";" fdt_line="" ramdisk_line="" setup_line="" @@ -268,26 +268,26 @@ EOF if [ -n "${3}" ]; then conf_desc="${conf_desc}, FDT blob" - fdt_line="fdt = \"fdt@${3}\";" + fdt_line="fdt = \"fdt-${3}\";" fi if [ -n "${4}" ]; then conf_desc="${conf_desc}, ramdisk" - ramdisk_line="ramdisk = \"ramdisk@${4}\";" + ramdisk_line="ramdisk = \"ramdisk-${4}\";" fi if [ -n "${5}" ]; then conf_desc="${conf_desc}, setup" - setup_line="setup = \"setup@${5}\";" + setup_line="setup = \"setup-${5}\";" fi if [ "${6}" = "1" ]; then - default_line="default = \"conf@${3}\";" + default_line="default = \"conf-${3}\";" fi cat << EOF >> ${1} ${default_line} - conf@${3} { + conf-${3} { description = "${6} ${conf_desc}"; ${kernel_line} ${fdt_line} @@ -315,7 +315,7 @@ EOF sign_line="${sign_line};" cat << EOF >> ${1} - signature@1 { + signature-1 { algo = "${conf_csum},rsa2048"; key-name-hint = "${conf_sign_keyname}"; ${sign_line} diff --git a/meta-openbmc-mods/meta-common/classes/print-src.bbclass b/meta-openbmc-mods/meta-common/classes/print-src.bbclass new file mode 100644 index 000000000..f305a5433 --- /dev/null +++ b/meta-openbmc-mods/meta-common/classes/print-src.bbclass @@ -0,0 +1,7 @@ +python do_print_src () { + srcuri = d.getVar('SRC_URI', True).split() + srcrev = d.getVar('SRCREV', True).split() + bb.warn("SRC_URI: %s SRCREV: %s" % (srcuri, srcrev)) +} + +addtask do_print_src before do_fetch diff --git a/meta-openbmc-mods/meta-common/conf/layer.conf b/meta-openbmc-mods/meta-common/conf/layer.conf index 23382eda0..5d4becae0 100644 --- a/meta-openbmc-mods/meta-common/conf/layer.conf +++ b/meta-openbmc-mods/meta-common/conf/layer.conf @@ -8,4 +8,4 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ BBFILE_COLLECTIONS += "common" BBFILE_PATTERN_common = "^${LAYERDIR}/" BBFILE_PRIORITY_common = "9" -LAYERSERIES_COMPAT_common = "dunfell gatesgarth" +LAYERSERIES_COMPAT_common = "gatesgarth hardknott" diff --git a/meta-openbmc-mods/meta-common/recipes-connectivity/openssl/openssl_1.1.1j.bb b/meta-openbmc-mods/meta-common/recipes-connectivity/openssl/openssl_1.1.1j.bb deleted file mode 100644 index bf01647ee..000000000 --- a/meta-openbmc-mods/meta-common/recipes-connectivity/openssl/openssl_1.1.1j.bb +++ /dev/null @@ -1,211 +0,0 @@ -SUMMARY = "Secure Socket Layer" -DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools." -HOMEPAGE = "http://www.openssl.org/" -BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html" -SECTION = "libs/network" - -# "openssl" here actually means both OpenSSL and SSLeay licenses apply -# (see meta/files/common-licenses/OpenSSL to which "openssl" is SPDXLICENSEMAPped) -LICENSE = "openssl" -LIC_FILES_CHKSUM = "file://LICENSE;md5=d343e62fc9c833710bbbed25f27364c8" - -DEPENDS = "hostperl-runtime-native" - -SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \ - file://run-ptest \ - file://0001-skip-test_symbol_presence.patch \ - file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ - file://afalg.patch \ - file://reproducible.patch \ - " - -SRC_URI_append_class-nativesdk = " \ - file://environment.d-openssl.sh \ - " - -SRC_URI[sha256sum] = "aaf2fcb575cdf6491b98ab4829abf78a3dec8402b8b81efc8f23c00d443981bf" - -inherit lib_package multilib_header multilib_script ptest -MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" - -PACKAGECONFIG ?= "" -PACKAGECONFIG_class-native = "" -PACKAGECONFIG_class-nativesdk = "" - -PACKAGECONFIG[cryptodev-linux] = "enable-devcryptoeng,disable-devcryptoeng,cryptodev-linux,,cryptodev-module" - -B = "${WORKDIR}/build" -do_configure[cleandirs] = "${B}" - -#| ./libcrypto.so: undefined reference to `getcontext' -#| ./libcrypto.so: undefined reference to `setcontext' -#| ./libcrypto.so: undefined reference to `makecontext' -EXTRA_OECONF_append_libc-musl = " no-async" -EXTRA_OECONF_append_libc-musl_powerpc64 = " no-asm" - -# adding devrandom prevents openssl from using getrandom() which is not available on older glibc versions -# (native versions can be built with newer glibc, but then relocated onto a system with older glibc) -EXTRA_OECONF_class-native = "--with-rand-seed=os,devrandom" -EXTRA_OECONF_class-nativesdk = "--with-rand-seed=os,devrandom" - -# Relying on hardcoded built-in paths causes openssl-native to not be relocateable from sstate. -CFLAGS_append_class-native = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin" -CFLAGS_append_class-nativesdk = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin" - -do_configure () { - os=${HOST_OS} - case $os in - linux-gnueabi |\ - linux-gnuspe |\ - linux-musleabi |\ - linux-muslspe |\ - linux-musl ) - os=linux - ;; - *) - ;; - esac - target="$os-${HOST_ARCH}" - case $target in - linux-arm*) - target=linux-armv4 - ;; - linux-aarch64*) - target=linux-aarch64 - ;; - linux-i?86 | linux-viac3) - target=linux-x86 - ;; - linux-gnux32-x86_64 | linux-muslx32-x86_64 ) - target=linux-x32 - ;; - linux-gnu64-x86_64) - target=linux-x86_64 - ;; - linux-mips | linux-mipsel) - # specifying TARGET_CC_ARCH prevents openssl from (incorrectly) adding target architecture flags - target="linux-mips32 ${TARGET_CC_ARCH}" - ;; - linux-gnun32-mips*) - target=linux-mips64 - ;; - linux-*-mips64 | linux-mips64 | linux-*-mips64el | linux-mips64el) - target=linux64-mips64 - ;; - linux-microblaze* | linux-nios2* | linux-sh3 | linux-sh4 | linux-arc*) - target=linux-generic32 - ;; - linux-powerpc) - target=linux-ppc - ;; - linux-powerpc64) - target=linux-ppc64 - ;; - linux-powerpc64le) - target=linux-ppc64le - ;; - linux-riscv32) - target=linux-generic32 - ;; - linux-riscv64) - target=linux-generic64 - ;; - linux-sparc | linux-supersparc) - target=linux-sparcv9 - ;; - esac - - useprefix=${prefix} - if [ "x$useprefix" = "x" ]; then - useprefix=/ - fi - # WARNING: do not set compiler/linker flags (-I/-D etc.) in EXTRA_OECONF, as they will fully replace the - # environment variables set by bitbake. Adjust the environment variables instead. - HASHBANGPERL="/usr/bin/env perl" PERL=perl PERL5LIB="${S}/external/perl/Text-Template-1.46/lib/" \ - perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=${libdir} $target - perl ${B}/configdata.pm --dump -} - -do_install () { - oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install - - oe_multilib_header openssl/opensslconf.h - - # Create SSL structure for packages such as ca-certificates which - # contain hard-coded paths to /etc/ssl. Debian does the same. - install -d ${D}${sysconfdir}/ssl - mv ${D}${libdir}/ssl-1.1/certs \ - ${D}${libdir}/ssl-1.1/private \ - ${D}${libdir}/ssl-1.1/openssl.cnf \ - ${D}${sysconfdir}/ssl/ - - # Although absolute symlinks would be OK for the target, they become - # invalid if native or nativesdk are relocated from sstate. - ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/certs')} ${D}${libdir}/ssl-1.1/certs - ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/private')} ${D}${libdir}/ssl-1.1/private - ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/openssl.cnf')} ${D}${libdir}/ssl-1.1/openssl.cnf -} - -do_install_append_class-native () { - create_wrapper ${D}${bindir}/openssl \ - OPENSSL_CONF=${libdir}/ssl-1.1/openssl.cnf \ - SSL_CERT_DIR=${libdir}/ssl-1.1/certs \ - SSL_CERT_FILE=${libdir}/ssl-1.1/cert.pem \ - OPENSSL_ENGINES=${libdir}/engines-1.1 -} - -do_install_append_class-nativesdk () { - mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d - install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh - sed 's|/usr/lib/ssl/|/usr/lib/ssl-1.1/|g' -i ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh -} - -PTEST_BUILD_HOST_FILES += "configdata.pm" -PTEST_BUILD_HOST_PATTERN = "perl_version =" -do_install_ptest () { - # Prune the build tree - rm -f ${B}/fuzz/*.* ${B}/test/*.* - - cp ${S}/Configure ${B}/configdata.pm ${D}${PTEST_PATH} - cp -r ${S}/external ${B}/test ${S}/test ${B}/fuzz ${S}/util ${B}/util ${D}${PTEST_PATH} - - # For test_shlibload - ln -s ${libdir}/libcrypto.so.1.1 ${D}${PTEST_PATH}/ - ln -s ${libdir}/libssl.so.1.1 ${D}${PTEST_PATH}/ - - install -d ${D}${PTEST_PATH}/apps - ln -s ${bindir}/openssl ${D}${PTEST_PATH}/apps - install -m644 ${S}/apps/*.pem ${S}/apps/*.srl ${S}/apps/openssl.cnf ${D}${PTEST_PATH}/apps - install -m755 ${B}/apps/CA.pl ${D}${PTEST_PATH}/apps - - install -d ${D}${PTEST_PATH}/engines - install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines -} - -# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto -# package RRECOMMENDS on this package. This will enable the configuration -# file to be installed for both the openssl-bin package and the libcrypto -# package since the openssl-bin package depends on the libcrypto package. - -PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc" - -FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}" -FILES_libssl = "${libdir}/libssl${SOLIBS}" -FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf" -FILES_${PN}-engines = "${libdir}/engines-1.1" -FILES_${PN}-misc = "${libdir}/ssl-1.1/misc" -FILES_${PN} =+ "${libdir}/ssl-1.1/*" -FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh" - -CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf" - -RRECOMMENDS_libcrypto += "openssl-conf" -RDEPENDS_${PN}-ptest += "openssl-bin perl perl-modules bash" - -BBCLASSEXTEND = "native nativesdk" - -CVE_PRODUCT = "openssl:openssl" - -# Only affects OpenSSL >= 1.1.1 in combination with Apache < 2.4.37 -# Apache in meta-webserver is already recent enough -CVE_CHECK_WHITELIST += "CVE-2019-0190" diff --git a/meta-openbmc-mods/meta-common/recipes-connectivity/openssl/openssl_1.1.1k.bb b/meta-openbmc-mods/meta-common/recipes-connectivity/openssl/openssl_1.1.1k.bb new file mode 100644 index 000000000..034cc610d --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-connectivity/openssl/openssl_1.1.1k.bb @@ -0,0 +1,211 @@ +SUMMARY = "Secure Socket Layer" +DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools." +HOMEPAGE = "http://www.openssl.org/" +BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html" +SECTION = "libs/network" + +# "openssl" here actually means both OpenSSL and SSLeay licenses apply +# (see meta/files/common-licenses/OpenSSL to which "openssl" is SPDXLICENSEMAPped) +LICENSE = "openssl" +LIC_FILES_CHKSUM = "file://LICENSE;md5=d343e62fc9c833710bbbed25f27364c8" + +DEPENDS = "hostperl-runtime-native" + +SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \ + file://run-ptest \ + file://0001-skip-test_symbol_presence.patch \ + file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ + file://afalg.patch \ + file://reproducible.patch \ + " + +SRC_URI_append_class-nativesdk = " \ + file://environment.d-openssl.sh \ + " + +SRC_URI[sha256sum] = "892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5" + +inherit lib_package multilib_header multilib_script ptest +MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" + +PACKAGECONFIG ?= "" +PACKAGECONFIG_class-native = "" +PACKAGECONFIG_class-nativesdk = "" + +PACKAGECONFIG[cryptodev-linux] = "enable-devcryptoeng,disable-devcryptoeng,cryptodev-linux,,cryptodev-module" + +B = "${WORKDIR}/build" +do_configure[cleandirs] = "${B}" + +#| ./libcrypto.so: undefined reference to `getcontext' +#| ./libcrypto.so: undefined reference to `setcontext' +#| ./libcrypto.so: undefined reference to `makecontext' +EXTRA_OECONF_append_libc-musl = " no-async" +EXTRA_OECONF_append_libc-musl_powerpc64 = " no-asm" + +# adding devrandom prevents openssl from using getrandom() which is not available on older glibc versions +# (native versions can be built with newer glibc, but then relocated onto a system with older glibc) +EXTRA_OECONF_class-native = "--with-rand-seed=os,devrandom" +EXTRA_OECONF_class-nativesdk = "--with-rand-seed=os,devrandom" + +# Relying on hardcoded built-in paths causes openssl-native to not be relocateable from sstate. +CFLAGS_append_class-native = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin" +CFLAGS_append_class-nativesdk = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin" + +do_configure () { + os=${HOST_OS} + case $os in + linux-gnueabi |\ + linux-gnuspe |\ + linux-musleabi |\ + linux-muslspe |\ + linux-musl ) + os=linux + ;; + *) + ;; + esac + target="$os-${HOST_ARCH}" + case $target in + linux-arm*) + target=linux-armv4 + ;; + linux-aarch64*) + target=linux-aarch64 + ;; + linux-i?86 | linux-viac3) + target=linux-x86 + ;; + linux-gnux32-x86_64 | linux-muslx32-x86_64 ) + target=linux-x32 + ;; + linux-gnu64-x86_64) + target=linux-x86_64 + ;; + linux-mips | linux-mipsel) + # specifying TARGET_CC_ARCH prevents openssl from (incorrectly) adding target architecture flags + target="linux-mips32 ${TARGET_CC_ARCH}" + ;; + linux-gnun32-mips*) + target=linux-mips64 + ;; + linux-*-mips64 | linux-mips64 | linux-*-mips64el | linux-mips64el) + target=linux64-mips64 + ;; + linux-microblaze* | linux-nios2* | linux-sh3 | linux-sh4 | linux-arc*) + target=linux-generic32 + ;; + linux-powerpc) + target=linux-ppc + ;; + linux-powerpc64) + target=linux-ppc64 + ;; + linux-powerpc64le) + target=linux-ppc64le + ;; + linux-riscv32) + target=linux-generic32 + ;; + linux-riscv64) + target=linux-generic64 + ;; + linux-sparc | linux-supersparc) + target=linux-sparcv9 + ;; + esac + + useprefix=${prefix} + if [ "x$useprefix" = "x" ]; then + useprefix=/ + fi + # WARNING: do not set compiler/linker flags (-I/-D etc.) in EXTRA_OECONF, as they will fully replace the + # environment variables set by bitbake. Adjust the environment variables instead. + HASHBANGPERL="/usr/bin/env perl" PERL=perl PERL5LIB="${S}/external/perl/Text-Template-1.46/lib/" \ + perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=${libdir} $target + perl ${B}/configdata.pm --dump +} + +do_install () { + oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install + + oe_multilib_header openssl/opensslconf.h + + # Create SSL structure for packages such as ca-certificates which + # contain hard-coded paths to /etc/ssl. Debian does the same. + install -d ${D}${sysconfdir}/ssl + mv ${D}${libdir}/ssl-1.1/certs \ + ${D}${libdir}/ssl-1.1/private \ + ${D}${libdir}/ssl-1.1/openssl.cnf \ + ${D}${sysconfdir}/ssl/ + + # Although absolute symlinks would be OK for the target, they become + # invalid if native or nativesdk are relocated from sstate. + ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/certs')} ${D}${libdir}/ssl-1.1/certs + ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/private')} ${D}${libdir}/ssl-1.1/private + ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/openssl.cnf')} ${D}${libdir}/ssl-1.1/openssl.cnf +} + +do_install_append_class-native () { + create_wrapper ${D}${bindir}/openssl \ + OPENSSL_CONF=${libdir}/ssl-1.1/openssl.cnf \ + SSL_CERT_DIR=${libdir}/ssl-1.1/certs \ + SSL_CERT_FILE=${libdir}/ssl-1.1/cert.pem \ + OPENSSL_ENGINES=${libdir}/engines-1.1 +} + +do_install_append_class-nativesdk () { + mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d + install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh + sed 's|/usr/lib/ssl/|/usr/lib/ssl-1.1/|g' -i ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh +} + +PTEST_BUILD_HOST_FILES += "configdata.pm" +PTEST_BUILD_HOST_PATTERN = "perl_version =" +do_install_ptest () { + # Prune the build tree + rm -f ${B}/fuzz/*.* ${B}/test/*.* + + cp ${S}/Configure ${B}/configdata.pm ${D}${PTEST_PATH} + cp -r ${S}/external ${B}/test ${S}/test ${B}/fuzz ${S}/util ${B}/util ${D}${PTEST_PATH} + + # For test_shlibload + ln -s ${libdir}/libcrypto.so.1.1 ${D}${PTEST_PATH}/ + ln -s ${libdir}/libssl.so.1.1 ${D}${PTEST_PATH}/ + + install -d ${D}${PTEST_PATH}/apps + ln -s ${bindir}/openssl ${D}${PTEST_PATH}/apps + install -m644 ${S}/apps/*.pem ${S}/apps/*.srl ${S}/apps/openssl.cnf ${D}${PTEST_PATH}/apps + install -m755 ${B}/apps/CA.pl ${D}${PTEST_PATH}/apps + + install -d ${D}${PTEST_PATH}/engines + install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines +} + +# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto +# package RRECOMMENDS on this package. This will enable the configuration +# file to be installed for both the openssl-bin package and the libcrypto +# package since the openssl-bin package depends on the libcrypto package. + +PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc" + +FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}" +FILES_libssl = "${libdir}/libssl${SOLIBS}" +FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf" +FILES_${PN}-engines = "${libdir}/engines-1.1" +FILES_${PN}-misc = "${libdir}/ssl-1.1/misc" +FILES_${PN} =+ "${libdir}/ssl-1.1/*" +FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh" + +CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf" + +RRECOMMENDS_libcrypto += "openssl-conf" +RDEPENDS_${PN}-ptest += "openssl-bin perl perl-modules bash" + +BBCLASSEXTEND = "native nativesdk" + +CVE_PRODUCT = "openssl:openssl" + +# Only affects OpenSSL >= 1.1.1 in combination with Apache < 2.4.37 +# Apache in meta-webserver is already recent enough +CVE_CHECK_WHITELIST += "CVE-2019-0190" diff --git a/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0034-Fix-double-free-in-netgroupcache-BZ-27462.patch b/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0034-Fix-double-free-in-netgroupcache-BZ-27462.patch deleted file mode 100644 index 28580c7e2..000000000 --- a/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc/0034-Fix-double-free-in-netgroupcache-BZ-27462.patch +++ /dev/null @@ -1,44 +0,0 @@ -From dca565886b5e8bd7966e15f0ca42ee5cff686673 Mon Sep 17 00:00:00 2001 -From: DJ Delorie -Date: Thu, 25 Feb 2021 16:08:21 -0500 -Subject: [PATCH] nscd: Fix double free in netgroupcache [BZ #27462] - -In commit 745664bd798ec8fd50438605948eea594179fba1 a use-after-free -was fixed, but this led to an occasional double-free. This patch -tracks the "live" allocation better. - -Tested manually by a third party. - -Related: RHBZ 1927877 - -Reviewed-by: Siddhesh Poyarekar -Reviewed-by: Carlos O'Donell ---- - nscd/netgroupcache.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c -index dba6ceec1b..ad2daddafd 100644 ---- a/nscd/netgroupcache.c -+++ b/nscd/netgroupcache.c -@@ -248,7 +248,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, - : NULL); - ndomain = (ndomain ? newbuf + ndomaindiff - : NULL); -- buffer = newbuf; -+ *tofreep = buffer = newbuf; - } - - nhost = memcpy (buffer + bufused, -@@ -319,7 +319,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, - else if (status == NSS_STATUS_TRYAGAIN && e == ERANGE) - { - buflen *= 2; -- buffer = xrealloc (buffer, buflen); -+ *tofreep = buffer = xrealloc (buffer, buflen); - } - else if (status == NSS_STATUS_RETURN - || status == NSS_STATUS_NOTFOUND --- -2.27.0 - diff --git a/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc_%.bbappend b/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc_%.bbappend index 6ee6db4fa..327c1ce64 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-core/glibc/glibc_%.bbappend @@ -1,6 +1,5 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += " \ - file://0034-Fix-double-free-in-netgroupcache-BZ-27462.patch \ file://0035-Fix-build-error.patch \ " diff --git a/meta-openbmc-mods/meta-common/recipes-core/ipmi/intel-ipmi-oem_%.bbappend b/meta-openbmc-mods/meta-common/recipes-core/ipmi/intel-ipmi-oem_%.bbappend index 4650ec29b..d1aa797a1 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/ipmi/intel-ipmi-oem_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-core/ipmi/intel-ipmi-oem_%.bbappend @@ -2,4 +2,4 @@ EXTRA_OECMAKE += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', '-DINTEL_PF EXTRA_OECMAKE += "${@bb.utils.contains('EXTRA_IMAGE_FEATURES', 'validation-unsecure', '-DBMC_VALIDATION_UNSECURE_FEATURE=ON', '', d)}" EXTRA_OECMAKE += "-DUSING_ENTITY_MANAGER_DECORATORS=OFF" SRC_URI = "git://github.com/openbmc/intel-ipmi-oem.git" -SRCREV = "06aa21ab75cecce354b2a17e05d053c6f61d6a29" +SRCREV = "01fbd0176c403feb29bf2a9ddd17469d0a27c3ef" diff --git a/meta-openbmc-mods/meta-common/recipes-core/libpeci/libpeci_%.bbappend b/meta-openbmc-mods/meta-common/recipes-core/libpeci/libpeci_%.bbappend index 3e201e799..817e164a4 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/libpeci/libpeci_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-core/libpeci/libpeci_%.bbappend @@ -1,3 +1,3 @@ # Enable downstream autobump SRC_URI = "git://github.com/openbmc/libpeci" -SRCREV = "8fc53d7cef0dd7ac405b5d7d91a368f376cdb508" +SRCREV = "ff44e549c44c7658ec11e0c19c13c4c45900cfe4" diff --git a/meta-openbmc-mods/meta-common/recipes-core/safec/safec_3.4.bb b/meta-openbmc-mods/meta-common/recipes-core/safec/safec_3.4.bb index d8bfc68c0..bc62305e8 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/safec/safec_3.4.bb +++ b/meta-openbmc-mods/meta-common/recipes-core/safec/safec_3.4.bb @@ -7,7 +7,7 @@ SECTION = "lib" inherit autotools pkgconfig S = "${WORKDIR}/git" -SRCREV = "a4abce065446410d137cece7cd017ff80251713d" +SRCREV = "bfc9f8bb8a9bfd02fde8ef3fd78fcd61411d070d" SRC_URI = "git://github.com/rurban/safeclib.git" COMPATIBLE_HOST = '(x86_64|i.86|powerpc|powerpc64|arm|aarch64).*-linux' diff --git a/meta-openbmc-mods/meta-common/recipes-extended/pam/libpam_%.bbappend b/meta-openbmc-mods/meta-common/recipes-extended/pam/libpam_%.bbappend index 3c1c501ee..96439ffc7 100644 --- a/meta-openbmc-mods/meta-common/recipes-extended/pam/libpam_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-extended/pam/libpam_%.bbappend @@ -1 +1,7 @@ RDEPENDS_${PN}-runtime += "${MLPREFIX}pam-plugin-localuser-${libpam_suffix}" + +#Default settings lockout duration to 300 seconds and threshold value to 10 +do_install_append() { + sed -i 's/deny=0/deny=10/' ${D}${sysconfdir}/pam.d/common-auth + sed -i 's/unlock_time=0/unlock_time=300/' ${D}${sysconfdir}/pam.d/common-auth +} diff --git a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend index 6d16fe190..5e3751ded 100644 --- a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend @@ -1,5 +1,8 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +SRC_URI = "git://github.com/openbmc/sdbusplus.git;nobranch=1" +SRCREV = "95874d930f0bcc8390cd47ab3bb1e5e46db45278" SRC_URI += " \ file://0001-Revert-server-Check-return-code-for-sd_bus_add_objec.patch \ " + diff --git a/meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver_%.bbappend b/meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver_%.bbappend index de947b627..f42119baa 100644 --- a/meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver_%.bbappend @@ -2,4 +2,4 @@ FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" # Use the latest to support obmc-ikvm properly SRC_URI = "git://github.com/LibVNC/libvncserver" -SRCREV = "242fda806d16f06890fb61339aa0a585443af8bb" +SRCREV = "2b6d595e3ea89597b3bebbf545eb7d3c0a1224a8" diff --git a/meta-openbmc-mods/meta-common/recipes-intel/host-misc-comm-manager/host-misc-comm-manager_git.bb b/meta-openbmc-mods/meta-common/recipes-intel/host-misc-comm-manager/host-misc-comm-manager_git.bb index 444f308ba..a562636ba 100644 --- a/meta-openbmc-mods/meta-common/recipes-intel/host-misc-comm-manager/host-misc-comm-manager_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-intel/host-misc-comm-manager/host-misc-comm-manager_git.bb @@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" SRC_URI = "git://github.com/Intel-BMC/host-misc-comm-manager.git;protocol=ssh" -SRCREV = "47a56d7f753b5d0dd1eb0ef88005a966eaaa1144" +SRCREV = "0d8577404fd321841fc84de547fe3d1d2a36909f" inherit cmake systemd SYSTEMD_SERVICE_${PN} = "xyz.openbmc_project.Host.Misc.Manager.service" diff --git a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/intel-blocksign-native.bb b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/intel-blocksign-native.bb index c28d6a789..95ecf30fc 100644 --- a/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/intel-blocksign-native.bb +++ b/meta-openbmc-mods/meta-common/recipes-intel/intel-pfr/intel-blocksign-native.bb @@ -1,7 +1,7 @@ SUMMARY = "Intel Blocksign tool for PFR image" DESCRIPTION = "Image signing tool for BMC PFR image" -inherit native cmake +inherit cmake native LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" diff --git a/meta-openbmc-mods/meta-common/recipes-intel/smbios/smbios-mdrv2.bb b/meta-openbmc-mods/meta-common/recipes-intel/smbios/smbios-mdrv2.bb index ef2c2fc20..fa591872a 100644 --- a/meta-openbmc-mods/meta-common/recipes-intel/smbios/smbios-mdrv2.bb +++ b/meta-openbmc-mods/meta-common/recipes-intel/smbios/smbios-mdrv2.bb @@ -2,7 +2,7 @@ SUMMARY = "SMBIOS MDR version 2 service for Intel based platform" DESCRIPTION = "SMBIOS MDR version 2 service for Intel based platfrom" SRC_URI = "git://github.com/openbmc/smbios-mdr.git" -SRCREV = "ef55ef0590fc44e3b633635456f782999896b8ad" +SRCREV = "2285be4fd22709c1dcfba10c2c604528353b428a" S = "${WORKDIR}/git" diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend index 4af0acc49..591e86160 100644 --- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend @@ -4,7 +4,7 @@ KBRANCH = "dev-5.10-intel" KSRC = "git://github.com/Intel-BMC/linux;protocol=ssh;branch=${KBRANCH}" # Include this as a comment only for downstream auto-bump # SRC_URI = "git://github.com/Intel-BMC/linux;protocol=ssh;branch=dev-5.10-intel" -SRCREV="807fd9e1636097ca70957a3ff373bd1280737e46" +SRCREV="faadf371d041eb0d2c8b1d4cc729f19cf53e6a92" do_compile_prepend(){ # device tree compiler flags diff --git a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch index a8dd27f8a..6bfe783af 100644 --- a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch +++ b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0003-Adding-channel-specific-privilege-to-network.patch @@ -1,4 +1,4 @@ -From c5c5634ccc31cd494ad5333987fa6076f0f7464a Mon Sep 17 00:00:00 2001 +From 07bba51a168b769563a649f1c0f3a9126f480e57 Mon Sep 17 00:00:00 2001 From: AppaRao Puli Date: Thu, 2 Apr 2020 17:06:07 +0530 Subject: [PATCH] Adding channel specific privilege to network @@ -19,17 +19,17 @@ Signed-off-by: AppaRao Puli Signed-off-by: Yong Li Signed-off-by: Johnathan Mantey --- - ethernet_interface.cpp | 123 +++++++++++++++++++++++++++++++++++++++++ - ethernet_interface.hpp | 37 ++++++++++++- - network_manager.cpp | 102 ++++++++++++++++++++++++++++++++++ + ethernet_interface.cpp | 124 +++++++++++++++++++++++++++++++++++++++++ + ethernet_interface.hpp | 37 +++++++++++- + network_manager.cpp | 102 +++++++++++++++++++++++++++++++++ network_manager.hpp | 9 +++ - 4 files changed, 270 insertions(+), 1 deletion(-) + 4 files changed, 271 insertions(+), 1 deletion(-) diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp -index 522be57..89adf69 100644 +index c47a759..d7a4168 100644 --- a/ethernet_interface.cpp +++ b/ethernet_interface.cpp -@@ -44,6 +44,10 @@ constexpr auto PROPERTY_INTERFACE = "org.freedesktop.DBus.Properties"; +@@ -45,6 +45,10 @@ constexpr auto PROPERTY_INTERFACE = "org.freedesktop.DBus.Properties"; constexpr auto RESOLVED_SERVICE_PATH = "/org/freedesktop/resolve1/link/"; constexpr auto METHOD_GET = "Get"; @@ -40,7 +40,7 @@ index 522be57..89adf69 100644 struct EthernetIntfSocket { EthernetIntfSocket(int domain, int type, int protocol) -@@ -101,6 +105,7 @@ EthernetInterface::EthernetInterface(sdbusplus::bus::bus& bus, +@@ -128,6 +132,7 @@ EthernetInterface::EthernetInterface(sdbusplus::bus::bus& bus, EthernetInterfaceIntf::autoNeg(std::get<2>(ifInfo)); EthernetInterfaceIntf::speed(std::get<0>(ifInfo)); #endif @@ -48,10 +48,11 @@ index 522be57..89adf69 100644 // Emit deferred signal. if (emitSignal) -@@ -1068,5 +1073,123 @@ void EthernetInterface::deleteAll() +@@ -1148,5 +1153,124 @@ std::string EthernetInterface::defaultGateway6(std::string gateway) manager.writeToConfigurationFile(); + return gw; } - ++ +nlohmann::json EthernetInterface::readJsonFile(const std::string& configFile) +{ + std::ifstream jsonFile(configFile); @@ -173,7 +174,7 @@ index 522be57..89adf69 100644 } // namespace network } // namespace phosphor diff --git a/ethernet_interface.hpp b/ethernet_interface.hpp -index abaf43e..f6d6363 100644 +index e2418a2..60fd272 100644 --- a/ethernet_interface.hpp +++ b/ethernet_interface.hpp @@ -2,11 +2,14 @@ @@ -216,9 +217,9 @@ index abaf43e..f6d6363 100644 class Manager; // forward declaration of network manager. -@@ -223,6 +230,14 @@ class EthernetInterface : public Ifaces +@@ -233,6 +240,14 @@ class EthernetInterface : public Ifaces */ - void deleteAll(); + std::string defaultGateway6(std::string gateway) override; + /** @brief sets the channel maxium privilege. + * @param[in] value - Channel privilege which needs to be set on the @@ -231,7 +232,7 @@ index abaf43e..f6d6363 100644 using EthernetInterfaceIntf::dHCPEnabled; using EthernetInterfaceIntf::interfaceName; using EthernetInterfaceIntf::linkUp; -@@ -344,6 +359,26 @@ class EthernetInterface : public Ifaces +@@ -356,6 +371,26 @@ class EthernetInterface : public Ifaces * @returns true/false value if the address is static */ bool originIsManuallyAssigned(IP::AddressOrigin origin); @@ -406,5 +407,5 @@ index 6815d3f..96e20a6 100644 } // namespace network -- -2.29.2 +2.17.1 diff --git a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0004-Improved-IPv6-netmask-parsing.patch b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0004-Improved-IPv6-netmask-parsing.patch deleted file mode 100644 index d0ba59ccd..000000000 --- a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network/0004-Improved-IPv6-netmask-parsing.patch +++ /dev/null @@ -1,127 +0,0 @@ -From 371fb36e7a92b4139022b568a278e7624727bbaf Mon Sep 17 00:00:00 2001 -From: Johnathan Mantey -Date: Tue, 26 Jan 2021 15:02:54 -0800 -Subject: [PATCH] Improved IPv6 netmask parsing - -The subnet mask parsing in toV6CIDR only worked for very well behaved -subnet strings. This became apparent after the BMC received a DHCP -assigned IPv6 address with an Address Prefix equal to /128. Any -netmask values trailing the final ":" character were ignored. In -addition it assumed all subnet entries would be submitted in shorthand -form. - -The changes here handle mask values supplied following the final ":" -character. It also does more sanity checking on the incoming subnet -string. - -Tested: -Supplied the function with the following test patterns, and confirmed -the function returns accurate address prefix values. - ffff:ffff:: - ffff:fc00:: - ffff:0:0:0:0:0:0:0 - ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff - ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffc - ffff:0:0:6:0:0:0:0 - : - :: - -Change-Id: Ib2c73fe07a6a3f1c7a5f0e8f231dfef21badb3af -Signed-off-by: Johnathan Mantey - -%% original patch: 0004-Improved-IPv6-netmask-parsing.patch ---- - util.cpp | 67 ++++++++++++++++++++------------------------------------ - 1 file changed, 24 insertions(+), 43 deletions(-) - -diff --git a/util.cpp b/util.cpp -index 0c5dbff..c230221 100644 ---- a/util.cpp -+++ b/util.cpp -@@ -37,59 +37,40 @@ namespace fs = std::filesystem; - - uint8_t toV6Cidr(const std::string& subnetMask) - { -- uint8_t pos = 0; -- uint8_t prevPos = 0; -- uint8_t cidr = 0; -- uint16_t buff{}; -- do -+ struct in6_addr subnet; -+ int ret = inet_pton(AF_INET6, subnetMask.c_str(), &subnet); -+ if (ret != 1) - { -- // subnet mask look like ffff:ffff:: -- // or ffff:c000:: -- pos = subnetMask.find(":", prevPos); -- if (pos == std::string::npos) -- { -- break; -- } -- -- auto str = subnetMask.substr(prevPos, (pos - prevPos)); -- prevPos = pos + 1; -+ log("Invalid Mask", -+ entry("SUBNETMASK=%s", subnetMask.c_str())); -+ return 0; -+ } - -- // String length is 0 -- if (!str.length()) -- { -- return cidr; -- } -- // converts it into number. -- if (sscanf(str.c_str(), "%hx", &buff) <= 0) -+ uint8_t cidr = 0; -+ bool zeroesFound = false; -+ int bitsSet, trailingZeroes; -+ for (int lv = 0; lv < 4; lv++) -+ { -+ subnet.s6_addr32[lv] = be32toh(subnet.s6_addr32[lv]); -+ bitsSet = __builtin_popcount(subnet.s6_addr32[lv]); -+ if (zeroesFound && bitsSet) - { - log("Invalid Mask", - entry("SUBNETMASK=%s", subnetMask.c_str())); -- - return 0; - } -+ trailingZeroes = __builtin_ctz(subnet.s6_addr32[lv]); -+ zeroesFound |= trailingZeroes; - -- // convert the number into bitset -- // and check for how many ones are there. -- // if we don't have all the ones then make -- // sure that all the ones should be left justify. -- -- if (__builtin_popcount(buff) != 16) -+ if (bitsSet + trailingZeroes != 32) - { -- if (((sizeof(buff) * 8) - (__builtin_ctz(buff))) != -- __builtin_popcount(buff)) -- { -- log("Invalid Mask", -- entry("SUBNETMASK=%s", subnetMask.c_str())); -- -- return 0; -- } -- cidr += __builtin_popcount(buff); -- return cidr; -+ // There are '1' bits interspersed with '0' bits -+ log("Invalid Mask", -+ entry("SUBNETMASK=%s", subnetMask.c_str())); -+ return 0; - } -- -- cidr += 16; -- } while (1); -- -+ cidr += bitsSet; -+ } - return cidr; - } - } // anonymous namespace --- -2.26.2 - diff --git a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend index 973cba09e..3540e93b4 100644 --- a/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-network/network/phosphor-network_%.bbappend @@ -3,10 +3,9 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" DEPENDS += "nlohmann-json boost" SRC_URI = "git://github.com/openbmc/phosphor-networkd" -SRCREV = "1b5ec9c5367947d19bdf6efd08251eeb55dd90f4" +SRCREV = "ee5b2c9469a56205567a8b1b120ecf34fc9f5ef4" SRC_URI += "file://0003-Adding-channel-specific-privilege-to-network.patch \ - file://0004-Improved-IPv6-netmask-parsing.patch \ " EXTRA_OECONF_append = " --enable-nic-ethtool=yes" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-Improve-initialization-of-I2C-sensors.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-Improve-initialization-of-I2C-sensors.patch index fdd2ba6e3..e47111c56 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-Improve-initialization-of-I2C-sensors.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-Improve-initialization-of-I2C-sensors.patch @@ -1,4 +1,4 @@ -From 85e7b2d9ede4bb33e02f48ea1d4691d2154fc4a5 Mon Sep 17 00:00:00 2001 +From a85d4c9cf702965593ec771e57a975e30d1d5853 Mon Sep 17 00:00:00 2001 From: Johnathan Mantey Date: Tue, 13 Oct 2020 15:00:51 -0700 Subject: [PATCH] Improve initialization of I2C sensors @@ -32,15 +32,15 @@ missing after AC cycles. Change-Id: I118df674162677d66e7d211b089430fce384086b Signed-off-by: Johnathan Mantey --- - include/devices.hpp | 165 ++++++++++++++++++++----------------- + include/devices.hpp | 167 +++++++++++++++++++++----------------- src/Overlay.cpp | 192 ++++++++++++++++++++++++++++++++++---------- - 2 files changed, 239 insertions(+), 118 deletions(-) + 2 files changed, 243 insertions(+), 116 deletions(-) diff --git a/include/devices.hpp b/include/devices.hpp -index c375b1c..b7dc7d0 100644 +index 50fbe63..2e299a0 100644 --- a/include/devices.hpp +++ b/include/devices.hpp -@@ -31,105 +31,122 @@ struct CmpStr +@@ -31,107 +31,130 @@ struct CmpStr struct ExportTemplate { @@ -61,14 +61,20 @@ index c375b1c..b7dc7d0 100644 const boost::container::flat_map exportTemplates{ -- {{"24C02", ExportTemplate("24c02 $Address", -- "/sys/bus/i2c/devices/i2c-$Bus/new_device")}, -- {"24C64", ExportTemplate("24c64 $Address", -- "/sys/bus/i2c/devices/i2c-$Bus/new_device")}, + {{"EEPROM_24C02", + ExportTemplate("24c02 $Address", +- "/sys/bus/i2c/devices/i2c-$Bus/new_device")}, ++ "/sys/bus/i2c/devices/i2c-$Bus/new_device", ++ "new_device", "delete_device", false)}, + {"EEPROM_24C64", + ExportTemplate("24c64 $Address", +- "/sys/bus/i2c/devices/i2c-$Bus/new_device")}, - {"ADM1266", - ExportTemplate("adm1266 $Address", - "/sys/bus/i2c/devices/i2c-$Bus/new_device")}, -+ {{"24C02", ++ "/sys/bus/i2c/devices/i2c-$Bus/new_device", ++ "new_device", "delete_device", false)}, ++ {"24C02", + ExportTemplate("24c02 $Address", "/sys/bus/i2c/devices/i2c-$Bus", + "new_device", "delete_device", false)}, + {"24C64", diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0002-Entity-manager-Add-support-to-update-assetTag.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0002-Entity-manager-Add-support-to-update-assetTag.patch index 88e86f68c..8682e2cad 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0002-Entity-manager-Add-support-to-update-assetTag.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0002-Entity-manager-Add-support-to-update-assetTag.patch @@ -1,6 +1,6 @@ -From 1e8b3e0fe4ce9aa87a35f6c3ba6e506873d5455c Mon Sep 17 00:00:00 2001 +From ff5dbca96d12b1c2aaaec0bb891125990af3f218 Mon Sep 17 00:00:00 2001 From: mansijos -Date: Fri, 12 Feb 2021 11:26:57 +0530 +Date: Tue, 6 Apr 2021 02:12:56 +0530 Subject: [PATCH] Entity-manager: Add support to update assetTag Asset tag is an updateable property from User level interface like @@ -12,58 +12,17 @@ Successfully updated in assetTag interface as well as in fru interface while using set-property and using redfish as well. The new value is preserved after BMC resets. -Change-Id: Iab8b24344d1a27486ceafe21aa2b4496706a2944 +Change-Id: If7fbfd8325488280f500ab0e2c8b38475813cc3f Signed-off-by: mansijos --- - include/EntityManager.hpp | 15 ++-- - src/EntityManager.cpp | 148 ++++++++++++++++++++++++++++++++------ - 2 files changed, 135 insertions(+), 28 deletions(-) + src/EntityManager.cpp | 92 +++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 88 insertions(+), 4 deletions(-) -diff --git a/include/EntityManager.hpp b/include/EntityManager.hpp -index 5867556..a4e9922 100644 ---- a/include/EntityManager.hpp -+++ b/include/EntityManager.hpp -@@ -29,13 +29,16 @@ - #include - #include - --using DBusProbeObjectT = boost::container::flat_map< -- std::string, -- std::vector>>; -- - using FoundDeviceT = - std::vector>; - -+using FoundDeviceInfoT = std::vector< -+ std::tuple, -+ std::string, std::string, std::string>>; -+ -+using DBusProbeObjectT = -+ boost::container::flat_map; -+ - struct PerformScan : std::enable_shared_from_this - { - -@@ -62,12 +65,12 @@ struct PerformProbe : std::enable_shared_from_this - { - PerformProbe(const std::vector& probeCommand, - std::shared_ptr& scanPtr, -- std::function&& callback); -+ std::function&& callback); - virtual ~PerformProbe(); - - std::vector _probeCommand; - std::shared_ptr scan; -- std::function _callback; -+ std::function _callback; - }; - - inline void logDeviceAdded(const nlohmann::json& record) diff --git a/src/EntityManager.cpp b/src/EntityManager.cpp -index aa1df20..cd73675 100644 +index 932b6f9..67b8f95 100644 --- a/src/EntityManager.cpp +++ b/src/EntityManager.cpp -@@ -47,9 +47,14 @@ constexpr const char* lastConfiguration = "/tmp/configuration/last.json"; +@@ -47,9 +47,17 @@ constexpr const char* lastConfiguration = "/tmp/configuration/last.json"; constexpr const char* currentConfiguration = "/var/configuration/system.json"; constexpr const char* globalSchema = "global.json"; constexpr const int32_t MAX_MAPPER_DEPTH = 0; @@ -74,99 +33,14 @@ index aa1df20..cd73675 100644 +using foundProbeData = std::map; +static foundProbeData foundData; +static std::map mapFoundData; ++ ++constexpr const char* fruConn = "xyz.openbmc_project.FruDevice"; ++constexpr const char* fruIntf = "xyz.openbmc_project.FruDevice"; + struct cmp_str { bool operator()(const char* a, const char* b) const -@@ -169,7 +174,10 @@ void getInterfaces( - return; - } - -- scan->dbusProbeObjects[std::get<2>(call)].emplace_back(resp); -+ // Save the dbus info along with device info -+ scan->dbusProbeObjects[std::get<2>(call)].emplace_back( -+ std::make_tuple(resp, std::get<0>(call), std::get<1>(call), -+ std::get<2>(call))); - }, - std::get<0>(call), std::get<1>(call), "org.freedesktop.DBus.Properties", - "GetAll", std::get<2>(call)); -@@ -274,11 +282,10 @@ void findDbusObjects(std::vector>&& probeVector, - // probes dbus interface dictionary for a key with a value that matches a regex - bool probeDbus(const std::string& interface, - const std::map& matches, -- FoundDeviceT& devices, std::shared_ptr scan, -+ FoundDeviceInfoT& devices, std::shared_ptr scan, - bool& foundProbe) - { -- std::vector>& -- dbusObject = scan->dbusProbeObjects[interface]; -+ FoundDeviceInfoT& dbusObject = scan->dbusProbeObjects[interface]; - if (dbusObject.empty()) - { - foundProbe = false; -@@ -287,8 +294,9 @@ bool probeDbus(const std::string& interface, - foundProbe = true; - - bool foundMatch = false; -- for (auto& device : dbusObject) -+ for (auto& deviceInfo : dbusObject) - { -+ auto& device = std::get<0>(deviceInfo); - bool deviceMatches = true; - for (auto& match : matches) - { -@@ -305,7 +313,7 @@ bool probeDbus(const std::string& interface, - } - if (deviceMatches) - { -- devices.emplace_back(device); -+ devices.emplace_back(deviceInfo); - foundMatch = true; - deviceMatches = false; // for next iteration - } -@@ -315,11 +323,8 @@ bool probeDbus(const std::string& interface, - - // default probe entry point, iterates a list looking for specific types to - // call specific probe functions --bool probe( -- const std::vector& probeCommand, -- std::shared_ptr scan, -- std::vector>& -- foundDevs) -+bool probe(const std::vector& probeCommand, -+ std::shared_ptr scan, FoundDeviceInfoT& foundDevs) - { - const static std::regex command(R"(\((.*)\))"); - std::smatch match; -@@ -449,8 +454,9 @@ bool probe( - // probe passed, but empty device - if (ret && foundDevs.size() == 0) - { -- foundDevs.emplace_back( -- boost::container::flat_map{}); -+ foundDevs.emplace_back(std::make_tuple( -+ boost::container::flat_map{}, -+ std::string{}, std::string{}, std::string{})); - } - if (matchOne && ret) - { -@@ -465,13 +471,13 @@ bool probe( - - PerformProbe::PerformProbe(const std::vector& probeCommand, - std::shared_ptr& scanPtr, -- std::function&& callback) : -+ std::function&& callback) : - _probeCommand(probeCommand), - scan(scanPtr), _callback(std::move(callback)) - {} - PerformProbe::~PerformProbe() - { -- FoundDeviceT foundDevs; -+ FoundDeviceInfoT foundDevs; - if (probe(_probeCommand, scan, foundDevs)) - { - _callback(foundDevs); -@@ -556,6 +562,47 @@ void addArrayToDbus(const std::string& name, const nlohmann::json& array, +@@ -575,6 +583,43 @@ void addArrayToDbus(const std::string& name, const nlohmann::json& array, } } @@ -186,11 +60,8 @@ index aa1df20..cd73675 100644 + } + + foundProbeData& tmpMap = it->second; -+ auto foundConn = tmpMap.find("foundConn"); + auto foundPath = tmpMap.find("foundPath"); -+ auto foundIntf = tmpMap.find("foundIntf"); -+ if (foundConn == tmpMap.end() || foundPath == tmpMap.end() || -+ foundIntf == tmpMap.end()) ++ if (foundPath == tmpMap.end()) + { + std::cerr << "No prob object data is avaliable in foundProbeData" + << "\n"; @@ -205,20 +76,16 @@ index aa1df20..cd73675 100644 + << "\n"; + } + }, -+ foundConn->second, foundPath->second, "org.freedesktop.DBus.Properties", -+ "Set", foundIntf->second, "PRODUCT_ASSET_TAG", -+ std::variant(newVal)); ++ fruConn, foundPath->second, "org.freedesktop.DBus.Properties", "Set", ++ fruIntf, "PRODUCT_ASSET_TAG", std::variant(newVal)); + return true; +} + template void addProperty(const std::string& propertyName, const PropertyType& value, sdbusplus::asio::dbus_interface* iface, -@@ -568,11 +615,21 @@ void addProperty(const std::string& propertyName, const PropertyType& value, - iface->register_property(propertyName, value); - return; +@@ -589,9 +634,18 @@ void addProperty(const std::string& propertyName, const PropertyType& value, } -+ iface->register_property( propertyName, value, - [&systemConfiguration, @@ -237,19 +104,17 @@ index aa1df20..cd73675 100644 val = newVal; if (!setJsonFromPointer(jsonPointerString, val, systemConfiguration)) -@@ -970,6 +1027,11 @@ void postToDbus(const nlohmann::json& newConfiguration, +@@ -989,6 +1043,9 @@ void postToDbus(const nlohmann::json& newConfiguration, populateInterfaceFromJson(systemConfiguration, jsonPointerPath, boardIface, boardValues, objServer); jsonPointerPath += "/"; + -+ std::string foundConn; + std::string foundPath; -+ std::string foundIntf; + // iterate through board properties for (auto& boardField : boardValues.items()) { -@@ -979,9 +1041,32 @@ void postToDbus(const nlohmann::json& newConfiguration, +@@ -998,9 +1055,28 @@ void postToDbus(const nlohmann::json& newConfiguration, createInterface(objServer, boardName, boardField.key(), boardKeyOrig); @@ -258,16 +123,12 @@ index aa1df20..cd73675 100644 - iface, boardField.value(), objServer); + if (boardField.key() == "FoundProbe") + { -+ foundConn = boardField.value()["Connection"]; + foundPath = boardField.value()["Path"]; -+ foundIntf = boardField.value()["Interface"]; + } + if (boardField.key() == + "xyz.openbmc_project.Inventory.Decorator.AssetTag") + { -+ foundData["foundConn"] = foundConn; + foundData["foundPath"] = foundPath; -+ foundData["foundIntf"] = foundIntf; + mapFoundData[jsonPointerPath + boardField.key()] = + foundData; + @@ -285,63 +146,24 @@ index aa1df20..cd73675 100644 } } -@@ -1278,7 +1363,7 @@ void PerformScan::run() - auto thisRef = shared_from_this(); - auto probePointer = std::make_shared( - probeCommand, thisRef, -- [&, recordPtr, probeName](FoundDeviceT& foundDevices) { -+ [&, recordPtr, probeName](FoundDeviceInfoT& foundDevices) { - _passed = true; - - std::set usedNames; -@@ -1294,7 +1379,8 @@ void PerformScan::run() - for (auto itr = foundDevices.begin(); - itr != foundDevices.end();) - { -- std::string recordName = getRecordName(*itr, probeName); -+ std::string recordName = -+ getRecordName(std::get<0>(*itr), probeName); - - auto fromLastJson = lastJson.find(recordName); - if (fromLastJson != lastJson.end()) -@@ -1328,6 +1414,15 @@ void PerformScan::run() +@@ -1349,6 +1425,10 @@ void PerformScan::run() continue; } + nlohmann::json recordVal = *recordPtr; -+ // Save the dbus connection, path and interface info -+ // of the device -+ recordVal[foundObject]["Connection"] = -+ std::get<1>(*itr); -+ recordVal[foundObject]["Path"] = std::get<2>(*itr); -+ recordVal[foundObject]["Interface"] = -+ std::get<3>(*itr); ++ // Save the dbus path info of the device ++ recordVal[foundObject]["Path"] = std::get<1>(*itr); + int index = std::stoi( nameIt->get().substr(indexIdx), nullptr, 0); -@@ -1349,8 +1444,9 @@ void PerformScan::run() - - std::optional replaceStr; - -- for (auto& foundDevice : foundDevices) -+ for (auto& foundDeviceInfo : foundDevices) - { -+ auto& foundDevice = std::get<0>(foundDeviceInfo); - nlohmann::json record = *recordPtr; - std::string recordName = - getRecordName(foundDevice, probeName); -@@ -1382,6 +1478,14 @@ void PerformScan::run() +@@ -1421,6 +1501,10 @@ void PerformScan::run() } } -+ // Save the dbus connection, path and interface info -+ // of the device -+ record[foundObject]["Connection"] = -+ std::get<1>(foundDeviceInfo); -+ record[foundObject]["Path"] = std::get<2>(foundDeviceInfo); -+ record[foundObject]["Interface"] = -+ std::get<3>(foundDeviceInfo); ++ // Save the dbus path info of the device ++ record[foundObject]["Path"] = ++ std::get<1>(foundDeviceAndPath); + if (replaceStr) { diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0003-Add-logs-to-fwVersionIsSame.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0003-Add-logs-to-fwVersionIsSame.patch new file mode 100644 index 000000000..94af67967 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0003-Add-logs-to-fwVersionIsSame.patch @@ -0,0 +1,56 @@ +From 28525b56161e1b659e85e85c33fc00dc397758aa Mon Sep 17 00:00:00 2001 +From: Helen Huang +Date: Mon, 19 Apr 2021 16:06:15 +0800 +Subject: [PATCH] Add logs to fwVersionIsSame() + +Add logs to fwVersionIsSame() to indicate whether the firmware +version is changed or not. + +Tested: +Logs are printed as expected when firmware updating and BMC rebooting. + +Log of rebooting: +The firmware version is similiar as the last boot, +Hash value of versionFile is:3336889560 + +Log of Firmware update: +The firmware version is changed since the last boot, +hash value of current versionFile is:3336889560, +hash value of versionFile of last boot is:834871226 + +Change-Id: I5306917329d2e2e015af58cad1e9c59881f0b217 +Signed-off-by: Helen Huang +--- + include/Utils.hpp | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/include/Utils.hpp b/include/Utils.hpp +index 657af92..8238807 100644 +--- a/include/Utils.hpp ++++ b/include/Utils.hpp +@@ -116,13 +116,22 @@ inline bool fwVersionIsSame(void) + + if (expectedHash == hashString) + { ++ std::cout << "The firmware version is similiar as the last boot, " ++ "hash value of versionFile is:" ++ << hashString.c_str() << "\n"; + return true; + } ++ std::cout << "The firmware version is changed since the last boot, hash " ++ "value of current versionFile is:" ++ << expectedHash.c_str() ++ << ", hash value of versionFile of last boot is:" ++ << hashString.c_str() << "\n"; + hashFile.close(); + } + + std::ofstream output(versionHashFile); + output << expectedHash; ++ + return false; + } + +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend index 94bddf2be..9d891c620 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend @@ -1,10 +1,11 @@ # this is here just to bump faster than upstream # SRC_URI = "git://github.com/openbmc/entity-manager.git" -SRCREV = "296667f0076888f3cdf898a3f2cdf66da260853e" +SRCREV = "1694ef625a1075599e40faa695a40d61ccd91095" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += " file://0001-Improve-initialization-of-I2C-sensors.patch \ file://0002-Entity-manager-Add-support-to-update-assetTag.patch \ + file://0003-Add-logs-to-fwVersionIsSame.patch \ " diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/console/obmc-console/obmc-console@.service b/meta-openbmc-mods/meta-common/recipes-phosphor/console/obmc-console/obmc-console@.service index 7fb8f79d3..a242dba08 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/console/obmc-console/obmc-console@.service +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/console/obmc-console/obmc-console@.service @@ -5,15 +5,8 @@ After=dev-%i.device [Service] ExecStartPre=/usr/bin/sol-option-check.sh -ExecStartPre=/bin/sh -c 'echo -n "uart3" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart1' -ExecStartPre=/bin/sh -c 'echo -n "uart1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart3' -ExecStartPre=/bin/sh -c 'echo -n "io1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart4' -ExecStartPre=/bin/sh -c 'echo -n "uart4" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/io1' ExecStart=/usr/bin/env obmc-console-server --config {sysconfdir}/obmc-console.conf %i -ExecStopPost=/bin/sh -c 'echo -n "io1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart1' -ExecStopPost=/bin/sh -c 'echo -n "io3" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart3' -ExecStopPost=/bin/sh -c 'echo -n "io4" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart4' -ExecStopPost=/bin/sh -c 'echo -n "uart1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/io1' +ExecStopPost=/bin/sh -c 'echo -n "0" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/raw' SyslogIdentifier=obmc-console-server Restart=always diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend index 1aa090f54..e935531ee 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/dbus/phosphor-dbus-interfaces_%.bbappend @@ -1,7 +1,7 @@ # Keep this as a comment to enable the auto-bump script without # stomping on SRC_URI from previous .bbappend files #SRC_URI = "git://github.com/openbmc/phosphor-dbus-interfaces.git" -SRCREV = "ae956ad9efd2be24c5439a4ef6498fb5c8383719" +SRCREV = "33458d4432a8323616622881f314a73cf0b04d97" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend index d988b7c93..ab1cd3742 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/fans/phosphor-pid-control_%.bbappend @@ -5,6 +5,6 @@ SYSTEMD_SERVICE_${PN} = "phosphor-pid-control.service" EXTRA_OECONF = "--enable-configure-dbus=yes" SRC_URI = "git://github.com/openbmc/phosphor-pid-control.git" -SRCREV = "d11a732a802cc281f4c1583275871fbc5f5ecced" +SRCREV = "cb4c1a27574a7fe121a851ae7ba67aec254a1129" FILES_${PN} = "${bindir}/swampd ${bindir}/setsensor" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0015-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0015-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch deleted file mode 100644 index 54efbee8c..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0015-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch +++ /dev/null @@ -1,153 +0,0 @@ -From f2dd5e13a0774d8683542798dd96979f9d7a6691 Mon Sep 17 00:00:00 2001 -From: Vernon Mauery -Date: Tue, 29 Sep 2020 13:38:35 -0700 -Subject: [PATCH] Fix delete image by ID and inhibit removal of bmc_active - -Delete image by ID was broken because when hitting the delete dbus -interface, it recalculated the ID from the parent version, which then -does not match because of the random number addition that was added to -the ID when the parent interface was created. This saves away the parent -interface ID and recalls it rather than recalculating it. - -Also, there was a logic error in deleting images that would delete the -active BMC image. This fixes up that error. - -Tested: run multiple back-to back updates and see that when the fwupd - script calls delete on the seamless images, the interfaces are - deleted and that the bmc_active interface is not deleted. - -Signed-off-by: Vernon Mauery ---- - item_updater.cpp | 17 +++++++++++------ - pfr_image_manager.cpp | 2 +- - version.cpp | 2 +- - version.hpp | 19 +++++++++++++++---- - 4 files changed, 28 insertions(+), 12 deletions(-) - -diff --git a/item_updater.cpp b/item_updater.cpp -index db255d6..90970d3 100644 ---- a/item_updater.cpp -+++ b/item_updater.cpp -@@ -133,7 +133,7 @@ void ItemUpdater::createActivation(sdbusplus::message::message& msg) - activationState, associations))); - - auto versionPtr = std::make_unique( -- bus, path, version, purpose, filePath, -+ bus, path, versionId, version, purpose, filePath, - std::bind(&ItemUpdater::erase, this, std::placeholders::_1)); - versionPtr->deleteObject = - std::make_unique(bus, path, -@@ -247,7 +247,7 @@ void ItemUpdater::processBMCImage() - - // Create Version instance for this version. - auto versionPtr = std::make_unique( -- bus, path, version, purpose, "", -+ bus, path, id, version, purpose, "", - std::bind(&ItemUpdater::erase, this, std::placeholders::_1)); - auto isVersionFunctional = versionPtr->isFunctional(); - if (!isVersionFunctional) -@@ -322,11 +322,11 @@ void ItemUpdater::erase(std::string entryId) - auto it = versions.find(entryId); - if (it != versions.end()) - { -- if (it->second->isFunctional() && ACTIVE_BMC_MAX_ALLOWED > 1) -+ if (it->second->isFunctional()) - { -- log("Error: Version is currently running on the BMC. " -- "Unable to remove.", -- entry("VERSIONID=%s", entryId.c_str())); -+ log("Error: Version is currently running on the BMC. " -+ "Unable to remove.", -+ entry("VERSIONID=%s", entryId.c_str())); - return; - } - } -@@ -669,6 +669,11 @@ void ItemUpdater::freeSpace(Activation& caller) - std::size_t count = 0; - for (const auto& iter : activations) - { -+ if (versions.find(iter.second->versionId)->second->isFunctional()) -+ { -+ // don't bother with function versions -+ continue; -+ } - if ((iter.second.get()->activation() == - server::Activation::Activations::Active) || - (iter.second.get()->activation() == -diff --git a/pfr_image_manager.cpp b/pfr_image_manager.cpp -index 145237e..0c6c3d8 100644 ---- a/pfr_image_manager.cpp -+++ b/pfr_image_manager.cpp -@@ -308,7 +308,7 @@ int Manager::processImage(const std::string& imgFilePath) - std::string objPath = std::string{SOFTWARE_OBJPATH} + '/' + id; - - auto versionPtr = std::make_unique( -- bus, objPath, ver, purpose, imageDirPath.string(), -+ bus, objPath, id, ver, purpose, imageDirPath.string(), - std::bind(&Manager::erase, this, std::placeholders::_1)); - versionPtr->deleteObject = - std::make_unique(bus, objPath, -diff --git a/version.cpp b/version.cpp -index 18f3f4f..e6fd481 100644 ---- a/version.cpp -+++ b/version.cpp -@@ -182,7 +182,7 @@ void Delete::delete_() - { - if (parent.eraseCallback) - { -- parent.eraseCallback(parent.getId(parent.version())); -+ parent.eraseCallback(parent.getExtId()); - } - } - -diff --git a/version.hpp b/version.hpp -index 9cf76da..ae70ea8 100644 ---- a/version.hpp -+++ b/version.hpp -@@ -74,14 +74,15 @@ class Version : public VersionInherit - * @param[in] callback - The eraseFunc callback - */ - Version(sdbusplus::bus::bus& bus, const std::string& objPath, -- const std::string& versionString, VersionPurpose versionPurpose, -- const std::string& filePath, eraseFunc callback) : -+ const std::string& extId, const std::string& versionString, -+ VersionPurpose versionPurpose, const std::string& filePath, -+ eraseFunc callback) : - VersionInherit(bus, (objPath).c_str(), true), -- eraseCallback(callback), versionStr(versionString) -+ eraseCallback(callback), extId(extId), versionStr(versionString) - { - // Set properties. - purpose(versionPurpose); -- version(versionString); -+ version(extId); - path(filePath); - // Emit deferred signal. - emit_object_added(); -@@ -134,6 +135,15 @@ class Version : public VersionInherit - */ - bool isFunctional(); - -+ /* @brief Return the extended ID of this version object -+ * -+ * @ return - returns the extended ID string -+ */ -+ std::string getExtId() -+ { -+ return extId; -+ } -+ - /** @brief Persistent Delete D-Bus object */ - std::unique_ptr deleteObject; - -@@ -143,6 +153,7 @@ class Version : public VersionInherit - private: - /** @brief This Version's version string */ - const std::string versionStr; -+ const std::string extId; - }; - - } // namespace manager --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0018-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0018-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch new file mode 100644 index 000000000..587421044 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0018-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch @@ -0,0 +1,175 @@ +From 19661c1173d9d82dfbb879f8cc89c05a0883dffa Mon Sep 17 00:00:00 2001 +From: AppaRao Puli +Date: Wed, 21 Apr 2021 21:16:47 +0000 +Subject: [PATCH] Fix delete image by ID and inhibit removal of bmc_active + +Delete image by ID was broken because when hitting the delete dbus +interface, it recalculated the ID from the parent version, which then +does not match because of the random number addition that was added +to the ID when the parent interface was created. This saves away the +parent interface ID and recalls it rather than recalculating it. + +Also, there was a logic error in deleting images that would delete the +active BMC image. This fixes up that error. + +Tested: run multiple back-to back updates and see that when the fwupd + script calls delete on the seamless images, the interfaces are + deleted and that the bmc_active interface is not deleted. + +Signed-off-by: Vernon Mauery +Signed-off-by: AppaRao Puli +--- + image_manager.cpp | 2 +- + item_updater.cpp | 20 +++++++++++++------- + pfr_image_manager.cpp | 2 +- + version.cpp | 2 +- + version.hpp | 19 +++++++++++++++---- + 5 files changed, 31 insertions(+), 14 deletions(-) + +diff --git a/image_manager.cpp b/image_manager.cpp +index 4be357f..311a63f 100644 +--- a/image_manager.cpp ++++ b/image_manager.cpp +@@ -219,7 +219,7 @@ int Manager::processImage(const std::string& tarFilePath) + { + // Create Version object + auto versionPtr = std::make_unique( +- bus, objPath, version, purpose, extendedVersion, ++ bus, objPath, id, version, purpose, extendedVersion, + imageDirPath.string(), + std::bind(&Manager::erase, this, std::placeholders::_1)); + versionPtr->deleteObject = +diff --git a/item_updater.cpp b/item_updater.cpp +index 6efd519..6685bf5 100644 +--- a/item_updater.cpp ++++ b/item_updater.cpp +@@ -145,7 +145,7 @@ void ItemUpdater::createActivation(sdbusplus::message::message& msg) + activationState, associations))); + + auto versionPtr = std::make_unique( +- bus, path, version, purpose, extendedVersion, filePath, ++ bus, path, versionId, version, purpose, extendedVersion, filePath, + std::bind(&ItemUpdater::erase, this, std::placeholders::_1)); + versionPtr->deleteObject = + std::make_unique(bus, path, +@@ -263,7 +263,7 @@ void ItemUpdater::processBMCImage() + + // Create Version instance for this version. + auto versionPtr = std::make_unique( +- bus, path, version, purpose, extendedVersion, "", ++ bus, path, id, version, purpose, extendedVersion, "", + std::bind(&ItemUpdater::erase, this, std::placeholders::_1)); + auto isVersionFunctional = versionPtr->isFunctional(); + if (!isVersionFunctional) +@@ -338,11 +338,11 @@ void ItemUpdater::erase(std::string entryId) + auto it = versions.find(entryId); + if (it != versions.end()) + { +- if (it->second->isFunctional() && ACTIVE_BMC_MAX_ALLOWED > 1) ++ if (it->second->isFunctional()) + { +- log("Error: Version is currently running on the BMC. " +- "Unable to remove.", +- entry("VERSIONID=%s", entryId.c_str())); ++ log("Error: Version is currently running on the BMC. " ++ "Unable to remove.", ++ entry("VERSIONID=%s", entryId.c_str())); + return; + } + } +@@ -681,6 +681,12 @@ void ItemUpdater::freeSpace(Activation& caller) + std::size_t count = 0; + for (const auto& iter : activations) + { ++ if (versions.find(iter.second->versionId)->second->isFunctional()) ++ { ++ // don't bother with function versions ++ continue; ++ } ++ + if ((iter.second.get()->activation() == + server::Activation::Activations::Active) || + (iter.second.get()->activation() == +@@ -775,7 +781,7 @@ void ItemUpdater::createBIOSObject() + // Do nothing; + }; + biosVersion = std::make_unique( +- bus, path, version, VersionPurpose::Host, "", "", ++ bus, path, versionId, version, VersionPurpose::Host, "", "", + std::bind(dummyErase, std::placeholders::_1)); + biosVersion->deleteObject = + std::make_unique(bus, path, +diff --git a/pfr_image_manager.cpp b/pfr_image_manager.cpp +index 55ad21f..e2dcc80 100644 +--- a/pfr_image_manager.cpp ++++ b/pfr_image_manager.cpp +@@ -399,7 +399,7 @@ int Manager::processImage(const std::string& imgFilePath) + std::string objPath = std::string{SOFTWARE_OBJPATH} + '/' + id; + + auto versionPtr = std::make_unique( +- bus, objPath, ver, purpose, extVer, imageDirPath.string(), ++ bus, objPath, id, ver, purpose, extVer, imageDirPath.string(), + std::bind(&Manager::erase, this, std::placeholders::_1)); + versionPtr->deleteObject = + std::make_unique(bus, objPath, +diff --git a/version.cpp b/version.cpp +index 04f40c4..44ef571 100644 +--- a/version.cpp ++++ b/version.cpp +@@ -206,7 +206,7 @@ void Delete::delete_() + { + if (parent.eraseCallback) + { +- parent.eraseCallback(parent.getId(parent.version())); ++ parent.eraseCallback(parent.getExtId()); + } + } + +diff --git a/version.hpp b/version.hpp +index 8a68cb5..afc589c 100644 +--- a/version.hpp ++++ b/version.hpp +@@ -77,11 +77,11 @@ class Version : public VersionInherit + * @param[in] callback - The eraseFunc callback + */ + Version(sdbusplus::bus::bus& bus, const std::string& objPath, +- const std::string& versionString, VersionPurpose versionPurpose, +- const std::string& extVersion, const std::string& filePath, +- eraseFunc callback) : ++ const std::string& extId, const std::string& versionString, ++ VersionPurpose versionPurpose, const std::string& extVersion, ++ const std::string& filePath, eraseFunc callback) : + VersionInherit(bus, (objPath).c_str(), true), +- eraseCallback(callback), versionStr(versionString) ++ eraseCallback(callback), versionStr(versionString), extId(extId) + { + // Set properties. + extendedVersion(extVersion); +@@ -150,6 +150,15 @@ class Version : public VersionInherit + */ + bool isFunctional(); + ++ /* @brief Return the extended ID of this version object ++ * ++ * @ return - returns the extended ID string ++ */ ++ std::string getExtId() ++ { ++ return extId; ++ } ++ + /** @brief Persistent Delete D-Bus object */ + std::unique_ptr deleteObject; + +@@ -159,6 +168,8 @@ class Version : public VersionInherit + private: + /** @brief This Version's version string */ + const std::string versionStr; ++ /** @brief This is extended version string */ ++ const std::string extId; + }; + + } // namespace manager +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend index c71beebad..63e0aff25 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager_%.bbappend @@ -24,6 +24,7 @@ SRC_URI_PFR = " \ file://0014-PFR-image-verification.patch \ file://0016-Process-PLDM-image-type.patch \ file://0017-Fix-build-error.patch \ + file://0018-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch \ " SRC_URI += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', SRC_URI_PFR, '', d)}" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/host/phosphor-host-postd_git.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/host/phosphor-host-postd_git.bbappend index a294ac520..ff30bacfb 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/host/phosphor-host-postd_git.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/host/phosphor-host-postd_git.bbappend @@ -1,4 +1,4 @@ DEPENDS += " gtest" #SRC_URI = "git://github.com/openbmc/phosphor-host-postd.git" -SRCREV = "e2abf4429059b7ee3f90cc07f233a66b3022a176" +SRCREV = "2a744b2d70ce9de8519a7c716da5009cb049db17" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Change-InsertMedia-action-response-for-POST-in-proxy.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Change-InsertMedia-action-response-for-POST-in-proxy.patch deleted file mode 100644 index d04220b89..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Change-InsertMedia-action-response-for-POST-in-proxy.patch +++ /dev/null @@ -1,30 +0,0 @@ -From dcc94627aac5b8e4ad181c8548391c53d27b8896 Mon Sep 17 00:00:00 2001 -From: Karol Wachowski -Date: Tue, 16 Feb 2021 06:47:11 +0000 -Subject: [PATCH] Change InsertMedia action response for POST in proxy mode - -Set boost::beast::http::status::method_not_allowed as a response -for POST request to Virtual Media Insert Media action to keep -consistency with other non existing requests. ---- - redfish-core/lib/virtual_media.hpp | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp -index 80e7315..76e8c4a 100644 ---- a/redfish-core/lib/virtual_media.hpp -+++ b/redfish-core/lib/virtual_media.hpp -@@ -611,10 +611,9 @@ class VirtualMediaActionInsertMedia : public Node - // Not possible in proxy mode - BMCWEB_LOG_DEBUG << "InsertMedia not " - "allowed in proxy mode"; -- messages::resourceNotFound( -- aResp->res, "VirtualMedia.InsertMedia", -- resName); -- -+ aResp->res.result( -+ boost::beast::http::status:: -+ method_not_allowed); - return; - } - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Invalid-status-code-from-InsertMedia-REST-methods.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Invalid-status-code-from-InsertMedia-REST-methods.patch new file mode 100644 index 000000000..c9a4119a1 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0002-Invalid-status-code-from-InsertMedia-REST-methods.patch @@ -0,0 +1,182 @@ + +From 1bbabe4ecdeea20da809b9f1d8e194683629517c Mon Sep 17 00:00:00 2001 +From: Alicja Rybak +Date: Tue, 20 Apr 2021 16:32:37 +0200 +Subject: [PATCH] Invalid status code from InsertMedia REST methods GET, PUT, + DELETE, PATCH in proxy mode + +Add handlers for GET, PUT, DELETE, PATCH method and function that +checks which mode is used and set suitable status code: +Not allowed for Legacy and Not found for Proxy. + +Change-Id: Ib4c0a3e9a2a8853caa74c59239d9fcfed99c5e8b +Signed-off-by: Alicja Rybak +--- + redfish-core/lib/virtual_media.hpp | 154 +++++++++++++++++++++++++++++ + 1 file changed, 154 insertions(+) + +diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp +index 8353ce7..66bf220 100644 +--- a/redfish-core/lib/virtual_media.hpp ++++ b/redfish-core/lib/virtual_media.hpp +@@ -530,6 +530,160 @@ class VirtualMediaActionInsertMedia : public Node + return true; + } + ++ /** ++ * @brief Function checks if insert media request is Legacy or Proxy type ++ * and sets suitable response code for unsupported REST method. ++ * ++ */ ++ void CheckProxyMode(crow::Response& res, ++ const crow::Request& req, ++ const std::vector& params) ++ { ++ auto aResp = std::make_shared(res); ++ ++ if (params.size() != 2) ++ { ++ messages::internalError(res); ++ return; ++ } ++ ++ // take resource name from URL ++ const std::string& resName = params[1]; ++ ++ if (params[0] != "bmc") ++ { ++ messages::resourceNotFound(res, "VirtualMedia.Insert", resName); ++ ++ return; ++ } ++ ++ crow::connections::systemBus->async_method_call( ++ [this, aResp{std::move(aResp)}, req, ++ resName](const boost::system::error_code ec, ++ const GetObjectType& getObjectType) { ++ if (ec) ++ { ++ BMCWEB_LOG_ERROR << "ObjectMapper::GetObject call failed: " ++ << ec; ++ aResp->res.result( ++ boost::beast::http::status::not_found); ++ ++ return; ++ } ++ std::string service = getObjectType.begin()->first; ++ BMCWEB_LOG_DEBUG << "GetObjectType: " << service; ++ ++ crow::connections::systemBus->async_method_call( ++ [this, service, resName, req, ++ aResp{aResp}](const boost::system::error_code ec, ++ ManagedObjectType& subtree) { ++ if (ec) ++ { ++ BMCWEB_LOG_DEBUG << "DBUS response error"; ++ ++ return; ++ } ++ ++ for (auto& item : subtree) ++ { ++ std::string thispath = item.first.filename(); ++ if (thispath.empty()) ++ { ++ continue; ++ } ++ ++ if (thispath != resName) ++ { ++ continue; ++ } ++ ++ auto mode = item.first.parent_path(); ++ auto type = mode.parent_path(); ++ if (mode.filename().empty() || ++ type.filename().empty()) ++ { ++ continue; ++ } ++ ++ if (type.filename() != "VirtualMedia") ++ { ++ continue; ++ } ++ ++ // Check if dbus path is Legacy type ++ if (mode.filename() == "Legacy") ++ { ++ BMCWEB_LOG_DEBUG << "InsertMedia only allowed " ++ "with POST method " ++ "in legacy mode"; ++ aResp->res.result( ++ boost::beast::http::status:: ++ method_not_allowed); ++ ++ return; ++ } ++ // Check if dbus path is Proxy type ++ if (mode.filename() == "Proxy") ++ { ++ // Not possible in proxy mode ++ BMCWEB_LOG_DEBUG << "InsertMedia not " ++ "allowed in proxy mode"; ++ aResp->res.result( ++ boost::beast::http::status::not_found); ++ ++ return; ++ } ++ } ++ ++ BMCWEB_LOG_DEBUG << "Parent item not found"; ++ aResp->res.result( ++ boost::beast::http::status::not_found); ++ }, ++ service, "/xyz/openbmc_project/VirtualMedia", ++ "org.freedesktop.DBus.ObjectManager", "GetManagedObjects"); ++ }, ++ "xyz.openbmc_project.ObjectMapper", ++ "/xyz/openbmc_project/object_mapper", ++ "xyz.openbmc_project.ObjectMapper", "GetObject", ++ "/xyz/openbmc_project/VirtualMedia", std::array()); ++ } ++ ++ /** ++ * @brief Function handles GET method request. ++ */ ++ void doGet(crow::Response& res, const crow::Request& req, ++ const std::vector& params) override ++ { ++ CheckProxyMode(res, req, params); ++ } ++ ++ /** ++ * @brief Function handles PATCH method request. ++ */ ++ void doPatch(crow::Response& res, const crow::Request& req, ++ const std::vector& params) override ++ { ++ CheckProxyMode(res, req, params); ++ } ++ ++ /** ++ * @brief Function handles PUT method request. ++ */ ++ void doPut(crow::Response& res, const crow::Request& req, ++ const std::vector& params) override ++ { ++ CheckProxyMode(res, req, params); ++ } ++ ++ /** ++ * @brief Function handles DELETE method request. ++ */ ++ void doDelete(crow::Response& res, const crow::Request& req, ++ const std::vector& params) override ++ { ++ CheckProxyMode(res, req, params); ++ } ++ + /** + * @brief Function handles POST method request. + * diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0004-Bmcweb-handle-permission-denied-exception.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0004-Bmcweb-handle-permission-denied-exception.patch new file mode 100644 index 000000000..074718349 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0004-Bmcweb-handle-permission-denied-exception.patch @@ -0,0 +1,44 @@ +From 81f2c022b22ef75990f30e5ba5bfd4ba5bd41754 Mon Sep 17 00:00:00 2001 +From: Alicja Rybak +Date: Wed, 14 Apr 2021 16:26:59 +0200 +Subject: [PATCH] Bmcweb handle permission denied exception + +Add handling of permission denied exception (EPERM) that +can be thrown by VirtualMedia service during Mount/Unmount dbus operations. + +Tested: +Verified that after mounting/unmounting HTTPS resource twice in a row in legacy mode, +VirtualMedia returns EPERM, which bmcweb handles as 403 status code. + +Change-Id: Ibc18d5ec822c5072605b1fc4651389982002798b +Signed-off-by: Alicja Rybak +--- + redfish-core/lib/virtual_media.hpp | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp +index 365290b..bbdc91b 100644 +--- a/redfish-core/lib/virtual_media.hpp ++++ b/redfish-core/lib/virtual_media.hpp +@@ -900,6 +900,10 @@ class VirtualMediaActionInsertMedia : public Node + { + messages::resourceInUse(asyncResp->res); + } ++ else if (ec == boost::system::errc::permission_denied) ++ { ++ messages::accessDenied(asyncResp->res, "VirtualMedia.Insert"); ++ } + else + { + messages::internalError(asyncResp->res); +@@ -1092,6 +1096,10 @@ class VirtualMediaActionEjectMedia : public Node + { + messages::resourceInUse(asyncResp->res); + } ++ else if (ec == boost::system::errc::permission_denied) ++ { ++ messages::accessDenied(asyncResp->res, "VirtualMedia.Eject"); ++ } + else + { + messages::internalError(asyncResp->res); diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0005-Fix-unmounting-image-in-proxy-mode.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0005-Fix-unmounting-image-in-proxy-mode.patch new file mode 100644 index 000000000..acfd9225b --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0005-Fix-unmounting-image-in-proxy-mode.patch @@ -0,0 +1,32 @@ +From 9493bb8e2f5c708e187313c86e6033de5f103c51 Mon Sep 17 00:00:00 2001 +From: Alicja Rybak +Date: Fri, 23 Apr 2021 17:35:52 +0200 +Subject: [PATCH] Fix unmounting image in proxy mode. + +Sometimes Slot0 got higher key than Slot1 and erase function for Slot1 +invalidates elements with keys not less than the erased element. +In that case invalid slot0 will be unmounted. +Change order of calling close() and erase() functions to +unmount correct device. + +Change-Id: I7a40a4518982f697d3eed635cde6d06978149cf0 +Signed-off-by: Alicja Rybak +--- + include/nbd_proxy.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/nbd_proxy.hpp b/include/nbd_proxy.hpp +index 7b90e90..fa7f647 100644 +--- a/include/nbd_proxy.hpp ++++ b/include/nbd_proxy.hpp +@@ -428,9 +428,9 @@ inline void requestRoutes(App& app) + BMCWEB_LOG_DEBUG << "No session to close"; + return; + } ++ session->second->close(); + // Remove reference to session in global map + sessions.erase(session); +- session->second->close(); + }) + .onmessage([](crow::websocket::Connection& conn, + const std::string& data, bool) { diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0011-bmcweb-Add-PhysicalContext-to-Thermal-resources.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0011-bmcweb-Add-PhysicalContext-to-Thermal-resources.patch new file mode 100644 index 000000000..e52dff3f4 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0011-bmcweb-Add-PhysicalContext-to-Thermal-resources.patch @@ -0,0 +1,135 @@ +From b9747ecfce682f15dce0bb6e41e0c894f29419f3 Mon Sep 17 00:00:00 2001 +From: Snehalatha Venkatesh +Date: Thu, 8 Apr 2021 14:42:07 +0000 +Subject: [PATCH] bmcweb: Add PhysicalContext to Thermal resources + +Adding PhysicalContext to make redfish data compliance with OCP +Server Mgmt Interface v0.2.1.pdf and specific to Thermal resources. +https://github.com/opencomputeproject/OCP-Profiles/blob/master/ +OCPServerHardwareManagement.v0_2_4.json + +Tested: +1. Redfish validator - passed for this new change +2. GET - https:///redfish/v1/Chassis//Thermal +Response: +{ + "@odata.id": "/redfish/v1/Chassis//Thermal#/Temperatures/0", + "@odata.type": "#Thermal.v1_3_0.Temperature", + "LowerThresholdCritical": 0.0, + "LowerThresholdNonCritical": 5.0, + "MaxReadingRangeTemp": 127.0, + "MemberId": "BMC_Temp", + "MinReadingRangeTemp": -128.0, + "Name": "BMC Temp", + "PhysicalContext": "SystemBoard", + "ReadingCelsius": 25.75, + "Status": { + "Health": "OK", + "State": "Enabled" + }, + "UpperThresholdCritical": 115.0, + "UpperThresholdNonCritical": 110.0 +}, +{ + "@odata.id": "/redfish/v1/Chassis//Thermal#/Temperatures/1", + "@odata.type": "#Thermal.v1_3_0.Temperature", + "LowerThresholdCritical": 0.0, + "LowerThresholdNonCritical": 5.0, + "MaxReadingRangeTemp": 255.0, + "MemberId": "CPU1_P12V_PVCCIN_VR_Temp", + "MinReadingRangeTemp": 0.0, + "Name": "CPU1 P12V PVCCIN VR Temp", + "PhysicalContext": "CPU", + "ReadingCelsius": 41.0, + "Status": { + "Health": "OK", + "State": "Enabled" + }, + "UpperThresholdCritical": 115.0, + "UpperThresholdNonCritical": 110.0 +}, +{ + "@odata.id": "/redfish/v1/Chassis//Thermal#/Temperatures/28", + "@odata.type": "#Thermal.v1_3_0.Temperature", + "LowerThresholdCritical": 0.0, + "LowerThresholdNonCritical": 5.0, + "MaxReadingRangeTemp": 127.0, + "MemberId": "Inlet_BRD_Temp", + "MinReadingRangeTemp": -128.0, + "Name": "Inlet BRD Temp", + "PhysicalContext": "Intake", + "ReadingCelsius": 23.187, + "Status": { + "Health": "OK", + "State": "Enabled" + }, + "UpperThresholdCritical": 115.0, + "UpperThresholdNonCritical": 110.0 +} +3. GET - https:///redfish/v1/Chassis//Power +Response: +{ + "@odata.id": "/redfish/v1/Chassis//Power#/Voltages/3", + "@odata.type": "#Power.v1_0_0.Voltage", + "LowerThresholdCritical": 1.648, + "LowerThresholdNonCritical": 1.699, + "MaxReadingRange": 2.3984009912875566, + "MemberId": "P1V8_PCH", + "MinReadingRange": 0.0, + "Name": "P1V8 PCH", + "ReadingVolts": 1.8055, + "Status": { + "Health": "OK", + "State": "Enabled" + }, + "UpperThresholdCritical": 1.961, + "UpperThresholdNonCritical": 1.904 +} +4. GET - https:///redfish/v1/Chassis//Sensors/PSU1_Input_Current +Response: +{ + "@odata.id": "/redfish/v1/Chassis//Sensors/PSU1_Input_Current", + "@odata.type": "#Sensor.v1_0_0.Sensor", + "Id": "PSU1_Input_Current", + "Name": "PSU1 Input Current", + "Reading": 0.947, + "ReadingRangeMax": 12.0, + "ReadingRangeMin": 0.0, + "ReadingType": "Current", + "ReadingUnits": "A", + "Status": { + "Health": "OK", + "State": "Enabled" + } +} +Signed-off-by: Snehalatha Venkatesh +--- + redfish-core/lib/sensors.hpp | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp +index 9f06d2f..40fcdf8 100644 +--- a/redfish-core/lib/sensors.hpp ++++ b/redfish-core/lib/sensors.hpp +@@ -964,6 +964,18 @@ inline void objectInterfacesToJson( + { + unit = "/ReadingCelsius"_json_pointer; + sensorJson["@odata.type"] = "#Thermal.v1_3_0.Temperature"; ++ if (sensorName.find("CPU") != std::string::npos) ++ { ++ sensorJson["PhysicalContext"] = "CPU"; ++ } ++ else if (sensorName.find("Inlet") != std::string::npos) ++ { ++ sensorJson["PhysicalContext"] = "Intake"; ++ } ++ else ++ { ++ sensorJson["PhysicalContext"] = "SystemBoard"; ++ } + // TODO(ed) Documentation says that path should be type fan_tach, + // implementation seems to implement fan + } +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0012-Log-RedFish-event-for-Invalid-login-attempt.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0012-Log-RedFish-event-for-Invalid-login-attempt.patch new file mode 100644 index 000000000..3ef4ee2de --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0012-Log-RedFish-event-for-Invalid-login-attempt.patch @@ -0,0 +1,67 @@ +From 1f572a1991fc8d9b08689aa6e3470080467977a7 Mon Sep 17 00:00:00 2001 +From: Jayaprakash Mutyala +Date: Thu, 15 Apr 2021 10:59:42 +0000 +Subject: [PATCH] Log RedFish event for Invalid login attempt + +This commit adds support for logging RedFish event log while user tries +to attempt login with invalid credentials. +When user trying to login with invalid credentials on HTTPS interface +like WebUI and RedFish, event should be logged in RedFish event log. +This event log is useful for further analysis to debug the root-cause +for failure. + +Tested: +1. Verified RedFish validator passed +2. Login with wrong credentials on HTTPS interface. +3. Verified for RedFish/WebUI events. RedFish event logged successfully. +GET: https://BMC-IP/redfish/v1/Systems/system/LogServices/ + EventLog/Entries +Response: +"Members": [ +{ + "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/ + Entries/1618466128", + "@odata.type": "#LogEntry.v1_4_0.LogEntry", + "Created": "2021-04-15T05:55:28+00:00", + "EntryType": "Event", + "Id": "1618466128", + "Message": "Invalid username or password attempted on HTTPS.", + "MessageArgs": [ + "HTTPS" + ], + "MessageId": "OpenBMC.0.1.InvalidLoginAttempted", + "Name": "System Event Log Entry", + "Severity": "Warning" +} + +Signed-off-by: Jayaprakash Mutyala +--- + include/pam_authenticate.hpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/include/pam_authenticate.hpp b/include/pam_authenticate.hpp +index 12f19c0..01bf301 100644 +--- a/include/pam_authenticate.hpp ++++ b/include/pam_authenticate.hpp +@@ -1,6 +1,7 @@ + #pragma once + + #include ++#include + + #include + +@@ -75,6 +76,10 @@ inline int pamAuthenticateUser(const std::string_view username, + PAM_SILENT | PAM_DISALLOW_NULL_AUTHTOK); + if (retval != PAM_SUCCESS) + { ++ sd_journal_send("MESSAGE= %s", "Invalid login attempted on HTTPS", ++ "PRIORITY=%i", LOG_WARNING, "REDFISH_MESSAGE_ID=%s", ++ "OpenBMC.0.1.InvalidLoginAttempted", ++ "REDFISH_MESSAGE_ARGS=%s", "HTTPS", NULL); + pam_end(localAuthHandle, PAM_SUCCESS); // ignore retval + return retval; + } +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0013-Add-UART-routing-logic-into-host-console-connection-.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0013-Add-UART-routing-logic-into-host-console-connection-.patch new file mode 100644 index 000000000..8b0d90fe0 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0013-Add-UART-routing-logic-into-host-console-connection-.patch @@ -0,0 +1,59 @@ +From 6c10adb53d3247f65e5d9399290e6b8e7962cdef Mon Sep 17 00:00:00 2001 +From: Jae Hyun Yoo +Date: Wed, 28 Apr 2021 17:19:50 -0700 +Subject: [PATCH] Add UART routing logic into host console connection flow + +Switching UART routing when starting obmc-service introduces garbled +character printing out on physical host serial output and it's +inevitable so this commit moves the routing logic into host console +connection flow in bmcweb to avoid the issue until SOL is actually +activated. + +Tested: The garbled character printing out was not observed during +BMC booting. SOL worked well. + +Signed-off-by: Jae Hyun Yoo +--- + include/obmc_console.hpp | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/include/obmc_console.hpp b/include/obmc_console.hpp +index cdb19901e82d..9c4ae8821074 100644 +--- a/include/obmc_console.hpp ++++ b/include/obmc_console.hpp +@@ -22,6 +22,9 @@ static boost::container::flat_set sessions; + + static bool doingWrite = false; + ++constexpr char const* uartMuxCtrlPath = "/sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/raw"; ++constexpr char const* uartMuxCtrlVal = "0x03450003"; ++ + inline void doWrite() + { + if (doingWrite) +@@ -110,6 +113,22 @@ inline void connectHandler(const boost::system::error_code& ec) + return; + } + ++ FILE* file = fopen(uartMuxCtrlPath, "w"); ++ if (file != nullptr) ++ { ++ int rc = fputs(uartMuxCtrlVal, file); ++ fclose(file); ++ if (rc < 0) ++ { ++ BMCWEB_LOG_ERROR << "Couldn't change UART routing: " << rc; ++ for (crow::websocket::Connection* session : sessions) ++ { ++ session->close("Error in connecting to host port"); ++ } ++ return; ++ } ++ } ++ + doWrite(); + doRead(); + } +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-bmcweb-crashes-if-socket-directory-not-present.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-bmcweb-crashes-if-socket-directory-not-present.patch new file mode 100644 index 000000000..bc023839f --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-bmcweb-crashes-if-socket-directory-not-present.patch @@ -0,0 +1,44 @@ +From 48fe2a68d634970795f9ff13903afbedca801088 Mon Sep 17 00:00:00 2001 +From: Nidhin MS +Date: Wed, 14 Apr 2021 11:28:44 +0530 +Subject: [PATCH] Fix: bmcweb crashes if socket directory not present + +When trying to mount virtual media image bmcweb tries to create unix +socket and if the parent directory does not exist +stream_protocol::acceptor throws error and bmcweb crashes. Fix the same + +Tested: +Removed directory and mounted the vm image. bmcweb crash was not +observed + +Change-Id: I3aea1d8e197c06238f425a97435c01d3c80552a9 +Signed-off-by: Nidhin MS +--- + include/nbd_proxy.hpp | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/include/nbd_proxy.hpp b/include/nbd_proxy.hpp +index 7b90e90..3b28823 100644 +--- a/include/nbd_proxy.hpp ++++ b/include/nbd_proxy.hpp +@@ -397,6 +397,17 @@ inline void requestRoutes(App& app) + // If the socket file exists (i.e. after bmcweb crash), + // we cannot reuse it. + std::remove((*socketValue).c_str()); ++ std::filesystem::path socketPath(*socketValue); ++ std::error_code fsErr; ++ if (!std::filesystem::exists(socketPath.parent_path(), ++ fsErr)) ++ { ++ BMCWEB_LOG_ERROR ++ << "VirtualMedia socket directory not present. " ++ << socketPath.parent_path(); ++ conn.close("Unable to create unix socket"); ++ return; ++ } + + sessions[&conn] = std::make_shared( + conn, *socketValue, *endpointValue, +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-comparison-for-proxy-legacy-mode.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-comparison-for-proxy-legacy-mode.patch new file mode 100644 index 000000000..f02e5e1a4 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0039-Fix-comparison-for-proxy-legacy-mode.patch @@ -0,0 +1,51 @@ +From 7cde56820505a4f750cc67caa0dc9300688f3fd9 Mon Sep 17 00:00:00 2001 +From: Przemyslaw Czarnowski +Date: Tue, 13 Apr 2021 15:16:43 +0200 +Subject: [PATCH] Fix comparison for proxy/legacy mode + +After sdbusplus made available string path wrapper VM code has been +updated to use it. This makes legacy mode unusable as appropriate +change introduced a problem with comparison of DBus object path, which +is now fixed. + +Tested: +After applying this fix, legacy mode has InsertMedia action enabled +again. + +Change-Id: I062994f23b77cb7ab9c4421f296a65a80b9ce896 +Signed-off-by: Przemyslaw Czarnowski +--- + redfish-core/lib/virtual_media.hpp | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp +index 365290b..dda73d8 100644 +--- a/redfish-core/lib/virtual_media.hpp ++++ b/redfish-core/lib/virtual_media.hpp +@@ -274,10 +274,22 @@ static void getVmData(const std::shared_ptr& aResp, + continue; + } + ++ auto mode = item.first.parent_path(); ++ auto type = mode.parent_path(); ++ if (mode.filename().empty() || type.filename().empty()) ++ { ++ continue; ++ } ++ ++ if (type.filename() != "VirtualMedia") ++ { ++ continue; ++ } ++ + aResp->res.jsonValue = vmItemTemplate(name, resName); + + // Check if dbus path is Legacy type +- if (thispath.find("VirtualMedia/Legacy") != std::string::npos) ++ if (mode.filename() == "Legacy") + { + aResp->res.jsonValue["Actions"]["#VirtualMedia.InsertMedia"] + ["target"] = +-- +2.26.2 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0003-Move-EventService-init-to-later-stage.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0003-Move-EventService-init-to-later-stage.patch deleted file mode 100644 index f910915ce..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0003-Move-EventService-init-to-later-stage.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 2dcfef0170ca5ba1f934de6934db64b545ab3b55 Mon Sep 17 00:00:00 2001 -From: AppaRao Puli -Date: Tue, 23 Mar 2021 23:36:40 +0000 -Subject: [PATCH] Move EventService init to later stage - -The bmcweb crash issue seen when there is eventservice -config with subscriptions in persistent file. - -During EventService instantiation, it uses the "get_io_context()" -from systemBus, so it should be called after systemBus init. So -moved the EventService instantiation after systemBus initialization. - -Tested: - - bmcweb crash issue resolved. - -Signed-off-by: AppaRao Puli -Change-Id: Iab52f0e89478e306af475066fb5691153a05677d ---- - src/webserver_main.cpp | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp -index 3b9631a..f0e2207 100644 ---- a/src/webserver_main.cpp -+++ b/src/webserver_main.cpp -@@ -80,9 +80,6 @@ int main(int /*argc*/, char** /*argv*/) - #ifdef BMCWEB_ENABLE_REDFISH - crow::redfish::requestRoutes(app); - redfish::RedfishService redfish(app); -- -- // Create EventServiceManager instance and initialize Config -- redfish::EventServiceManager::getInstance(); - #endif - - #ifdef BMCWEB_ENABLE_DBUS_REST -@@ -116,6 +113,11 @@ int main(int /*argc*/, char** /*argv*/) - crow::connections::systemBus = - std::make_shared(*io); - -+#ifdef BMCWEB_ENABLE_REDFISH -+ // Create EventServiceManager instance and initialize Config -+ redfish::EventServiceManager::getInstance(); -+#endif -+ - #ifdef BMCWEB_ENABLE_VM_NBDPROXY - crow::nbd_proxy::requestRoutes(app); - #endif --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0005-Add-SSE-style-subscription-support-to-eventservice.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0005-Add-SSE-style-subscription-support-to-eventservice.patch index e2eaf1761..02d28833f 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0005-Add-SSE-style-subscription-support-to-eventservice.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0005-Add-SSE-style-subscription-support-to-eventservice.patch @@ -1,4 +1,4 @@ -From dbaf8c1dc402da97fec723d050e063cd283d8736 Mon Sep 17 00:00:00 2001 +From 698d2615c5bc30ab7f89f11ed5659df8bf248ea0 Mon Sep 17 00:00:00 2001 From: AppaRao Puli Date: Tue, 16 Mar 2021 15:37:24 +0000 Subject: [PATCH 5/6] Add SSE style subscription support to eventservice @@ -126,10 +126,10 @@ index 0000000..6c98e6e +} // namespace eventservice_sse +} // namespace redfish diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp -index 148c703..e3eba86 100644 +index 5821e2e..f4d57c2 100644 --- a/redfish-core/include/event_service_manager.hpp +++ b/redfish-core/include/event_service_manager.hpp -@@ -22,13 +22,15 @@ +@@ -23,13 +23,15 @@ #include #include @@ -146,7 +146,7 @@ index 148c703..e3eba86 100644 #include #include #include -@@ -45,9 +47,13 @@ using EventServiceConfig = std::tuple; +@@ -46,9 +48,13 @@ using EventServiceConfig = std::tuple; static constexpr const char* eventFormatType = "Event"; static constexpr const char* metricReportFormatType = "MetricReport"; @@ -160,8 +160,8 @@ index 148c703..e3eba86 100644 #ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES static std::optional inotifyConn; static constexpr const char* redfishEventLogDir = "/var/log"; -@@ -390,11 +396,9 @@ class Subscription - path); +@@ -391,11 +397,9 @@ class Subscription + path, uriProto); } - Subscription(const std::shared_ptr& adaptor) : @@ -175,7 +175,7 @@ index 148c703..e3eba86 100644 ~Subscription() = default; -@@ -419,7 +423,7 @@ class Subscription +@@ -420,7 +424,7 @@ class Subscription if (sseConn != nullptr) { @@ -184,7 +184,7 @@ index 148c703..e3eba86 100644 } } -@@ -509,6 +513,7 @@ class Subscription +@@ -510,6 +514,7 @@ class Subscription this->sendEvent( msg.dump(2, ' ', true, nlohmann::json::error_handler_t::replace)); @@ -192,7 +192,7 @@ index 148c703..e3eba86 100644 } #endif -@@ -579,14 +584,39 @@ class Subscription +@@ -565,14 +570,39 @@ class Subscription return eventSeqNum; } @@ -233,7 +233,7 @@ index 148c703..e3eba86 100644 }; static constexpr const bool defaultEnabledState = true; -@@ -977,6 +1007,8 @@ class EventServiceManager +@@ -963,6 +993,8 @@ class EventServiceManager subValue->updateRetryConfig(retryAttempts, retryTimeoutInterval); subValue->updateRetryPolicy(); @@ -242,7 +242,7 @@ index 148c703..e3eba86 100644 return id; } -@@ -1001,11 +1033,40 @@ class EventServiceManager +@@ -987,11 +1019,40 @@ class EventServiceManager } } @@ -603,7 +603,7 @@ index be6f04d..1875ec9 100644 {{"@odata.id", "/redfish/v1/EventService/Subscriptions"}}}, {"Actions", diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp -index 3b9631a..bf8e705 100644 +index 902c32b..c871faa 100644 --- a/src/webserver_main.cpp +++ b/src/webserver_main.cpp @@ -5,6 +5,7 @@ @@ -614,14 +614,14 @@ index 3b9631a..bf8e705 100644 #include #include #include -@@ -79,6 +80,7 @@ int main(int /*argc*/, char** /*argv*/) - +@@ -83,6 +84,7 @@ int main(int /*argc*/, char** /*argv*/) #ifdef BMCWEB_ENABLE_REDFISH - crow::redfish::requestRoutes(app); -+ redfish::eventservice_sse::requestRoutes(app); + redfish::requestRoutes(app); redfish::RedfishService redfish(app); ++ redfish::eventservice_sse::requestRoutes(app); // Create EventServiceManager instance and initialize Config + redfish::EventServiceManager::getInstance(); -- 2.17.1 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0006-Add-EventService-SSE-filter-support.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0006-Add-EventService-SSE-filter-support.patch index e83e05c96..4d99b2754 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0006-Add-EventService-SSE-filter-support.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0006-Add-EventService-SSE-filter-support.patch @@ -1,4 +1,4 @@ -From 693de7b901e7618585e0e8d848fc37fa0cccd18e Mon Sep 17 00:00:00 2001 +From 82185c52ae6e27cc1e086654a3b7d10e63ecc783 Mon Sep 17 00:00:00 2001 From: AppaRao Puli Date: Wed, 17 Mar 2021 01:16:50 +0000 Subject: [PATCH 6/6] Add EventService SSE filter support @@ -171,10 +171,10 @@ index 7dfdc80..922dae9 100644 } // namespace redfish diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp -index e3eba86..8f120b1 100644 +index f4d57c2..567fb9c 100644 --- a/redfish-core/include/event_service_manager.hpp +++ b/redfish-core/include/event_service_manager.hpp -@@ -54,6 +54,11 @@ static constexpr const char* eventServiceFile = +@@ -55,6 +55,11 @@ static constexpr const char* eventServiceFile = static constexpr const uint8_t maxNoOfSubscriptions = 20; static constexpr const uint8_t maxNoOfSSESubscriptions = 10; @@ -202,7 +202,7 @@ index 1875ec9..4d1ac9f 100644 "TerminateAfterRetries", "SuspendRetries", "RetryForever"}; diff --git a/redfish-core/src/error_messages.cpp b/redfish-core/src/error_messages.cpp -index cfbc9c2..3493132 100644 +index 7059a38..1e3ef2f 100644 --- a/redfish-core/src/error_messages.cpp +++ b/redfish-core/src/error_messages.cpp @@ -2147,6 +2147,32 @@ void mutualExclusiveProperties(crow::Response& res, const std::string& arg1, diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/README b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/README index 55340bb5c..3954e89c1 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/README +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/README @@ -9,9 +9,6 @@ Upstream revision information: - EventService: https client support https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/31735/38 - - Move EventService init to later stage - https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/41516 - - Add Server-Sent-Events support https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/41258/5 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0001-Sync_ReadingUnit_with_Redfish_Sensor_Schema.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0001-Sync_ReadingUnit_with_Redfish_Sensor_Schema.patch deleted file mode 100644 index e3b25da90..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0001-Sync_ReadingUnit_with_Redfish_Sensor_Schema.patch +++ /dev/null @@ -1,227 +0,0 @@ -From 4b7e67d7200c0aba1b27478968d4f71449f1406a Mon Sep 17 00:00:00 2001 -From: "Wludzik, Jozef" -Date: Mon, 8 Mar 2021 14:35:54 +0000 -Subject: [PATCH] Sync ReadingUnit with Redfish Sensor Schema - -Actual attribute "ReadingUnits" does not match with Redfish Sensor -Schema. This change match "ReadingUnits" with Redfish Sensor Scheme -1.0.0 and add missing "ReadingType" attribute. This change affect all -users that depends on old units that does not match with Redfish -standard. Added toReadingType and toReadingUnit function that uses -values taken from Redfish Sensor Scheme 1.0.0. Latest version 1.2.0 of -Sensor scheme defines units same units. - -Tested: - - RedfishServiceValidator pass - -Change-Id: I0c8820eba7271022c427cd25dec321db36aa0176 -Signed-off-by: Wludzik, Jozef -Signed-off-by: Krzysztof Grobelny ---- - redfish-core/lib/power.hpp | 4 +- - redfish-core/lib/sensors.hpp | 107 +++++++++++++++++++++++++++++------ - redfish-core/lib/thermal.hpp | 4 +- - 3 files changed, 94 insertions(+), 21 deletions(-) - -diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp -index 1c7a009..99c45ef 100644 ---- a/redfish-core/lib/power.hpp -+++ b/redfish-core/lib/power.hpp -@@ -153,7 +153,7 @@ class Power : public Node - res.jsonValue["PowerControl"] = nlohmann::json::array(); - - auto sensorAsyncResp = std::make_shared( -- res, chassisName, sensors::dbus::types.at(sensors::node::power), -+ res, chassisName, sensors::dbus::paths.at(sensors::node::power), - sensors::node::power); - - getChassisData(sensorAsyncResp); -@@ -336,7 +336,7 @@ class Power : public Node - - const std::string& chassisName = params[0]; - auto asyncResp = std::make_shared( -- res, chassisName, sensors::dbus::types.at(sensors::node::power), -+ res, chassisName, sensors::dbus::paths.at(sensors::node::power), - sensors::node::power); - - std::optional> voltageCollections; -diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp -index 35114bf..af030f0 100644 ---- a/redfish-core/lib/sensors.hpp -+++ b/redfish-core/lib/sensors.hpp -@@ -54,9 +54,10 @@ static constexpr std::string_view thermal = "Thermal"; - - namespace dbus - { -+ - static const boost::container::flat_map> -- types = {{node::power, -+ paths = {{node::power, - {"/xyz/openbmc_project/sensors/voltage", - "/xyz/openbmc_project/sensors/power"}}, - {node::sensors, -@@ -67,6 +68,88 @@ static const boost::container::flat_mapchassisSubNode == sensors::node::sensors) - { - sensorJson["@odata.type"] = "#Sensor.v1_0_0.Sensor"; -- if (sensorType == "power") -- { -- sensorJson["ReadingUnits"] = "Watts"; -- } -- else if (sensorType == "current") -- { -- sensorJson["ReadingUnits"] = "Amperes"; -- } -- else if (sensorType == "utilization") -- { -- sensorJson["ReadingUnits"] = "Percent"; -- } -+ sensorJson["ReadingType"] = sensors::toReadingType(sensorType); -+ sensorJson["ReadingUnits"] = sensors::toReadingUnits(sensorType); - } - else if (sensorType == "temperature") - { -@@ -2979,8 +3052,8 @@ inline void retrieveUriToDbusMap(const std::string& chassis, - const std::string& node, - SensorsAsyncResp::DataCompleteCb&& mapComplete) - { -- auto typesIt = sensors::dbus::types.find(node); -- if (typesIt == sensors::dbus::types.end()) -+ auto pathIt = sensors::dbus::paths.find(node); -+ if (pathIt == sensors::dbus::paths.end()) - { - BMCWEB_LOG_ERROR << "Wrong node provided : " << node; - mapComplete(boost::beast::http::status::bad_request, {}); -@@ -2995,7 +3068,7 @@ inline void retrieveUriToDbusMap(const std::string& chassis, - uriToDbus) { mapCompleteCb(status, uriToDbus); }; - - auto resp = std::make_shared( -- *respBuffer, chassis, typesIt->second, node, std::move(callback)); -+ *respBuffer, chassis, pathIt->second, node, std::move(callback)); - getChassisData(resp); - } - -@@ -3030,7 +3103,7 @@ class SensorCollection : public Node - const std::string& chassisId = params[0]; - std::shared_ptr asyncResp = - std::make_shared( -- res, chassisId, sensors::dbus::types.at(sensors::node::sensors), -+ res, chassisId, sensors::dbus::paths.at(sensors::node::sensors), - sensors::node::sensors); - - auto getChassisCb = -diff --git a/redfish-core/lib/thermal.hpp b/redfish-core/lib/thermal.hpp -index 8e01bee..00acdf9 100644 ---- a/redfish-core/lib/thermal.hpp -+++ b/redfish-core/lib/thermal.hpp -@@ -48,7 +48,7 @@ class Thermal : public Node - } - const std::string& chassisName = params[0]; - auto sensorAsyncResp = std::make_shared( -- res, chassisName, sensors::dbus::types.at(sensors::node::thermal), -+ res, chassisName, sensors::dbus::paths.at(sensors::node::thermal), - sensors::node::thermal); - - // TODO Need to get Chassis Redundancy information. -@@ -71,7 +71,7 @@ class Thermal : public Node - allCollections; - - auto asyncResp = std::make_shared( -- res, chassisName, sensors::dbus::types.at(sensors::node::thermal), -+ res, chassisName, sensors::dbus::paths.at(sensors::node::thermal), - sensors::node::thermal); - - if (!json_util::readJson(req, asyncResp->res, "Temperatures", --- -2.25.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch deleted file mode 100644 index aaf3f17c7..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch +++ /dev/null @@ -1,671 +0,0 @@ -From 03c4ece83b58b954323111a1a7b2bf2b61402d7e Mon Sep 17 00:00:00 2001 -From: "Wludzik, Jozef" -Date: Mon, 18 May 2020 11:56:57 +0200 -Subject: [PATCH 2/4] Add POST and DELETE in MetricReportDefinitions - -Added POST action in MetricReportDefinitions node to allow user -to add new MetricReportDefinition. Using minimal set of -MetricReportDefinition parameters from user bmcweb converts it to -DBus call "AddReport" to Telemetry that serves as a backend -for Redfish TelemetryService. -Added DELETE request in MetricReportDefinitions node to allow user -to remove report from Telemetry. -Added conversion from string that represents duration format into -its numeric equivalent. -Added unit tests for conversion from and to Duration format. - -Tested: - - Tested using witherspoon image on QEMU - - Verified POST action in different cases: - - all parameters are provided, new report is added to collection - - some parameters are missing or invalid, user gets response with - description of the issue - - Verified that reports are removed on DELETE request - - Verified that on invalid DELETE request user receives response - with error - - Verified time_utils::fromDurationString() - - Succesfully passed RedfishServiceValidator.py - -Signed-off-by: Wludzik, Jozef -Signed-off-by: Krzysztof Grobelny -Change-Id: I2fed96848594451e22fde686f8c066d7770cc65a ---- - meson.build | 1 + - .../include/utils/telemetry_utils.hpp | 2 + - redfish-core/include/utils/time_utils.hpp | 138 +++++++- - redfish-core/lib/metric_report_definition.hpp | 328 ++++++++++++++++++ - redfish-core/ut/time_utils_test.cpp | 63 ++++ - 5 files changed, 530 insertions(+), 2 deletions(-) - create mode 100644 redfish-core/ut/time_utils_test.cpp - -diff --git a/meson.build b/meson.build -index 66a066b..22a8c4a 100644 ---- a/meson.build -+++ b/meson.build -@@ -345,6 +345,7 @@ srcfiles_unittest = ['include/ut/dbus_utility_test.cpp', - 'redfish-core/ut/privileges_test.cpp', - 'redfish-core/ut/lock_test.cpp', - 'redfish-core/ut/configfile_test.cpp', -+ 'redfish-core/ut/time_utils_test.cpp', - 'http/ut/utility_test.cpp'] - - # Gather the Configuration data -diff --git a/redfish-core/include/utils/telemetry_utils.hpp b/redfish-core/include/utils/telemetry_utils.hpp -index a3a8156..0a3af5f 100644 ---- a/redfish-core/include/utils/telemetry_utils.hpp -+++ b/redfish-core/include/utils/telemetry_utils.hpp -@@ -1,5 +1,7 @@ - #pragma once - -+#include "dbus_utility.hpp" -+ - namespace redfish - { - -diff --git a/redfish-core/include/utils/time_utils.hpp b/redfish-core/include/utils/time_utils.hpp -index 4a87ba0..9965d4d 100644 ---- a/redfish-core/include/utils/time_utils.hpp -+++ b/redfish-core/include/utils/time_utils.hpp -@@ -1,7 +1,13 @@ - #pragma once - -+#include "logging.hpp" -+ -+#include - #include -+#include -+#include - #include -+#include - - namespace redfish - { -@@ -12,6 +18,8 @@ namespace time_utils - namespace details - { - -+using Days = std::chrono::duration>; -+ - inline void leftZeroPadding(std::string& str, const std::size_t padding) - { - if (str.size() < padding) -@@ -19,8 +27,135 @@ inline void leftZeroPadding(std::string& str, const std::size_t padding) - str.insert(0, padding - str.size(), '0'); - } - } -+ -+template -+bool fromDurationItem(std::string_view& fmt, const char postfix, -+ std::chrono::milliseconds& out) -+{ -+ const size_t pos = fmt.find(postfix); -+ if (pos == std::string::npos) -+ { -+ return true; -+ } -+ if ((pos + 1U) > fmt.size()) -+ { -+ return false; -+ } -+ -+ const char* end; -+ std::chrono::milliseconds::rep ticks = 0; -+ if constexpr (std::is_same_v) -+ { -+ end = fmt.data() + std::min(pos, 3U); -+ } -+ else -+ { -+ end = fmt.data() + pos; -+ } -+ -+ auto [ptr, ec] = std::from_chars(fmt.data(), end, ticks); -+ if (ptr != end || ec != std::errc()) -+ { -+ BMCWEB_LOG_ERROR << "Failed to convert string to decimal with err: " -+ << static_cast(ec) << "(" -+ << std::make_error_code(ec).message() << "), ptr{" -+ << static_cast(ptr) << "} != end{" -+ << static_cast(end) << "})"; -+ return false; -+ } -+ -+ if constexpr (std::is_same_v) -+ { -+ ticks *= static_cast( -+ std::pow(10, 3 - std::min(pos, 3U))); -+ } -+ if (ticks < 0) -+ { -+ return false; -+ } -+ -+ out += FromTime(ticks); -+ const auto maxConversionRange = -+ std::chrono::duration_cast(std::chrono::milliseconds::max()) -+ .count(); -+ if (out < FromTime(ticks) || maxConversionRange < ticks) -+ { -+ return false; -+ } -+ -+ fmt.remove_prefix(pos + 1U); -+ return true; -+} - } // namespace details - -+/** -+ * @brief Convert string that represents value in Duration Format to its numeric -+ * equivalent. -+ */ -+std::optional -+ fromDurationString(const std::string& str) -+{ -+ std::chrono::milliseconds out = std::chrono::milliseconds::zero(); -+ std::string_view v = str; -+ -+ if (v.empty()) -+ { -+ return out; -+ } -+ if (v.front() != 'P') -+ { -+ BMCWEB_LOG_ERROR << "Invalid duration format: " << str; -+ return std::nullopt; -+ } -+ -+ v.remove_prefix(1); -+ if (!details::fromDurationItem(v, 'D', out)) -+ { -+ BMCWEB_LOG_ERROR << "Invalid duration format: " << str; -+ return std::nullopt; -+ } -+ -+ if (v.empty()) -+ { -+ return out; -+ } -+ if (v.front() != 'T') -+ { -+ BMCWEB_LOG_ERROR << "Invalid duration format: " << str; -+ return std::nullopt; -+ } -+ -+ v.remove_prefix(1); -+ if (!details::fromDurationItem(v, 'H', out) || -+ !details::fromDurationItem(v, 'M', out)) -+ { -+ BMCWEB_LOG_ERROR << "Invalid duration format: " << str; -+ return std::nullopt; -+ } -+ -+ if (v.find('.') != std::string::npos && v.find('S') != std::string::npos) -+ { -+ if (!details::fromDurationItem(v, '.', out) || -+ !details::fromDurationItem(v, 'S', out)) -+ { -+ BMCWEB_LOG_ERROR << "Invalid duration format: " << str; -+ return std::nullopt; -+ } -+ } -+ else if (!details::fromDurationItem(v, 'S', out)) -+ { -+ BMCWEB_LOG_ERROR << "Invalid duration format: " << str; -+ return std::nullopt; -+ } -+ -+ if (!v.empty()) -+ { -+ BMCWEB_LOG_ERROR << "Invalid duration format: " << str; -+ return std::nullopt; -+ } -+ return out; -+} -+ - /** - * @brief Convert time value into duration format that is based on ISO 8601. - * Example output: "P12DT1M5.5S" -@@ -36,8 +171,7 @@ inline std::string toDurationString(std::chrono::milliseconds ms) - std::string fmt; - fmt.reserve(sizeof("PxxxxxxxxxxxxDTxxHxxMxx.xxxxxxS")); - -- using Days = std::chrono::duration>; -- Days days = std::chrono::floor(ms); -+ details::Days days = std::chrono::floor(ms); - ms -= days; - - std::chrono::hours hours = std::chrono::floor(ms); -diff --git a/redfish-core/lib/metric_report_definition.hpp b/redfish-core/lib/metric_report_definition.hpp -index 59025d9..fcbc99c 100644 ---- a/redfish-core/lib/metric_report_definition.hpp -+++ b/redfish-core/lib/metric_report_definition.hpp -@@ -1,9 +1,12 @@ - #pragma once - - #include "node.hpp" -+#include "sensors.hpp" - #include "utils/telemetry_utils.hpp" - #include "utils/time_utils.hpp" - -+#include -+ - #include - #include - -@@ -95,6 +98,252 @@ inline void fillReportDefinition( - asyncResp->res.jsonValue["Schedule"]["RecurrenceInterval"] = - time_utils::toDurationString(std::chrono::milliseconds(*interval)); - } -+ -+struct AddReportArgs -+{ -+ std::string name; -+ std::string reportingType; -+ bool emitsReadingsUpdate = false; -+ bool logToMetricReportsCollection = false; -+ uint64_t interval = 0; -+ std::vector>> metrics; -+}; -+ -+inline bool toDbusReportActions(crow::Response& res, -+ std::vector& actions, -+ AddReportArgs& args) -+{ -+ size_t index = 0; -+ for (auto& action : actions) -+ { -+ if (action == "RedfishEvent") -+ { -+ args.emitsReadingsUpdate = true; -+ } -+ else if (action == "LogToMetricReportsCollection") -+ { -+ args.logToMetricReportsCollection = true; -+ } -+ else -+ { -+ messages::propertyValueNotInList( -+ res, action, "ReportActions/" + std::to_string(index)); -+ return false; -+ } -+ index++; -+ } -+ return true; -+} -+ -+inline bool getUserParameters(crow::Response& res, const crow::Request& req, -+ AddReportArgs& args) -+{ -+ std::vector metrics; -+ std::vector reportActions; -+ std::optional schedule; -+ if (!json_util::readJson(req, res, "Id", args.name, "Metrics", metrics, -+ "MetricReportDefinitionType", args.reportingType, -+ "ReportActions", reportActions, "Schedule", -+ schedule)) -+ { -+ return false; -+ } -+ -+ constexpr const char* allowedCharactersInName = -+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"; -+ if (args.name.empty() || args.name.find_first_not_of( -+ allowedCharactersInName) != std::string::npos) -+ { -+ BMCWEB_LOG_ERROR << "Failed to match " << args.name -+ << " with allowed character " -+ << allowedCharactersInName; -+ messages::propertyValueIncorrect(res, "Id", args.name); -+ return false; -+ } -+ -+ if (args.reportingType != "Periodic" && args.reportingType != "OnRequest") -+ { -+ messages::propertyValueNotInList(res, args.reportingType, -+ "MetricReportDefinitionType"); -+ return false; -+ } -+ -+ if (!toDbusReportActions(res, reportActions, args)) -+ { -+ return false; -+ } -+ -+ if (args.reportingType == "Periodic") -+ { -+ if (!schedule) -+ { -+ messages::createFailedMissingReqProperties(res, "Schedule"); -+ return false; -+ } -+ -+ std::string durationStr; -+ if (!json_util::readJson(*schedule, res, "RecurrenceInterval", -+ durationStr)) -+ { -+ return false; -+ } -+ -+ std::optional durationNum = -+ time_utils::fromDurationString(durationStr); -+ if (!durationNum) -+ { -+ messages::propertyValueIncorrect(res, "RecurrenceInterval", -+ durationStr); -+ return false; -+ } -+ args.interval = static_cast(durationNum->count()); -+ } -+ -+ args.metrics.reserve(metrics.size()); -+ for (auto& m : metrics) -+ { -+ std::string id; -+ std::vector uris; -+ if (!json_util::readJson(m, res, "MetricId", id, "MetricProperties", -+ uris)) -+ { -+ return false; -+ } -+ -+ args.metrics.emplace_back(std::move(id), std::move(uris)); -+ } -+ -+ return true; -+} -+ -+inline bool getChassisSensorNode( -+ const std::shared_ptr& asyncResp, -+ const std::vector>>& -+ metrics, -+ boost::container::flat_set>& matched) -+{ -+ for (const auto& [id, uris] : metrics) -+ { -+ for (size_t i = 0; i < uris.size(); i++) -+ { -+ const std::string& uri = uris[i]; -+ std::string chassis; -+ std::string node; -+ -+ if (!boost::starts_with(uri, "/redfish/v1/Chassis/") || -+ !dbus::utility::getNthStringFromPath(uri, 3, chassis) || -+ !dbus::utility::getNthStringFromPath(uri, 4, node)) -+ { -+ BMCWEB_LOG_ERROR << "Failed to get chassis and sensor Node " -+ "from " -+ << uri; -+ messages::propertyValueIncorrect(asyncResp->res, uri, -+ "MetricProperties/" + -+ std::to_string(i)); -+ return false; -+ } -+ -+ if (boost::ends_with(node, "#")) -+ { -+ node.pop_back(); -+ } -+ -+ matched.emplace(std::move(chassis), std::move(node)); -+ } -+ } -+ return true; -+} -+ -+class AddReport -+{ -+ public: -+ AddReport(AddReportArgs argsIn, std::shared_ptr asyncResp) : -+ asyncResp{std::move(asyncResp)}, args{std::move(argsIn)} -+ {} -+ ~AddReport() -+ { -+ if (asyncResp->res.result() != boost::beast::http::status::ok) -+ { -+ return; -+ } -+ -+ telemetry::ReadingParameters readingParams; -+ readingParams.reserve(args.metrics.size()); -+ -+ for (const auto& [id, uris] : args.metrics) -+ { -+ for (size_t i = 0; i < uris.size(); i++) -+ { -+ const std::string& uri = uris[i]; -+ auto el = uriToDbus.find(uri); -+ if (el == uriToDbus.end()) -+ { -+ BMCWEB_LOG_ERROR << "Failed to find DBus sensor " -+ "corresponding to URI " -+ << uri; -+ messages::propertyValueNotInList(asyncResp->res, uri, -+ "MetricProperties/" + -+ std::to_string(i)); -+ return; -+ } -+ -+ const std::string& dbusPath = el->second; -+ readingParams.emplace_back(dbusPath, "SINGLE", id, uri); -+ } -+ } -+ -+ crow::connections::systemBus->async_method_call( -+ [asyncResp = std::move(asyncResp), name = args.name, -+ uriToDbus = std::move(uriToDbus)]( -+ const boost::system::error_code ec, const std::string&) { -+ if (ec == boost::system::errc::file_exists) -+ { -+ messages::resourceAlreadyExists( -+ asyncResp->res, "MetricReportDefinition", "Id", name); -+ return; -+ } -+ if (ec == boost::system::errc::too_many_files_open) -+ { -+ messages::createLimitReachedForResource(asyncResp->res); -+ return; -+ } -+ if (ec == boost::system::errc::argument_list_too_long) -+ { -+ nlohmann::json metricProperties = nlohmann::json::array(); -+ for (const auto& [uri, _] : uriToDbus) -+ { -+ metricProperties.emplace_back(uri); -+ } -+ messages::propertyValueIncorrect( -+ asyncResp->res, metricProperties, "MetricProperties"); -+ return; -+ } -+ if (ec) -+ { -+ messages::internalError(asyncResp->res); -+ BMCWEB_LOG_ERROR << "respHandler DBus error " << ec; -+ return; -+ } -+ -+ messages::created(asyncResp->res); -+ }, -+ telemetry::service, "/xyz/openbmc_project/Telemetry/Reports", -+ "xyz.openbmc_project.Telemetry.ReportManager", "AddReport", -+ "TelemetryService/" + args.name, args.reportingType, -+ args.emitsReadingsUpdate, args.logToMetricReportsCollection, -+ args.interval, readingParams); -+ } -+ -+ void insert(const boost::container::flat_map& el) -+ { -+ uriToDbus.insert(el.begin(), el.end()); -+ } -+ -+ private: -+ std::shared_ptr asyncResp; -+ AddReportArgs args; -+ boost::container::flat_map uriToDbus{}; -+}; - } // namespace telemetry - - class MetricReportDefinitionCollection : public Node -@@ -126,6 +375,46 @@ class MetricReportDefinitionCollection : public Node - telemetry::getReportCollection(asyncResp, - telemetry::metricReportDefinitionUri); - } -+ -+ void doPost(crow::Response& res, const crow::Request& req, -+ const std::vector&) override -+ { -+ auto asyncResp = std::make_shared(res); -+ telemetry::AddReportArgs args; -+ if (!telemetry::getUserParameters(res, req, args)) -+ { -+ return; -+ } -+ -+ boost::container::flat_set> -+ chassisSensors; -+ if (!telemetry::getChassisSensorNode(asyncResp, args.metrics, -+ chassisSensors)) -+ { -+ return; -+ } -+ -+ auto addReportReq = -+ std::make_shared(std::move(args), asyncResp); -+ for (const auto& [chassis, sensorType] : chassisSensors) -+ { -+ retrieveUriToDbusMap( -+ chassis, sensorType, -+ [asyncResp, addReportReq]( -+ const boost::beast::http::status status, -+ const boost::container::flat_map& -+ uriToDbus) { -+ if (status != boost::beast::http::status::ok) -+ { -+ BMCWEB_LOG_ERROR << "Failed to retrieve URI to dbus " -+ "sensors map with err " -+ << static_cast(status); -+ return; -+ } -+ addReportReq->insert(uriToDbus); -+ }); -+ } -+ } - }; - - class MetricReportDefinition : public Node -@@ -184,5 +473,44 @@ class MetricReportDefinition : public Node - "org.freedesktop.DBus.Properties", "GetAll", - telemetry::reportInterface); - } -+ -+ void doDelete(crow::Response& res, const crow::Request&, -+ const std::vector& params) override -+ { -+ auto asyncResp = std::make_shared(res); -+ if (params.size() != 1) -+ { -+ messages::internalError(asyncResp->res); -+ return; -+ } -+ -+ const std::string& id = params[0]; -+ const std::string reportPath = telemetry::getDbusReportPath(id); -+ -+ crow::connections::systemBus->async_method_call( -+ [asyncResp, id](const boost::system::error_code ec) { -+ /* -+ * boost::system::errc and std::errc are missing value for -+ * EBADR error that is defined in Linux. -+ */ -+ if (ec.value() == EBADR) -+ { -+ messages::resourceNotFound(asyncResp->res, -+ "MetricReportDefinition", id); -+ return; -+ } -+ -+ if (ec) -+ { -+ BMCWEB_LOG_ERROR << "respHandler DBus error " << ec; -+ messages::internalError(asyncResp->res); -+ return; -+ } -+ -+ asyncResp->res.result(boost::beast::http::status::no_content); -+ }, -+ telemetry::service, reportPath, "xyz.openbmc_project.Object.Delete", -+ "Delete"); -+ } - }; - } // namespace redfish -diff --git a/redfish-core/ut/time_utils_test.cpp b/redfish-core/ut/time_utils_test.cpp -new file mode 100644 -index 0000000..70999ce ---- /dev/null -+++ b/redfish-core/ut/time_utils_test.cpp -@@ -0,0 +1,63 @@ -+#include "utils/time_utils.hpp" -+ -+#include -+ -+using namespace testing; -+ -+class FromDurationTest : -+ public Test, -+ public WithParamInterface< -+ std::pair>> -+{}; -+ -+INSTANTIATE_TEST_SUITE_P( -+ _, FromDurationTest, -+ Values(std::make_pair("PT12S", std::chrono::milliseconds(12000)), -+ std::make_pair("PT0.204S", std::chrono::milliseconds(204)), -+ std::make_pair("PT0.2S", std::chrono::milliseconds(200)), -+ std::make_pair("PT50M", std::chrono::milliseconds(3000000)), -+ std::make_pair("PT23H", std::chrono::milliseconds(82800000)), -+ std::make_pair("P51D", std::chrono::milliseconds(4406400000)), -+ std::make_pair("PT2H40M10.1S", std::chrono::milliseconds(9610100)), -+ std::make_pair("P20DT2H40M10.1S", -+ std::chrono::milliseconds(1737610100)), -+ std::make_pair("", std::chrono::milliseconds(0)), -+ std::make_pair("PTS", std::nullopt), -+ std::make_pair("P1T", std::nullopt), -+ std::make_pair("PT100M1000S100", std::nullopt), -+ std::make_pair("PDTHMS", std::nullopt), -+ std::make_pair("P99999999999999999DT", std::nullopt), -+ std::make_pair("PD222T222H222M222.222S", std::nullopt), -+ std::make_pair("PT99999H9999999999999999999999M99999999999S", -+ std::nullopt), -+ std::make_pair("PT-9H", std::nullopt))); -+ -+TEST_P(FromDurationTest, convertToMilliseconds) -+{ -+ const auto& [str, expected] = GetParam(); -+ EXPECT_THAT(redfish::time_utils::fromDurationString(str), Eq(expected)); -+} -+ -+class ToDurationTest : -+ public Test, -+ public WithParamInterface> -+{}; -+ -+INSTANTIATE_TEST_SUITE_P( -+ _, ToDurationTest, -+ Values(std::make_pair(std::chrono::milliseconds(12000), "PT12.000S"), -+ std::make_pair(std::chrono::milliseconds(204), "PT0.204S"), -+ std::make_pair(std::chrono::milliseconds(200), "PT0.200S"), -+ std::make_pair(std::chrono::milliseconds(3000000), "PT50M"), -+ std::make_pair(std::chrono::milliseconds(82800000), "PT23H"), -+ std::make_pair(std::chrono::milliseconds(4406400000), "P51DT"), -+ std::make_pair(std::chrono::milliseconds(9610100), "PT2H40M10.100S"), -+ std::make_pair(std::chrono::milliseconds(1737610100), -+ "P20DT2H40M10.100S"), -+ std::make_pair(std::chrono::milliseconds(-250), ""))); -+ -+TEST_P(ToDurationTest, convertToDuration) -+{ -+ const auto& [ms, expected] = GetParam(); -+ EXPECT_THAT(redfish::time_utils::toDurationString(ms), Eq(expected)); -+} --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README index cfb47a49b..46128f7ae 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README @@ -2,9 +2,6 @@ These patches are mirror of upstream TelemetryService implementation. Until change is integrated they will be manually merged here to enable feature in Intel builds. Current revisions: -- Add POST and DELETE in MetricReportDefinitions - https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/32536/63 - - Add support for MetricDefinition scheme https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/33363/60 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend index d42618b78..d9b32f5ae 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend @@ -1,5 +1,5 @@ SRC_URI = "git://github.com/openbmc/bmcweb.git" -SRCREV = "8e6c099ac8d4b4b3163a26b58fa0f9abb987979a" +SRCREV = "dab0604af234bdd5010407031a01343d6c242edf" DEPENDS += "boost-url" RDEPENDS_${PN} += "phosphor-nslcd-authority-cert-config" @@ -21,6 +21,9 @@ SRC_URI += "file://0001-Firmware-update-configuration-changes.patch \ file://0009-Add-support-to-ChangePassword-action.patch \ file://0010-managers-add-attributes-for-Manager.CommandShell.patch \ file://0034-recommended-fixes-by-crypto-review-team.patch \ + file://0011-bmcweb-Add-PhysicalContext-to-Thermal-resources.patch \ + file://0012-Log-RedFish-event-for-Invalid-login-attempt.patch \ + file://0013-Add-UART-routing-logic-into-host-console-connection-.patch \ " # Temporary downstream mirror of upstream patch to enable feature in Intel builds. @@ -30,25 +33,29 @@ SRC_URI += "file://0037-Add-state-sensor-messages-to-the-registry.patch \ # EventService: Temporary pulled to downstream. See eventservice\README for details SRC_URI += "file://eventservice/0001-EventService-Fix-retry-handling-for-http-client.patch \ file://eventservice/0002-EventService-https-client-support.patch \ - file://eventservice/0003-Move-EventService-init-to-later-stage.patch \ file://eventservice/0004-Add-Server-Sent-Events-support.patch \ file://eventservice/0005-Add-SSE-style-subscription-support-to-eventservice.patch \ file://eventservice/0006-Add-EventService-SSE-filter-support.patch \ " # Temporary downstream mirror of upstream patches, see telemetry\README for details -SRC_URI += "file://telemetry/0001-Sync_ReadingUnit_with_Redfish_Sensor_Schema.patch \ - file://telemetry/0002-Add-POST-and-DELETE-in-MetricReportDefinitions.patch \ - file://telemetry/0003-Add-support-for-MetricDefinition-scheme.patch \ +SRC_URI += "file://telemetry/0003-Add-support-for-MetricDefinition-scheme.patch \ file://telemetry/0004-Sync-Telmetry-service-with-EventService.patch \ " SRC_URI += "file://0001-Add-ConnectedVia-property-to-virtual-media-item-temp.patch \ - file://0002-Change-InsertMedia-action-response-for-POST-in-proxy.patch \ + file://0002-Invalid-status-code-from-InsertMedia-REST-methods.patch \ file://0003-Set-Inserted-redfish-property-for-not-inserted-resou.patch \ + file://0004-Bmcweb-handle-permission-denied-exception.patch \ + file://0005-Fix-unmounting-image-in-proxy-mode.patch \ " SRC_URI += "file://0038-Revert-Disable-nbd-proxy-from-the-build.patch \ + file://0039-Fix-comparison-for-proxy-legacy-mode.patch \ +" + +# Fix to avoid bmcweb crash on VM mount +SRC_URI += "file://0039-Fix-bmcweb-crashes-if-socket-directory-not-present.patch \ " # Temporary fix: Move it to service file diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Correct-the-IPv6-Router-Address-Configuration-comman.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Correct-the-IPv6-Router-Address-Configuration-comman.patch deleted file mode 100644 index 658f0d8b7..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-Correct-the-IPv6-Router-Address-Configuration-comman.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 4d7c0f704df21912fa447caca4dbba246d1b80f6 Mon Sep 17 00:00:00 2001 -From: Johnathan Mantey -Date: Tue, 26 Jan 2021 14:24:53 -0800 -Subject: [PATCH] Correct the IPv6 Router Address Configuration command - -The IPv6 Router Address Configuration Get/Set LAN command was not -reporting or modifying the correct portion of the networking -system. This command is intended to configure the Routing -Advertisement feature of IPv6. It is not a direct reflection of the -DHCP state. - -Systemd-networkd manages the Routing Advertisement via the -IPv6AcceptRA parameter, which according to the networkd documentaion, -enables/disables IPv6 DHCP functionality. - -Tested: -Issued "ipmitool raw 12 2 3 64 0 0" and was able to read the current -state of the IPv6AcceptRA variable. -Issued "ipmitool raw 12 1 3 64 2" and saw the configuration file for -the channel change, and the addition of a new IPv6 address to the -network device. -Issued "ipmitool raw 12 1 3 64 0" and saw that configuration file for -the channel change, and the removal of the IPv6 address from the -network device. - -Change-Id: Id01441f88ccc9d56449ab8115f4855de74e80cfc -Signed-off-by: Johnathan Mantey ---- - transporthandler.cpp | 61 ++++++++++++++++++++++++-------------------- - 1 file changed, 34 insertions(+), 27 deletions(-) - -diff --git a/transporthandler.cpp b/transporthandler.cpp -index b81e0d5..50343c7 100644 ---- a/transporthandler.cpp -+++ b/transporthandler.cpp -@@ -1260,6 +1260,35 @@ SetStatus& getSetStatus(uint8_t channel) - return setStatus[channel] = SetStatus::Complete; - } - -+/** @brief Gets the IPv6 Router Advertisement value -+ * -+ * @param[in] bus - The bus object used for lookups -+ * @param[in] params - The parameters for the channel -+ * @return networkd IPV6AcceptRA value -+ */ -+static bool getIPv6AcceptRA(sdbusplus::bus::bus& bus, -+ const ChannelParams& params) -+{ -+ auto raEnabled = -+ std::get(getDbusProperty(bus, params.service, params.logicalPath, -+ INTF_ETHERNET, "IPv6AcceptRA")); -+ return raEnabled; -+} -+ -+/** @brief Sets the IPv6AcceptRA flag -+ * -+ * @param[in] bus - The bus object used for lookups -+ * @param[in] params - The parameters for the channel -+ * @param[in] ipv6AcceptRA - boolean to enable/disable IPv6 Routing -+ * Advertisement -+ */ -+void setIPv6AcceptRA(sdbusplus::bus::bus& bus, const ChannelParams& params, -+ const bool ipv6AcceptRA) -+{ -+ setDbusProperty(bus, params.service, params.logicalPath, INTF_ETHERNET, -+ "IPv6AcceptRA", ipv6AcceptRA); -+} -+ - /** - * Define placeholder command handlers for the OEM Extension bytes for the Set - * LAN Configuration Parameters and Get LAN Configuration Parameters -@@ -1629,22 +1658,8 @@ RspType<> setLan(Context::ptr ctx, uint4_t channelBits, uint4_t reserved1, - { - return responseReqDataLenInvalid(); - } -- std::bitset<8> expected; -- EthernetInterface::DHCPConf dhcp = -- channelCall(channel); -- if ((dhcp == EthernetInterface::DHCPConf::both) | -- (dhcp == EthernetInterface::DHCPConf::v6)) -- { -- expected[IPv6RouterControlFlag::Dynamic] = 1; -- } -- else -- { -- expected[IPv6RouterControlFlag::Static] = 1; -- } -- if (expected != control) -- { -- return responseInvalidFieldRequest(); -- } -+ bool enableRA = control[IPv6RouterControlFlag::Dynamic]; -+ channelCall(channel, enableRA); - return responseSuccess(); - } - case LanParam::IPv6StaticRouter1IP: -@@ -1948,17 +1963,9 @@ RspType getLan(Context::ptr ctx, uint4_t channelBits, - case LanParam::IPv6RouterControl: - { - std::bitset<8> control; -- EthernetInterface::DHCPConf dhcp = -- channelCall(channel); -- if ((dhcp == EthernetInterface::DHCPConf::both) || -- (dhcp == EthernetInterface::DHCPConf::v6)) -- { -- control[IPv6RouterControlFlag::Dynamic] = 1; -- } -- else -- { -- control[IPv6RouterControlFlag::Static] = 1; -- } -+ control[IPv6RouterControlFlag::Dynamic] = -+ channelCall(channel); -+ control[IPv6RouterControlFlag::Static] = 0; - ret.pack(control); - return responseSuccess(std::move(ret)); - } --- -2.26.2 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend index 81cb43ebe..677641faf 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend @@ -8,7 +8,6 @@ SRC_URI += "file://phosphor-ipmi-host.service \ file://0060-Move-Get-SOL-config-parameter-to-host-ipmid.patch \ file://0062-Update-IPMI-Chassis-Control-command.patch \ file://0063-Save-the-pre-timeout-interrupt-in-dbus-property.patch \ - file://0064-Correct-the-IPv6-Router-Address-Configuration-comman.patch \ " EXTRA_OECONF_append = " --disable-i2c-whitelist-check" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend index 0aa63ca03..cc9f2d025 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend @@ -11,7 +11,7 @@ SMM_DEVICE = "ipmi_kcs4" SYSTEMD_SERVICE_${PN}_append = " ${PN}@${SMM_DEVICE}.service " SRC_URI = "git://github.com/openbmc/kcsbridge.git" -SRCREV = "4a4d1d03d99fabe089e649aa226ad4c61e71684e" +SRCREV = "3b170152ddc967f270939f4c351be987c451f0ca" SRC_URI += "file://99-ipmi-kcs.rules" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch deleted file mode 100644 index 5f749af45..000000000 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net/0009-Add-dbus-interface-for-sol-commands.patch +++ /dev/null @@ -1,317 +0,0 @@ -From e5ab844259f569656e95f5324f7428229dd811a7 Mon Sep 17 00:00:00 2001 -From: Cheng C Yang -Date: Wed, 3 Jul 2019 07:39:47 +0800 -Subject: [PATCH] Add dbus interface for sol commands - -Add dbus interface for sol config parameters so that after move set/get -sol config parameter command from net-ipmid to host-ipmid, the command -can send config parameters to net-ipmid sol service through the dbus -interface. - -Tested by: -busctl introspect xyz.openbmc_project.Settings /xyz/openbmc_project -/network/host0/sol can show correct dbus properties of sol parameters. -ipmitool -I lanplus -H x -U x -P x raw 0x0c 0x21 0x0e 0x00 0x01 -ipmitool -I lanplus -H x -U x -P x raw 0x0c 0x21 0x0e 0x01 0x00 -ipmitool -I lanplus -H x -U x -P x raw 0x0c 0x21 0x0e 0x02 0x83 -ipmitool -I lanplus -H x -U x -P x raw 0x0c 0x21 0x0e 0x03 0x5 0x03 -ipmitool -I lanplus -H x -U x -P x raw 0x0c 0x21 0x0e 0x04 0x5 0x03 -all these commands can change the dbus properties as the value in -above commands. -Before and after run these commands, ipmitool -I lanplus -H x -U x --P x sol activate can start sol session correctly. -After reboot BMC, "Progress" property in dbus interface change back -to 0 and other properties will not reset to default value. - -Signed-off-by: Cheng C Yang ---- - command/payload_cmds.cpp | 3 + - command/sol_cmds.cpp | 84 -------------------------- - sol/sol_manager.cpp | 124 +++++++++++++++++++++++++++++++++++++++ - sol/sol_manager.hpp | 1 + - sol_module.cpp | 6 -- - 5 files changed, 128 insertions(+), 90 deletions(-) - -diff --git a/command/payload_cmds.cpp b/command/payload_cmds.cpp -index c8e682e..bc987c5 100644 ---- a/command/payload_cmds.cpp -+++ b/command/payload_cmds.cpp -@@ -41,6 +41,9 @@ std::vector activatePayload(const std::vector& inPayload, - return outPayload; - } - -+ std::get(singletonPool) -+ .updateSOLParameter(ipmi::convertCurrentChannelNum( -+ ipmi::currentChNum, getInterfaceIndex())); - if (!std::get(singletonPool).enable) - { - response->completionCode = IPMI_CC_PAYLOAD_TYPE_DISABLED; -diff --git a/command/sol_cmds.cpp b/command/sol_cmds.cpp -index fda3e91..a1e820f 100644 ---- a/command/sol_cmds.cpp -+++ b/command/sol_cmds.cpp -@@ -71,90 +71,6 @@ void activating(uint8_t payloadInstance, uint32_t sessionID) - outPayload); - } - --std::vector setConfParams(const std::vector& inPayload, -- const message::Handler& handler) --{ -- std::vector outPayload(sizeof(SetConfParamsResponse)); -- auto request = -- reinterpret_cast(inPayload.data()); -- auto response = reinterpret_cast(outPayload.data()); -- response->completionCode = IPMI_CC_OK; -- -- switch (static_cast(request->paramSelector)) -- { -- case Parameter::PROGRESS: -- { -- uint8_t progress = request->value & progressMask; -- std::get(singletonPool).progress = progress; -- break; -- } -- case Parameter::ENABLE: -- { -- bool enable = request->value & enableMask; -- std::get(singletonPool).enable = enable; -- break; -- } -- case Parameter::AUTHENTICATION: -- { -- if (!request->auth.auth || !request->auth.encrypt) -- { -- response->completionCode = ipmiCCWriteReadParameter; -- } -- else if (request->auth.privilege < -- static_cast(session::Privilege::USER) || -- request->auth.privilege > -- static_cast(session::Privilege::OEM)) -- { -- response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST; -- } -- else -- { -- std::get(singletonPool).solMinPrivilege = -- static_cast(request->auth.privilege); -- } -- break; -- } -- case Parameter::ACCUMULATE: -- { -- using namespace std::chrono_literals; -- -- if (request->acc.threshold == 0) -- { -- response->completionCode = IPMI_CC_INVALID_FIELD_REQUEST; -- break; -- } -- -- std::get(singletonPool).accumulateInterval = -- request->acc.interval * sol::accIntervalFactor * 1ms; -- std::get(singletonPool).sendThreshold = -- request->acc.threshold; -- break; -- } -- case Parameter::RETRY: -- { -- using namespace std::chrono_literals; -- -- std::get(singletonPool).retryCount = -- request->retry.count; -- std::get(singletonPool).retryInterval = -- request->retry.interval * sol::retryIntervalFactor * 1ms; -- break; -- } -- case Parameter::PORT: -- { -- response->completionCode = ipmiCCWriteReadParameter; -- break; -- } -- case Parameter::NVBITRATE: -- case Parameter::VBITRATE: -- case Parameter::CHANNEL: -- default: -- response->completionCode = ipmiCCParamNotSupported; -- } -- -- return outPayload; --} -- - std::vector getConfParams(const std::vector& inPayload, - const message::Handler& handler) - { -diff --git a/sol/sol_manager.cpp b/sol/sol_manager.cpp -index a118457..55d269a 100644 ---- a/sol/sol_manager.cpp -+++ b/sol/sol_manager.cpp -@@ -14,6 +14,11 @@ - #include - #include - #include -+#include -+ -+constexpr const char* solInterface = "xyz.openbmc_project.Ipmi.SOL"; -+constexpr const char* solPath = "/xyz/openbmc_project/ipmi/sol/"; -+constexpr const char* PROP_INTF = "org.freedesktop.DBus.Properties"; - - namespace sol - { -@@ -103,6 +108,125 @@ void Manager::stopHostConsole() - } - } - -+std::string getService(sdbusplus::bus::bus& bus, const std::string& intf, -+ const std::string& path) -+{ -+ auto mapperCall = -+ bus.new_method_call("xyz.openbmc_project.ObjectMapper", -+ "/xyz/openbmc_project/object_mapper", -+ "xyz.openbmc_project.ObjectMapper", "GetObject"); -+ -+ mapperCall.append(path); -+ mapperCall.append(std::vector({intf})); -+ -+ std::map> mapperResponse; -+ -+ try -+ { -+ auto mapperResponseMsg = bus.call(mapperCall); -+ mapperResponseMsg.read(mapperResponse); -+ } -+ catch (sdbusplus::exception_t&) -+ { -+ throw std::runtime_error("ERROR in mapper call"); -+ } -+ -+ if (mapperResponse.begin() == mapperResponse.end()) -+ { -+ throw std::runtime_error("ERROR in reading the mapper response"); -+ } -+ -+ return mapperResponse.begin()->first; -+} -+ -+ipmi::PropertyMap getAllDbusProperties(sdbusplus::bus::bus& bus, -+ const std::string& service, -+ const std::string& objPath, -+ const std::string& interface) -+{ -+ ipmi::PropertyMap properties; -+ -+ sdbusplus::message::message method = bus.new_method_call( -+ service.c_str(), objPath.c_str(), PROP_INTF, "GetAll"); -+ -+ method.append(interface); -+ -+ try -+ { -+ sdbusplus::message::message reply = bus.call(method); -+ reply.read(properties); -+ } -+ catch (sdbusplus::exception_t&) -+ { -+ phosphor::logging::log( -+ "Failed to get all properties", -+ phosphor::logging::entry("PATH=%s", objPath.c_str()), -+ phosphor::logging::entry("INTERFACE=%s", interface.c_str())); -+ throw std::runtime_error("ERROR in reading proerties"); -+ } -+ -+ return properties; -+} -+ -+void Manager::updateSOLParameter(uint8_t channelNum) -+{ -+ std::variant value; -+ sdbusplus::bus::bus dbus(ipmid_get_sd_bus_connection()); -+ static std::string solService{}; -+ ipmi::PropertyMap properties; -+ std::string ethdevice = ipmi::getChannelName(channelNum); -+ std::string solPathWitheEthName = solPath + ethdevice; -+ if (solService.empty()) -+ { -+ try -+ { -+ solService = getService(dbus, solInterface, solPathWitheEthName); -+ } -+ catch (const std::runtime_error& e) -+ { -+ solService.clear(); -+ phosphor::logging::log( -+ "Error: get SOL service failed"); -+ return; -+ } -+ } -+ try -+ { -+ properties = getAllDbusProperties(dbus, solService, solPathWitheEthName, -+ solInterface); -+ } -+ catch (const std::runtime_error&) -+ { -+ phosphor::logging::log( -+ "Error setting sol parameter"); -+ return; -+ } -+ -+ progress = std::get(properties["Progress"]); -+ -+ enable = std::get(properties["Enable"]); -+ -+ forceEncrypt = std::get(properties["ForceEncryption"]); -+ -+ forceAuth = std::get(properties["ForceAuthentication"]); -+ -+ solMinPrivilege = static_cast( -+ std::get(properties["Privilege"])); -+ -+ accumulateInterval = -+ std::get((properties["AccumulateIntervalMS"])) * -+ sol::accIntervalFactor * 1ms; -+ -+ sendThreshold = std::get(properties["Threshold"]); -+ -+ retryCount = std::get(properties["RetryCount"]); -+ -+ retryInterval = std::get(properties["RetryIntervalMS"]) * -+ sol::retryIntervalFactor * 1ms; -+ -+ return; -+} -+ - void Manager::startPayloadInstance(uint8_t payloadInstance, - session::SessionID sessionID) - { -diff --git a/sol/sol_manager.hpp b/sol/sol_manager.hpp -index 5b48add..4e797d4 100644 ---- a/sol/sol_manager.hpp -+++ b/sol/sol_manager.hpp -@@ -252,6 +252,7 @@ class Manager - * @return 0 on success and errno on failure. - */ - int writeConsoleSocket(const std::vector& input) const; -+ void updateSOLParameter(uint8_t channelNum); - - private: - SOLPayloadMap payloadMap; -diff --git a/sol_module.cpp b/sol_module.cpp -index 8200e74..2b1fb46 100644 ---- a/sol_module.cpp -+++ b/sol_module.cpp -@@ -42,12 +42,6 @@ void registerCommands() - &getPayloadInfo, - session::Privilege::USER, - false}, -- // Set SOL Configuration Parameters -- {{(static_cast(message::PayloadType::IPMI) << 16) | -- static_cast(::command::NetFns::TRANSPORT) | 0x21}, -- &setConfParams, -- session::Privilege::ADMIN, -- false}, - // Get SOL Configuration Parameters - {{(static_cast(message::PayloadType::IPMI) << 16) | - static_cast(::command::NetFns::TRANSPORT) | 0x22}, --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend index 9b76a8fa4..7fe91fd1f 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend @@ -3,7 +3,7 @@ inherit useradd # TODO: This should be removed, once up-stream bump up # issue is resolved SRC_URI += "git://github.com/openbmc/phosphor-net-ipmid" -SRCREV = "de7dd5ce3133a0201e149b6fdf3d3458fb7f06a5" +SRCREV = "d4a4bed525f79c39705fa526b20ab663bb2c2069" USERADD_PACKAGES = "${PN}" # add a group called ipmi @@ -21,7 +21,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += " file://10-nice-rules.conf \ file://0006-Modify-dbus-namespace-of-chassis-control-for-guid.patch \ - file://0009-Add-dbus-interface-for-sol-commands.patch \ file://0011-Remove-Get-SOL-Config-Command-from-Netipmid.patch \ " diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/leds/intel-led-manager-config-native.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/leds/intel-led-manager-config-native.bb index dd48df0c6..47c66ccb8 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/leds/intel-led-manager-config-native.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/leds/intel-led-manager-config-native.bb @@ -1,8 +1,8 @@ SUMMARY = "Phosphor LED Group Management for Intel" PR = "r1" -inherit native inherit obmc-phosphor-utils +inherit native LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb index ae498beb8..6c930876f 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libmctp-intel_git.bb @@ -2,7 +2,7 @@ SUMMARY = "libmctp_intel" DESCRIPTION = "Implementation of MCTP(DMTF DSP0236)" SRC_URI = "git://github.com/Intel-BMC/libmctp.git;protocol=ssh" -SRCREV = "dca36d524d22d6efab3f7bfd6adda69dbebb1bf3" +SRCREV = "37ea118aa8653cc6220c4fd6da0224f0797f4bdc" S = "${WORKDIR}/git" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libpldm-intel_git.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libpldm-intel_git.bb index 0ed7add07..ee6fd12ee 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libpldm-intel_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/libpldm-intel_git.bb @@ -2,7 +2,7 @@ SUMMARY = "libpldm_intel" DESCRIPTION = "Provides encode/decode APIs for PLDM specifications" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "07adfb357cdb679bf9bbcf2eaff7406cfb5fd52b" +SRCREV = "196f057fe8efea8080ec71ad4159df0675dd6a4c" S = "${WORKDIR}/git/libpldm_intel" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb index 6a418c330..b9d3c0ca4 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-emulator.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=bcd9ada3a943f58551867d72893cc9ab" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "07adfb357cdb679bf9bbcf2eaff7406cfb5fd52b" +SRCREV = "196f057fe8efea8080ec71ad4159df0675dd6a4c" S = "${WORKDIR}/git/mctp_emulator" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb index 3e8119c66..afe199192 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctp-wrapper.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=bcd9ada3a943f58551867d72893cc9ab" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "07adfb357cdb679bf9bbcf2eaff7406cfb5fd52b" +SRCREV = "196f057fe8efea8080ec71ad4159df0675dd6a4c" S = "${WORKDIR}/git/mctp_wrapper" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb index c152eef70..96582c76e 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${PN}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "07adfb357cdb679bf9bbcf2eaff7406cfb5fd52b" +SRCREV = "196f057fe8efea8080ec71ad4159df0675dd6a4c" S = "${WORKDIR}/git" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb index 1fbeefced..c36c0d926 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpwplus.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=615045c30a05cde5c0e924854d43c327" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "07adfb357cdb679bf9bbcf2eaff7406cfb5fd52b" +SRCREV = "196f057fe8efea8080ec71ad4159df0675dd6a4c" S = "${WORKDIR}/git/mctpwplus" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/nvmemi-daemon.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/nvmemi-daemon.bb index d53ac712e..8a73394e5 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/nvmemi-daemon.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/nvmemi-daemon.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" SRC_URI = "git://github.com/Intel-BMC/nvme-mi.git;protocol=ssh" -SRCREV = "63e1cf7f8b950d37fdb035745bf740ec87ede6ae" +SRCREV = "832c63d3db86788859f4afb911840f5ba100d230" S = "${WORKDIR}/git" PV = "1.0+git${SRCPV}" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb index 08571570b..4a2a33878 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" SRC_URI += "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "07adfb357cdb679bf9bbcf2eaff7406cfb5fd52b" +SRCREV = "196f057fe8efea8080ec71ad4159df0675dd6a4c" S = "${WORKDIR}/git/pldmd" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb index 8b4ee807a..134cd9fdd 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pmci-launcher.bb @@ -5,7 +5,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" SRC_URI = "git://github.com/Intel-BMC/pmci.git;protocol=ssh" -SRCREV = "07adfb357cdb679bf9bbcf2eaff7406cfb5fd52b" +SRCREV = "196f057fe8efea8080ec71ad4159df0675dd6a4c" S = "${WORKDIR}/git/pmci_launcher" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init b/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init index 245dabe6c..2065f94ee 100755 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init @@ -149,6 +149,11 @@ RESTORE_FLAG=$RWFS_MNT/.restore_op if [ -f "$RESTORE_FLAG" ]; then mount -o remount,rw "$RWFS_MNT" restore_op=$(cat $RESTORE_FLAG) # read from NV + modified_on=$(stat -c %y $RESTORE_FLAG) # get last modified time + log "restore_op: $restore_op modified on: $modified_on" + # To rule out stale file mounted, Write unique, unused value 0x10 + # (last 2-bits are b00) before removing the file. + echo 16 > $RESTORE_FLAG # set default value 0 if RESTORE_FLAG file was empty restore_op=${restore_op:-0} restore_op=$((restore_op & 3)) # mask off 2 bits diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend index cb4a74a0b..e5c229ac7 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sel-logger/phosphor-sel-logger_%.bbappend @@ -1,4 +1,4 @@ # Enable downstream autobump SRC_URI = "git://github.com/openbmc/phosphor-sel-logger.git" -SRCREV = "aaffc124b6f49d9bc267e65565bdd5d4c1db1aaf" +SRCREV = "486e42e9db215070d631b7ac1f8f32537cb3bfe7" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend index d0370ba00..c00b5d4cf 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend @@ -1,7 +1,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" PROJECT_SRC_DIR := "${THISDIR}/${PN}" -SRCREV = "0947d7c1cb9dc5ae4bc740d18aff059cb896c309" +SRCREV = "6b6891c52e550c42507d4b413cbc4c6a09235535" #SRC_URI = "git://github.com/openbmc/dbus-sensors.git" SRC_URI += "\ diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-post-code-manager_git.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-post-code-manager_git.bbappend index f767cda73..ebb498866 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-post-code-manager_git.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/state/phosphor-post-code-manager_git.bbappend @@ -1,2 +1,2 @@ #SRC_URI = "git://github.com/openbmc/phosphor-post-code-manager.git" -SRCREV = "84a4c19c48ad28b537cfcce15df39e841e1ed565" +SRCREV = "0171dd6bce9004e187c957f160809b729322f37d" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/telemetry/telemetry_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/telemetry/telemetry_%.bbappend index dcbe656b1..42f23dd9e 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/telemetry/telemetry_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/telemetry/telemetry_%.bbappend @@ -1,5 +1,5 @@ SRC_URI = "git://github.com/openbmc/telemetry.git" -SRCREV = "d7cebdd37fade28b0efd34bb9d641135bff758a0" +SRCREV = "f763c9e3bbe0f86a4a41e7bb0dc70bffde0af9b2" EXTRA_OEMESON += " -Dmax-reports=5" EXTRA_OEMESON += " -Dmax-reading-parameters=200" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager_%.bbappend index 0b3d54986..c9f14f54c 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager_%.bbappend @@ -1,7 +1,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI = "git://github.com/openbmc/phosphor-user-manager" -SRCREV = "9638afb9aa848aa0e696c2447e0fbc70a0aa5eed" +SRCREV = "18c1b42c1612e0e8d8f5cd9973bba09b447c7185" EXTRA_OECONF += "${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'allow-root-login' ], '', '--disable-root_user_mgmt', d)}" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Customize-phosphor-watchdog-for-Intel-platforms.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Customize-phosphor-watchdog-for-Intel-platforms.patch index d137f6971..a634b1588 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Customize-phosphor-watchdog-for-Intel-platforms.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/0001-Customize-phosphor-watchdog-for-Intel-platforms.patch @@ -1,4 +1,4 @@ -From 0e426ce8bcde3b6fb131405ef265250a96aa7e0a Mon Sep 17 00:00:00 2001 +From 67797d726b6eb6fa8e1dad063c7d2021cec47ab3 Mon Sep 17 00:00:00 2001 From: James Feist Date: Mon, 17 Jun 2019 12:00:58 -0700 Subject: [PATCH] Customize phosphor-watchdog for Intel platforms @@ -11,19 +11,23 @@ required for compatibility with Intel platforms. 3. Use host status to enable/disable watchdog 4. Set preTimeoutInterruptOccurFlag 5. Assign watchdog cause for correct reset cause reporting + 6. Add NMI Pre-Interrupt support for IPMI watchdog timer. Signed-off-by: James Feist Signed-off-by: Ren Yu Signed-off-by: Yong Li Signed-off-by: Jason M. Bills Signed-off-by: Johnathan Mantey +Signed-off-by: Sunita Kumari + +%% original patch: 0001-Customize-phosphor-watchdog-for-Intel-platforms.patch --- - watchdog.cpp | 212 ++++++++++++++++++++++++++++++++++++++++++++++++--- + watchdog.cpp | 230 ++++++++++++++++++++++++++++++++++++++++++++++++--- watchdog.hpp | 23 +++++- - 2 files changed, 224 insertions(+), 11 deletions(-) + 2 files changed, 242 insertions(+), 11 deletions(-) diff --git a/watchdog.cpp b/watchdog.cpp -index 9090760..2685401 100644 +index 57e9050..1204db4 100644 --- a/watchdog.cpp +++ b/watchdog.cpp @@ -1,11 +1,14 @@ @@ -41,7 +45,7 @@ index 9090760..2685401 100644 namespace phosphor { -@@ -18,10 +21,77 @@ using namespace phosphor::logging; +@@ -18,10 +21,86 @@ using namespace phosphor::logging; using sdbusplus::exception::SdBusError; using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure; @@ -104,6 +108,15 @@ index 9090760..2685401 100644 +static constexpr const char* request = "RequestedHostTransition"; +} // namespace host + ++namespace nmi ++{ ++static constexpr const char* busName = "xyz.openbmc_project.Control.Host.NMI"; ++static constexpr const char* path = "/xyz/openbmc_project/control/host0/nmi"; ++static constexpr const char* interface = "xyz.openbmc_project.Control.Host.NMI"; ++static constexpr const char* request = "NMI"; ++ ++} // namespace nmi ++ +void Watchdog::powerStateChangedHandler( + const std::map>& props) +{ @@ -123,7 +136,7 @@ index 9090760..2685401 100644 void Watchdog::resetTimeRemaining(bool enableWatchdog) { -@@ -102,13 +172,102 @@ uint64_t Watchdog::interval(uint64_t value) +@@ -107,13 +186,111 @@ uint64_t Watchdog::interval(uint64_t value) // Optional callback function on timer expiration void Watchdog::timeOutHandler() { @@ -223,11 +236,20 @@ index 9090760..2685401 100644 + "Watchdog timeout. timer use: %s", + preInterruptActionMessageArgs.c_str(), + timeUserMessage.c_str(), NULL); ++ ++ if (preTimeoutInterruptAction == ++ Watchdog::PreTimeoutInterruptAction::NMI) ++ { ++ sdbusplus::message::message preTimeoutInterruptHandler; ++ preTimeoutInterruptHandler = bus.new_method_call( ++ nmi::busName, nmi::path, nmi::interface, nmi::request); ++ bus.call_noreply(preTimeoutInterruptHandler); ++ } + } auto target = actionTargetMap.find(action); if (target == actionTargetMap.end()) -@@ -128,12 +287,45 @@ void Watchdog::timeOutHandler() +@@ -133,12 +310,45 @@ void Watchdog::timeOutHandler() try { @@ -327,5 +349,5 @@ index 7de9bb3..b004b7a 100644 void timeOutHandler(); -- -2.29.2 +2.17.1 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend index 5ef57447d..244af18dc 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/phosphor-webui_%.bbappend @@ -1,4 +1,4 @@ SRC_URI = "git://github.com/Intel-BMC/phosphor-webui;protocol=ssh;branch=intel2" FILESEXTRAPATHS_prepend_intel := "${THISDIR}/${PN}:" -SRCREV = "f0e37253951a4a32e4929c660232e17961f97bb8" +SRCREV = "40dd78bd5fe1dfcadd22bba9eee8e402b634b40d" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/webui-vue_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/webui-vue_%.bbappend index bdb411121..7ebf1d4d6 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/webui/webui-vue_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/webui/webui-vue_%.bbappend @@ -1,6 +1,6 @@ # Enable downstream autobump SRC_URI = "git://github.com/openbmc/webui-vue.git" -SRCREV = "1915d8c4992c1a4165e8ae108e4d799b3b4ce86a" +SRCREV = "5ed21f2d1e8b82be699a623bfdef550dfd598dbb" do_compile_prepend() { cp -vf ${S}/.env.intel ${S}/.env diff --git a/meta-openbmc-mods/meta-common/recipes-support/curl/curl_7.74.0.bb b/meta-openbmc-mods/meta-common/recipes-support/curl/curl_7.74.0.bb deleted file mode 100644 index 873bbe814..000000000 --- a/meta-openbmc-mods/meta-common/recipes-support/curl/curl_7.74.0.bb +++ /dev/null @@ -1,85 +0,0 @@ -SUMMARY = "Command line tool and library for client-side URL transfers" -HOMEPAGE = "http://curl.haxx.se/" -BUGTRACKER = "http://curl.haxx.se/mail/list.cgi?list=curl-tracker" -SECTION = "console/network" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://COPYING;md5=2e9fb35867314fe31c6a4977ef7dd531" - -SRC_URI = "https://curl.haxx.se/download/curl-${PV}.tar.bz2 \ - file://0001-replace-krb5-config-with-pkg-config.patch \ -" - -SRC_URI[sha256sum] = "0f4d63e6681636539dc88fa8e929f934cd3a840c46e0bf28c73be11e521b77a5" - -# Curl has used many names over the years... -CVE_PRODUCT = "haxx:curl haxx:libcurl curl:curl curl:libcurl libcurl:libcurl daniel_stenberg:curl" - -inherit autotools pkgconfig binconfig multilib_header - -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} gnutls libidn proxy threaded-resolver verbose zlib" -PACKAGECONFIG_class-native = "ipv6 proxy ssl threaded-resolver verbose zlib" -PACKAGECONFIG_class-nativesdk = "ipv6 proxy ssl threaded-resolver verbose zlib" - -# 'ares' and 'threaded-resolver' are mutually exclusive -PACKAGECONFIG[ares] = "--enable-ares,--disable-ares,c-ares,,,threaded-resolver" -PACKAGECONFIG[brotli] = "--with-brotli,--without-brotli,brotli" -PACKAGECONFIG[builtinmanual] = "--enable-manual,--disable-manual" -PACKAGECONFIG[dict] = "--enable-dict,--disable-dict," -PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls" -PACKAGECONFIG[gopher] = "--enable-gopher,--disable-gopher," -PACKAGECONFIG[imap] = "--enable-imap,--disable-imap," -PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," -PACKAGECONFIG[krb5] = "--with-gssapi,--without-gssapi,krb5" -PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap," -PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps," -PACKAGECONFIG[libidn] = "--with-libidn2,--without-libidn2,libidn2" -PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2" -PACKAGECONFIG[mbedtls] = "--with-mbedtls=${STAGING_DIR_TARGET},--without-mbedtls,mbedtls" -PACKAGECONFIG[mqtt] = "--enable-mqtt,--disable-mqtt," -PACKAGECONFIG[nghttp2] = "--with-nghttp2,--without-nghttp2,nghttp2" -PACKAGECONFIG[pop3] = "--enable-pop3,--disable-pop3," -PACKAGECONFIG[proxy] = "--enable-proxy,--disable-proxy," -PACKAGECONFIG[rtmpdump] = "--with-librtmp,--without-librtmp,rtmpdump" -PACKAGECONFIG[rtsp] = "--enable-rtsp,--disable-rtsp," -PACKAGECONFIG[smb] = "--enable-smb,--disable-smb," -PACKAGECONFIG[smtp] = "--enable-smtp,--disable-smtp," -PACKAGECONFIG[ssl] = "--with-ssl --with-random=/dev/urandom,--without-ssl,openssl" -PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss" -PACKAGECONFIG[telnet] = "--enable-telnet,--disable-telnet," -PACKAGECONFIG[tftp] = "--enable-tftp,--disable-tftp," -PACKAGECONFIG[threaded-resolver] = "--enable-threaded-resolver,--disable-threaded-resolver,,,,ares" -PACKAGECONFIG[verbose] = "--enable-verbose,--disable-verbose" -PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_LIBDIR}/../,--without-zlib,zlib" - -EXTRA_OECONF = " \ - --disable-libcurl-option \ - --disable-ntlm-wb \ - --enable-crypto-auth \ - --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \ - --without-libmetalink \ - --without-libpsl \ - --enable-debug \ - --enable-optimize \ - --disable-curldebug \ -" - -do_install_append_class-target() { - # cleanup buildpaths from curl-config - sed -i \ - -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ - -e 's,--with-libtool-sysroot=${STAGING_DIR_TARGET},,g' \ - -e 's|${DEBUG_PREFIX_MAP}||g' \ - ${D}${bindir}/curl-config -} - -PACKAGES =+ "lib${BPN}" - -FILES_lib${BPN} = "${libdir}/lib*.so.*" -RRECOMMENDS_lib${BPN} += "ca-certificates" - -FILES_${PN} += "${datadir}/zsh" - -inherit multilib_script -MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/curl-config" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openbmc-mods/meta-common/recipes-support/curl/curl_7.76.0.bb b/meta-openbmc-mods/meta-common/recipes-support/curl/curl_7.76.0.bb new file mode 100644 index 000000000..83e1a81e4 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-support/curl/curl_7.76.0.bb @@ -0,0 +1,85 @@ +SUMMARY = "Command line tool and library for client-side URL transfers" +HOMEPAGE = "http://curl.haxx.se/" +BUGTRACKER = "http://curl.haxx.se/mail/list.cgi?list=curl-tracker" +SECTION = "console/network" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=425f6fdc767cc067518eef9bbdf4ab7b" + +SRC_URI = "https://curl.haxx.se/download/curl-${PV}.tar.bz2 \ + file://0001-replace-krb5-config-with-pkg-config.patch \ +" + +SRC_URI[sha256sum] = "e29bfe3633701590d75b0071bbb649ee5ca4ca73f00649268bd389639531c49a" + +# Curl has used many names over the years... +CVE_PRODUCT = "haxx:curl haxx:libcurl curl:curl curl:libcurl libcurl:libcurl daniel_stenberg:curl" + +inherit autotools pkgconfig binconfig multilib_header + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} gnutls libidn proxy threaded-resolver verbose zlib" +PACKAGECONFIG_class-native = "ipv6 proxy ssl threaded-resolver verbose zlib" +PACKAGECONFIG_class-nativesdk = "ipv6 proxy ssl threaded-resolver verbose zlib" + +# 'ares' and 'threaded-resolver' are mutually exclusive +PACKAGECONFIG[ares] = "--enable-ares,--disable-ares,c-ares,,,threaded-resolver" +PACKAGECONFIG[brotli] = "--with-brotli,--without-brotli,brotli" +PACKAGECONFIG[builtinmanual] = "--enable-manual,--disable-manual" +PACKAGECONFIG[dict] = "--enable-dict,--disable-dict," +PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls" +PACKAGECONFIG[gopher] = "--enable-gopher,--disable-gopher," +PACKAGECONFIG[imap] = "--enable-imap,--disable-imap," +PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," +PACKAGECONFIG[krb5] = "--with-gssapi,--without-gssapi,krb5" +PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap," +PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps," +PACKAGECONFIG[libidn] = "--with-libidn2,--without-libidn2,libidn2" +PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2" +PACKAGECONFIG[mbedtls] = "--with-mbedtls=${STAGING_DIR_TARGET},--without-mbedtls,mbedtls" +PACKAGECONFIG[mqtt] = "--enable-mqtt,--disable-mqtt," +PACKAGECONFIG[nghttp2] = "--with-nghttp2,--without-nghttp2,nghttp2" +PACKAGECONFIG[pop3] = "--enable-pop3,--disable-pop3," +PACKAGECONFIG[proxy] = "--enable-proxy,--disable-proxy," +PACKAGECONFIG[rtmpdump] = "--with-librtmp,--without-librtmp,rtmpdump" +PACKAGECONFIG[rtsp] = "--enable-rtsp,--disable-rtsp," +PACKAGECONFIG[smb] = "--enable-smb,--disable-smb," +PACKAGECONFIG[smtp] = "--enable-smtp,--disable-smtp," +PACKAGECONFIG[ssl] = "--with-ssl --with-random=/dev/urandom,--without-ssl,openssl" +PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss" +PACKAGECONFIG[telnet] = "--enable-telnet,--disable-telnet," +PACKAGECONFIG[tftp] = "--enable-tftp,--disable-tftp," +PACKAGECONFIG[threaded-resolver] = "--enable-threaded-resolver,--disable-threaded-resolver,,,,ares" +PACKAGECONFIG[verbose] = "--enable-verbose,--disable-verbose" +PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_LIBDIR}/../,--without-zlib,zlib" + +EXTRA_OECONF = " \ + --disable-libcurl-option \ + --disable-ntlm-wb \ + --enable-crypto-auth \ + --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \ + --without-libmetalink \ + --without-libpsl \ + --enable-debug \ + --enable-optimize \ + --disable-curldebug \ +" + +do_install_append_class-target() { + # cleanup buildpaths from curl-config + sed -i \ + -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ + -e 's,--with-libtool-sysroot=${STAGING_DIR_TARGET},,g' \ + -e 's|${DEBUG_PREFIX_MAP}||g' \ + ${D}${bindir}/curl-config +} + +PACKAGES =+ "lib${BPN}" + +FILES_lib${BPN} = "${libdir}/lib*.so.*" +RRECOMMENDS_lib${BPN} += "ca-certificates" + +FILES_${PN} += "${datadir}/zsh" + +inherit multilib_script +MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/curl-config" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/Add-target-to-only-build-tests-not-run-them.patch b/meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/Add-target-to-only-build-tests-not-run-them.patch new file mode 100644 index 000000000..e3f5c6de7 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/Add-target-to-only-build-tests-not-run-them.patch @@ -0,0 +1,45 @@ +Add target to only build tests (not run them) + +Not sending upstream as this is only a start of a solution to +installable tests: It's useful for us already as is. + +Upstream-Status: Inappropriate [not a complete solution] + +Signed-off-by: Jussi Kukkonen +Refactored for 3.4 +Signed-off-by: Armin Kuster +--- + Makefile.in | 3 +++ + testsuite/Makefile.in | 2 ++ + 2 files changed, 5 insertions(+) + +diff --git a/Makefile.in b/Makefile.in +index e5ccfc7..15c9275 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -52,6 +52,9 @@ clean distclean mostlyclean maintainer-clean tags: + echo "Making $@ in $$d" ; (cd $$d && $(MAKE) $@); done + $(MAKE) $@-here + ++buildtest: ++ echo "Making $@ in testsuite" ; (cd testsuite && $(MAKE) $@) ++ + check-here: + true + +diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in +index 3f5e5f6..8fd68a3 100644 +--- a/testsuite/Makefile.in ++++ b/testsuite/Makefile.in +@@ -122,6 +122,8 @@ $(TARGETS) $(EXTRA_TARGETS): testutils.$(OBJEXT) ../nettle-internal.$(OBJEXT) \ + # data. + VALGRIND = valgrind --error-exitcode=1 --leak-check=full --show-reachable=yes @IF_ASM@ --partial-loads-ok=yes + ++buildtest: $(TS_ALL) ++ + check: $(TS_ALL) + TEST_SHLIB_DIR="$(TEST_SHLIB_DIR)" \ + srcdir="$(srcdir)" \ +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/check-header-files-of-openssl-only-if-enable_.patch b/meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/check-header-files-of-openssl-only-if-enable_.patch new file mode 100644 index 000000000..d5f266681 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/check-header-files-of-openssl-only-if-enable_.patch @@ -0,0 +1,36 @@ +From ffee6b5f6204a0210f717968ec6ce514d70acca1 Mon Sep 17 00:00:00 2001 +From: Haiqing Bai +Date: Fri, 9 Dec 2016 15:23:17 +0800 +Subject: [PATCH] nettle: check header files of openssl only if + 'enable_openssl=yes'. + +The original configure script checks openssl header files to generate +config.h even if 'enable_openssl' is not set to yes, this made inconsistent +building for nettle. + +Upstream-Status: Pending +Signed-off-by: Haiqing Bai + +refactored for 3.4. pending not in as of 3.4 + +Signed-off-by: Armin Kuster + +Index: nettle-3.4/configure.ac +=================================================================== +--- nettle-3.4.orig/configure.ac ++++ nettle-3.4/configure.ac +@@ -185,9 +185,11 @@ AC_HEADER_TIME + AC_CHECK_SIZEOF(long) + AC_CHECK_SIZEOF(size_t) + +-AC_CHECK_HEADERS([openssl/evp.h openssl/ecdsa.h],, +-[enable_openssl=no +- break]) ++if test "x$enable_openssl" = "xyes"; then ++ AC_CHECK_HEADERS([openssl/evp.h openssl/ecdsa.h],, ++ [enable_openssl=no ++ break]) ++fi + + # For use by the testsuite + AC_CHECK_HEADERS([valgrind/memcheck.h]) diff --git a/meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/dlopen-test.patch b/meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/dlopen-test.patch new file mode 100644 index 000000000..ab9b91f88 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/dlopen-test.patch @@ -0,0 +1,29 @@ +Remove the relative path for libnettle.so so the test +program can find it. +Relative paths are not suitable, as the folder strucure for ptest +is different from the one expected by the nettle testsuite. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Juro Bystricky +Signed-off-by: Mingli Yu +--- + testsuite/dlopen-test.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/testsuite/dlopen-test.c b/testsuite/dlopen-test.c +index 4265bf7..1a25d17 100644 +--- a/testsuite/dlopen-test.c ++++ b/testsuite/dlopen-test.c +@@ -15,7 +15,7 @@ int + main (int argc UNUSED, char **argv UNUSED) + { + #if HAVE_LIBDL +- void *handle = dlopen ("../libnettle." SO_EXT, RTLD_NOW); ++ void *handle = dlopen ("libnettle.so", RTLD_NOW); + int (*get_version)(void); + if (!handle) + { +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/run-ptest b/meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/run-ptest new file mode 100644 index 000000000..b90bed66d --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-support/nettle/nettle/run-ptest @@ -0,0 +1,36 @@ +#! /bin/sh + +cd testsuite + +failed=0 +all=0 + +for f in *-test; do + if [ "$f" = "sha1-huge-test" ] ; then + echo "SKIP: $f (skipped for ludicrous run time)" + continue + fi + + "./$f" + case "$?" in + 0) + echo "PASS: $f" + all=$((all + 1)) + ;; + 77) + echo "SKIP: $f" + ;; + *) + echo "FAIL: $f" + failed=$((failed + 1)) + all=$((all + 1)) + ;; + esac +done + +if [ "$failed" -eq 0 ] ; then + echo "All $all tests passed" +else + echo "$failed of $all tests failed" +fi + diff --git a/meta-openbmc-mods/meta-common/recipes-support/nettle/nettle_3.7.2.bb b/meta-openbmc-mods/meta-common/recipes-support/nettle/nettle_3.7.2.bb new file mode 100644 index 000000000..f8f336008 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-support/nettle/nettle_3.7.2.bb @@ -0,0 +1,57 @@ +SUMMARY = "A low level cryptographic library" +DESCRIPTION = "Nettle is a cryptographic library that is designed to fit easily in more or less any context: In crypto toolkits for object-oriented languages (C++, Python, Pike, ...), in applications like LSH or GNUPG, or even in kernel space." +HOMEPAGE = "http://www.lysator.liu.se/~nisse/nettle/" +DESCRIPTION = "It tries to solve a problem of providing a common set of \ +cryptographic algorithms for higher-level applications by implementing a \ +context-independent set of cryptographic algorithms" +SECTION = "libs" +LICENSE = "LGPLv3+ | GPLv2+" + +LIC_FILES_CHKSUM = "file://COPYING.LESSERv3;md5=6a6a8e020838b23406c81b19c1d46df6 \ + file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://serpent-decrypt.c;beginline=14;endline=36;md5=ca0d220bc413e1842ecc507690ce416e \ + file://serpent-set-key.c;beginline=14;endline=36;md5=ca0d220bc413e1842ecc507690ce416e" + +DEPENDS += "gmp" + +SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \ + file://Add-target-to-only-build-tests-not-run-them.patch \ + file://run-ptest \ + file://check-header-files-of-openssl-only-if-enable_.patch \ + " + +SRC_URI_append_class-target = "\ + file://dlopen-test.patch \ + " + +SRC_URI[sha256sum] = "8d2a604ef1cde4cd5fb77e422531ea25ad064679ff0adf956e78b3352e0ef162" + +UPSTREAM_CHECK_REGEX = "nettle-(?P\d+(\.\d+)+)\.tar" + +inherit autotools ptest multilib_header + +EXTRA_AUTORECONF += "--exclude=aclocal" + +EXTRA_OECONF = "--disable-openssl" + +do_compile_ptest() { + oe_runmake buildtest +} + +do_install_append() { + oe_multilib_header nettle/version.h +} + +do_install_ptest() { + install -d ${D}${PTEST_PATH}/testsuite/ + install ${S}/testsuite/gold-bug.txt ${D}${PTEST_PATH}/testsuite/ + install ${S}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/ + # tools can be found in PATH, not in ../tools/ + sed -i -e 's|../tools/||' ${D}${PTEST_PATH}/testsuite/*-test + install ${B}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/ +} + +RDEPENDS_${PN}-ptest += "${PN}-dev" +INSANE_SKIP_${PN}-ptest += "dev-deps" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openbmc-mods/meta-common/recipes-utilities/i3c-tools/i3c-tools.bb b/meta-openbmc-mods/meta-common/recipes-utilities/i3c-tools/i3c-tools.bb index 2a857709b..89dbf1d68 100644 --- a/meta-openbmc-mods/meta-common/recipes-utilities/i3c-tools/i3c-tools.bb +++ b/meta-openbmc-mods/meta-common/recipes-utilities/i3c-tools/i3c-tools.bb @@ -2,7 +2,7 @@ SUMMARY = "i3c-tools" DESCRIPTION = "Set of tools to interact with i3c devices from user space" SRC_URI = "git://github.com/vitor-soares-snps/i3c-tools.git" -SRCREV = "2b37323d0de6265e5da3539f29fe34ac317e5b27" +SRCREV = "5d752038c72af8e011a2cf988b1476872206e706" S = "${WORKDIR}/git" diff --git a/meta-openbmc-mods/meta-common/recipes-x86/chassis/x86-power-control/0001-Extend-VR-Watchdog-timeout.patch b/meta-openbmc-mods/meta-common/recipes-x86/chassis/x86-power-control/0001-Extend-VR-Watchdog-timeout.patch index 61d3105b2..15de955c0 100644 --- a/meta-openbmc-mods/meta-common/recipes-x86/chassis/x86-power-control/0001-Extend-VR-Watchdog-timeout.patch +++ b/meta-openbmc-mods/meta-common/recipes-x86/chassis/x86-power-control/0001-Extend-VR-Watchdog-timeout.patch @@ -1,32 +1,32 @@ -From 9617412472669eef5d3ed66c05468646d8e8a951 Mon Sep 17 00:00:00 2001 +From 540836801f4ab5e8be9703d2c1350e988b2ccc1f Mon Sep 17 00:00:00 2001 From: "Jason M. Bills" Date: Thu, 11 Jun 2020 13:00:15 -0700 Subject: [PATCH] Extend VR Watchdog timeout The VR watchdog reset is causing issues on platforms such as Cooper City that take longer to assert CPU Power Good. This -extends the timeout to 15s to hold off the reset for Cooper +extends the timeout to 12s to hold off the reset for Cooper City. Change-Id: I9658b4ead6d9bf8eaa30e4aeb9f1d56c2f2187d3 Signed-off-by: Jason M. Bills --- - power-control-x86/src/power_control.cpp | 2 +- + power-control-x86/config/power-config-host0.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/power-control-x86/src/power_control.cpp b/power-control-x86/src/power_control.cpp -index b891c8c..b6ee6f1 100644 ---- a/power-control-x86/src/power_control.cpp -+++ b/power-control-x86/src/power_control.cpp -@@ -53,7 +53,7 @@ const static constexpr int powerPulseTimeMs = 200; - const static constexpr int forceOffPulseTimeMs = 15000; - const static constexpr int resetPulseTimeMs = 500; - const static constexpr int powerCycleTimeMs = 5000; --const static constexpr int sioPowerGoodWatchdogTimeMs = 1000; -+const static constexpr int sioPowerGoodWatchdogTimeMs = 12000; - const static constexpr int psPowerOKWatchdogTimeMs = 8000; - const static constexpr int gracefulPowerOffTimeMs = 60000; - const static constexpr int warmResetCheckTimeMs = 500; +diff --git a/power-control-x86/config/power-config-host0.json b/power-control-x86/config/power-config-host0.json +index ca9a86a..f579c2b 100644 +--- a/power-control-x86/config/power-config-host0.json ++++ b/power-control-x86/config/power-config-host0.json +@@ -18,7 +18,7 @@ + "ForceOffPulseMs": 15000, + "ResetPulseMs": 500, + "PowerCycleMs": 5000, +- "SioPowerGoodWatchdogMs": 1000, ++ "SioPowerGoodWatchdogMs": 12000, + "PsPowerOKWatchdogMs": 8000, + "GracefulPowerOffS": 300, + "WarmResetCheckMs": 500, -- -2.7.4 +2.17.1 diff --git a/meta-openbmc-mods/meta-common/recipes-x86/chassis/x86-power-control_%.bbappend b/meta-openbmc-mods/meta-common/recipes-x86/chassis/x86-power-control_%.bbappend index 26c96db24..93a32164d 100755 --- a/meta-openbmc-mods/meta-common/recipes-x86/chassis/x86-power-control_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-x86/chassis/x86-power-control_%.bbappend @@ -1,6 +1,6 @@ # Enable downstream autobump SRC_URI = "git://github.com/openbmc/x86-power-control.git;protocol=ssh" -SRCREV = "92caa4c639903ef076e2f09e985291781edd927d" +SRCREV = "afd04f0283bfc4854c0100c56ccf8bc1c10c799a" FILESEXTRAPATHS_append := "${THISDIR}/${PN}:" -- cgit v1.2.3