diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2020-11-17 00:51:01 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2020-11-17 01:37:09 +0300 |
commit | 18576aaaa49bf249aef0b72dd12fc452fccb6aed (patch) | |
tree | e3f3d79d24a0e6966b33fbdbbbecfe3bb2932efb /meta-openbmc-mods/meta-common/recipes-core | |
parent | 989cbcf37fea988ef6b76b9bc1cc5774bacda2cf (diff) | |
download | openbmc-18576aaaa49bf249aef0b72dd12fc452fccb6aed.tar.xz |
Update to internal 0.74-155
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-core')
7 files changed, 300 insertions, 1 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-core/crashdump/crashdump_git.bb b/meta-openbmc-mods/meta-common/recipes-core/crashdump/crashdump_git.bb index ae6303668..b603cdefe 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/crashdump/crashdump_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-core/crashdump/crashdump_git.bb @@ -13,7 +13,7 @@ LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://LICENSE;md5=43c09494f6b77f344027eea0a1c22830" SRC_URI = "git://github.com/Intel-BMC/crashdump;protocol=git" -SRCREV = "wht-1.0" +SRCREV = "wht-1.0.4" S = "${WORKDIR}/git" diff --git a/meta-openbmc-mods/meta-common/recipes-core/dhcp-check/dhcp-check/dhcp-check.service b/meta-openbmc-mods/meta-common/recipes-core/dhcp-check/dhcp-check/dhcp-check.service new file mode 100644 index 000000000..f32935a7f --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/dhcp-check/dhcp-check/dhcp-check.service @@ -0,0 +1,10 @@ +[Unit] +Description=Check for DHCP address +After=network.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/dhcp-check.sh + +[Install] +WantedBy=multi-user.target diff --git a/meta-openbmc-mods/meta-common/recipes-core/dhcp-check/dhcp-check/dhcp-check.sh b/meta-openbmc-mods/meta-common/recipes-core/dhcp-check/dhcp-check/dhcp-check.sh new file mode 100644 index 000000000..e2ee80d89 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/dhcp-check/dhcp-check/dhcp-check.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +# if eth0 is configured DHCP and the interface is up (has carrier) and there is +# no IP address after 2 mins, restart the interface to try again + +LOG_TAG=dhcp-check +CHK_DELAY=120 +CFG_DELAY=60 +IFC=eth0 +NETWORK_CONFIG=/etc/systemd/network/00-bmc-${IFC}.network + +carrier=$(cat /sys/class/net/${IFC}/carrier 2>/dev/null) +if [[ "$carrier" == "1" ]]; then + dhcp=$(egrep -c "DHCP=(true|ipv4)" $NETWORK_CONFIG) + if [[ "$dhcp" != "0" ]]; then + # Give time for DHCP address to be configured + sleep $CHK_DELAY + + hasip=$(ip addr show dev ${IFC} | grep -c dynamic) + if [[ "$hasip" == "0" ]]; then + logger -t $LOG_TAG \ + "$IFC: No DHCP address after ${CHK_DELAY}s; reconfigure" + networkctl reconfigure $IFC + + # give time for network to come up and acquire DHCP address + sleep $CFG_DELAY + fi + + IP=$(ip addr show dev ${IFC} | sed -n '/dynamic/s/^.*inet \([0-9\.]*\).*$/\1/p') + logger -t $LOG_TAG "$IFC: DHCP address $IP" + fi +fi + +exit 0 diff --git a/meta-openbmc-mods/meta-common/recipes-core/dhcp-check/dhcp-check_git.bb b/meta-openbmc-mods/meta-common/recipes-core/dhcp-check/dhcp-check_git.bb new file mode 100644 index 000000000..19ee407d7 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/dhcp-check/dhcp-check_git.bb @@ -0,0 +1,22 @@ +SUMMARY = "DHCP Check" +DESCRIPTION = "Script to check and restart network interface if DHCP fails to get an address" + +S = "${WORKDIR}" +SRC_URI = "file://dhcp-check.sh \ + file://dhcp-check.service \ +" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" +RDEPENDS_${PN} += "bash" + +inherit obmc-phosphor-systemd + +FILES_${PN} += "${systemd_system_unitdir}/dhcp-check.service" + +do_install() { + install -d ${D}${bindir} + install -m 0755 ${S}/dhcp-check.sh ${D}/${bindir}/dhcp-check.sh +} + +SYSTEMD_SERVICE_${PN} += " dhcp-check.service" diff --git a/meta-openbmc-mods/meta-common/recipes-core/ipmi/intel-ipmi-oem/0006-Update-Product-ID-for-EEPROM-FRU-platforms.patch b/meta-openbmc-mods/meta-common/recipes-core/ipmi/intel-ipmi-oem/0006-Update-Product-ID-for-EEPROM-FRU-platforms.patch new file mode 100644 index 000000000..93dcc1c33 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/ipmi/intel-ipmi-oem/0006-Update-Product-ID-for-EEPROM-FRU-platforms.patch @@ -0,0 +1,230 @@ +From a9899d878d49c5d37810f2d97a68ae9d1de1a390 Mon Sep 17 00:00:00 2001 +From: Anoop S <anoopx.s@intel.com> +Date: Fri, 2 Oct 2020 13:32:05 +0000 +Subject: [PATCH] Update Product ID for EEPROM FRU platforms. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Update Product ID based on property found in boards json config file, +once entity-manager starts exposing it. + +This will be one-time update to ‘prodID’ file after dediprog flashing. +This will be common logic for all baseboard EEPROM FRU platforms. +This logic won't get effected for non-EEPROM FRU platfroms as its Product ID +is already non-zero. + +Tested-by: +1. Dediprog and redfish flash a platform (baseboard FRU platform type) + - System up and running. + - ‘Product ID’ is properly updated in ‘prodID’ file and working fine. +2. Dediprog and redfish flash a platform.(filesystem FRU platform type) + - System up and running. + - Non-zero ‘Product ID’ in ‘prodID’ file is not modified by new logic + and working fine. +3. Negative TestCase: The FRU is corrupted and tested. + - ‘Product ID’ value of 0x00 is remained in ‘prodID’ file, and same + will go in GetDeviceId() response. +4. Negative TestCase: If ‘Product ID’ update failed or EntityManager + service not started before ipmiAppGetDeviceId() is invoked. + - ‘Product ID’ value of 0x00 is remained in ‘prodID’ file, and same + will go in GetDeviceId() response. + +Signed-off-by: Anoop S <anoopx.s@intel.com> +Signed-off-by: Saravanan Palanisamy <saravanan.palanisamy@linux.intel.com> +--- + src/appcommands.cpp | 137 ++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 131 insertions(+), 6 deletions(-) + +diff --git a/src/appcommands.cpp b/src/appcommands.cpp +index 10e3d13..d5b5c50 100644 +--- a/src/appcommands.cpp ++++ b/src/appcommands.cpp +@@ -16,6 +16,7 @@ + #include <byteswap.h> + + #include <appcommands.hpp> ++#include <boost/algorithm/string/predicate.hpp> + #include <ipmid/api.hpp> + #include <ipmid/utils.hpp> + #include <nlohmann/json.hpp> +@@ -45,6 +46,11 @@ static constexpr const char* bmcStateReadyStr = + + static std::unique_ptr<sdbusplus::bus::match::match> bmcStateChangedSignal; + static uint8_t bmcDeviceBusy = true; ++std::unique_ptr<sdbusplus::bus::match::match> baseBoardUpdatedSignal; ++static constexpr const char* prodIdFilename = "/var/cache/private/prodID"; ++static constexpr const char* baseBoardIntf = ++ "xyz.openbmc_project.Inventory.Item.Board.Motherboard"; ++static uint16_t productId; + + int initBMCDeviceState(ipmi::Context::ptr ctx) + { +@@ -286,7 +292,6 @@ RspType<uint8_t, // Device ID + static bool devIdInitialized = false; + static bool bmcStateInitialized = false; + const char* filename = "/usr/share/ipmi-providers/dev_id.json"; +- const char* prodIdFilename = "/var/cache/private/prodID"; + if (!fwVerInitialized) + { + std::string versionString; +@@ -351,13 +356,13 @@ RspType<uint8_t, // Device ID + // boot time. Avoid using DBus to get the Product ID. The Product ID is + // stored in a non-volatile file now. The /usr/bin/checkFru.sh script, + // run during bootup, will populate the productIdFile. +- std::fstream prodIdFile(prodIdFilename); ++ std::fstream prodIdFile(prodIdFilename, std::ios::in); + if (prodIdFile.is_open()) + { +- std::string id = "0x00"; +- char* end; +- prodIdFile.getline(&id[0], id.size() + 1); +- devId.prodId = std::strtol(&id[0], &end, 0); ++ uint16_t id = 0x00; ++ // id will become 0xFFFF (Reserved) if prodIdFile has invalid data. ++ prodIdFile >> std::hex >> id; ++ devId.prodId = id; + devIdInitialized = true; + } + else +@@ -377,17 +382,137 @@ RspType<uint8_t, // Device ID + } + } + ++ // Update the productId, if required. ++ if (!devId.prodId && productId) ++ { ++ devId.prodId = productId; ++ baseBoardUpdatedSignal.reset(); ++ } + return ipmi::responseSuccess(devId.id, devId.revision, devId.fwMajor, + bmcDeviceBusy, devId.fwMinor, devId.ipmiVer, + devId.addnDevSupport, devId.manufId, + devId.prodId, devId.aux); + } + ++static void getProductId(const std::string& baseboardObjPath) ++{ ++ // Get the Baseboard object to find the Product id ++ constexpr std::chrono::microseconds IPMI_DBUS_TIMEOUT = 30s; ++ uint16_t propertyIdRead; ++ ++ try ++ { ++ std::shared_ptr<sdbusplus::asio::connection> dbus = getSdBus(); ++ std::string service = ++ getService(*dbus, baseBoardIntf, baseboardObjPath); ++ ipmi::Value property = ++ getDbusProperty(*dbus, service, baseboardObjPath, baseBoardIntf, ++ "ProductId", IPMI_DBUS_TIMEOUT); ++ propertyIdRead = static_cast<uint16_t>(std::get<uint64_t>(property)); ++ } ++ ++ catch (std::exception& ec) ++ { ++ phosphor::logging::log<phosphor::logging::level::ERR>( ++ "dbus call failed in getProductId", ++ phosphor::logging::entry("ERROR=%s", ec.what())); ++ return; ++ } ++ std::fstream prodIdFile(prodIdFilename, std::ios::in | std::ios::out); ++ if (prodIdFile.is_open()) ++ { ++ uint16_t id = 0xFF; ++ prodIdFile >> std::hex >> id; ++ if (id == 0) ++ { ++ prodIdFile.seekp(0); ++ prodIdFile << "0x" << std::hex << propertyIdRead << std::endl; ++ productId = propertyIdRead; ++ } ++ } ++} ++ ++static void getProductIdFromBoard() ++{ ++ // If Product ID is already non-zero, just return. ++ std::fstream prodIdFile(prodIdFilename, std::ios::in); ++ if (prodIdFile.is_open()) ++ { ++ uint16_t id = 0xFF; ++ prodIdFile >> std::hex >> id; ++ if (id != 0) ++ { ++ return; ++ } ++ } ++ ++ // Register signal handler callback, 'baseBoardUpdatedSignal'. ++ namespace rules = sdbusplus::bus::match::rules; ++ const std::string filterStrPostIntfAdd = ++ rules::interfacesAdded() + ++ rules::argNpath(0, "/xyz/openbmc_project/inventory/system/board/"); ++ ++ auto callback = [](sdbusplus::message::message& m) { ++ sdbusplus::message::object_path objPath; ++ boost::container::flat_map< ++ std::string, boost::container::flat_map< ++ std::string, std::variant<std::string, uint64_t>>> ++ msgData; ++ m.read(objPath, msgData); ++ const auto intfFound = msgData.find(baseBoardIntf); ++ if (intfFound != msgData.cend()) ++ { ++ getProductId(objPath.str); ++ return; ++ } ++ }; ++ std::shared_ptr<sdbusplus::asio::connection> bus = getSdBus(); ++ baseBoardUpdatedSignal = std::make_unique<sdbusplus::bus::match::match>( ++ static_cast<sdbusplus::bus::bus&>(*bus), filterStrPostIntfAdd, ++ callback); ++ ++ // Try by async_method_call() once by querying ObjectMapper. ++ bus->async_method_call( ++ [](boost::system::error_code ec, std::vector<std::string>& subtree) { ++ if (ec) ++ { ++ phosphor::logging::log<phosphor::logging::level::ERR>( ++ "dbus call failed in getSubTree of board interface.", ++ phosphor::logging::entry("ERROR=%s", ec.message().c_str())); ++ return; ++ } ++ baseBoardUpdatedSignal.reset(); ++ const std::string match = "board"; ++ for (const std::string& objpath : subtree) ++ { ++ // Iterate over all retrieved ObjectPaths. ++ if (!boost::ends_with(objpath, match)) ++ { ++ // Just move to next path. ++ continue; ++ } ++ ++ // Baseboard object path found ++ getProductId(objpath); ++ return; ++ } ++ }, ++ "xyz.openbmc_project.ObjectMapper", ++ "/xyz/openbmc_project/object_mapper", ++ "xyz.openbmc_project.ObjectMapper", "GetSubTreePaths", ++ "/xyz/openbmc_project/inventory", 0, ++ std::array<const char*, 1>{baseBoardIntf}); ++ ++ return; ++} ++ + static void registerAPPFunctions(void) + { + // <Get Device ID> + registerHandler(prioOemBase, netFnApp, app::cmdGetDeviceId, Privilege::User, + ipmiAppGetDeviceId); ++ // Get Product ID from BaseBoard.json, if required. ++ getProductIdFromBoard(); + } + + } // namespace ipmi +-- +2.17.1 + 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 75ecb2bd4..5bbf35e70 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 @@ -12,4 +12,5 @@ SRC_URI += "file://0001-Fix-cold-redundancy-is-not-runing-as-user-configurat.pat file://0003-storagecommands-Fix-for-GetFruAreaInfo-command.patch \ file://0004-firmware-update-Add-Support-to-get-fwSecurityVer.patch \ file://0005-oemcommands-Fix-for-set-security-mode-to-mfg-mode.patch \ + file://0006-Update-Product-ID-for-EEPROM-FRU-platforms.patch \ " diff --git a/meta-openbmc-mods/meta-common/recipes-core/os-release/os-release.bbappend b/meta-openbmc-mods/meta-common/recipes-core/os-release/os-release.bbappend index a47d923f8..ba95727b4 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/os-release/os-release.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-core/os-release/os-release.bbappend @@ -9,6 +9,8 @@ require version-vars.inc OS_RELEASE_FIELDS_append = " OPENBMC_VERSION IPMI_MAJOR IPMI_MINOR IPMI_AUX13 IPMI_AUX14 IPMI_AUX15 IPMI_AUX16" +OS_RELEASE_FIELDS_remove = "BUILD_ID" + python do_compile_append () { import glob with open(d.expand('${B}/os-release'), 'a') as f: |