diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2019-10-23 00:01:54 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2019-10-23 00:48:48 +0300 |
commit | 456380bb272d3a301c887eee513a3937cc1f48e1 (patch) | |
tree | 124399167d539582befbe35ad28377eaea6cc8bc /meta-openbmc-mods/meta-common/recipes-core | |
parent | 9722c6ee87766a45a337c094d1293de81cdcb106 (diff) | |
download | openbmc-456380bb272d3a301c887eee513a3937cc1f48e1.tar.xz |
Update to internal 10-22-19
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-core')
33 files changed, 729 insertions, 269 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/at-scale-debug_git.bb b/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/at-scale-debug_git.bb index 170f41a94..1c0a5f73a 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/at-scale-debug_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-core/at-scale-debug/at-scale-debug_git.bb @@ -8,12 +8,12 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=0d1c657b2ba1e8877940a8d1614ec560" inherit cmake -DEPENDS = "sdbusplus openssl libpam" +DEPENDS = "sdbusplus openssl libpam libgpiod" do_configure[depends] += "virtual/kernel:do_shared_workdir" -SRC_URI = "git://git@github.com/Intel-BMC/asd;protocol=ssh;nobranch=1" -SRCREV = "73d4cc11b859ba91f313a7bb85f2dbb26e36d0ee" +SRC_URI = "git://git@github.com/Intel-BMC/asd;protocol=ssh" +SRCREV = "bcc326ea6968ac002bb10b5bc848368d957ba049" S = "${WORKDIR}/git" 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 68a548b02..2d1b5cf29 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 @@ -4,7 +4,7 @@ inherit obmc-phosphor-systemd SUMMARY = "CPU Crashdump" DESCRIPTION = "CPU utilities for dumping CPU Crashdump and registers over PECI" -DEPENDS = "boost cjson sdbusplus safec gtest " +DEPENDS = "boost cjson sdbusplus safec gtest libpeci" inherit cmake EXTRA_OECMAKE = "-DCRASHDUMP_BUILD_UT=ON" @@ -12,11 +12,10 @@ EXTRA_OECMAKE = "-DCRASHDUMP_BUILD_UT=ON" LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://LICENSE;md5=26bb6d0733830e7bab774914a8f8f20a" -SRC_URI = "git://git@github.com/Intel-BMC/crashdump;protocol=ssh;nobranch=1" -SRCREV = "c99e4fb7727545501fe65b90a8a97e84d469d45e" +SRC_URI = "git://git@github.com/Intel-BMC/crashdump;protocol=ssh" +SRCREV = "eda3478a6db7b2f09bb74fd109552c433c885731" S = "${WORKDIR}/git" -PACKAGES += "libpeci" SYSTEMD_SERVICE_${PN} += "com.intel.crashdump.service" DBUS_SERVICE_${PN} += "com.intel.crashdump.service" diff --git a/meta-openbmc-mods/meta-common/recipes-core/fw-update/files/fwupd.sh b/meta-openbmc-mods/meta-common/recipes-core/fw-update/files/fwupd.sh index dd3b7f69a..889a73c06 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/fw-update/files/fwupd.sh +++ b/meta-openbmc-mods/meta-common/recipes-core/fw-update/files/fwupd.sh @@ -73,6 +73,74 @@ if [ ! -e $LOCAL_PATH ] || [ $(stat -c %s $LOCAL_PATH) -eq 0 ]; then esac fi +# PFR image update section +# this file being created at build time for PFR images +if [ -e /usr/share/pfr ] +then +# read the image type from the uploaded image +# Byte at location 0x8 gives image type +img_type=$(hexdump -s 8 -n 1 $LOCAL_PATH | cut -b12,1 | sed '2d;') +echo "image-type=$img_type" + +# BMC image - max size 32MB +if [ "$img_type" = '04' ]; then + echo "BMC firmware image" + # 32MB - 33554432 + img_size=33554432 + upd_intent_val=0x08 + # page is at 4KB boundary + img_page_offset=0 + erase_offset=0 + blk_cnt=0x200 +# CPLD image- max size 4MB +elif [ "$img_type" = '00' ]; then + echo "CPLD firmware image" + # 4MB - 4194304 + img_size=4194304 + upd_intent_val=0x04 + # dd command accepts the offset in decimal + # below is the page offset in 4KB boundary + img_page_offset=12288 + erase_offset=0x3000000 + blk_cnt=0x40 +# BIOS image- max size 16MB +elif [ "$img_type" = '02' ]; then + echo "BIOS firmware image" + # 16MB- 16777216 + img_size=16777216 + upd_intent_val=0x01 + # dd command accepts the offset in decimal + # below is the page offset in 4KB boundary + img_page_offset=8192 + erase_offset=0x2000000 + blk_cnt=0x100 +else + echo "${img_type}:Unknown image type, exiting the firmware update script" + exit 1 +fi + +# do a quick sanity check on the image +if [ $(stat -c "%s" "$LOCAL_PATH") -gt $img_size ]; then + echo "Update file "$LOCAL_PATH" is bigger than the supported image size" + exit 1 +fi + +TGT="/dev/mtd/image-stg" +echo "Updating $(basename $TGT)" +flash_erase $TGT $erase_offset $blk_cnt +echo "Writing $(stat -c "%s" "$LOCAL_PATH") bytes" +# cat "$LOCAL_PATH" > "$TGT" +dd bs=4k seek=$img_page_offset if=$LOCAL_PATH of=$TGT +sync +echo "Written $(stat -c "%s" "$LOCAL_PATH") bytes" +# remove the updated image from /tmp +rm -f $LOCAL_PATH +echo "Setting update intent in PFR CPLD" +sleep 5 # delay for sync and to get the above echo messages +# write to PFRCPLD about BMC update intent. +i2cset -y 4 0x70 0x13 $upd_intent_val + +else # Non-PFR image update section # do a quick sanity check on the image if [ $(stat -c "%s" "$LOCAL_PATH") -lt 10000000 ]; then echo "Update file "$LOCAL_PATH" seems to be too small" @@ -84,18 +152,6 @@ if [ $? -ne 0 ]; then exit 1 fi -#this file being created at build time for PFR images -#TODO: Need to do runtime detection of PFR platform -#TODO: Also to check if PFR is provisioned or not -if [ -e /usr/share/pfr ] -then -TGT="/dev/mtd/image-stg" -echo "Updating $(basename $TGT)" -flash_erase $TGT 0 0 -echo "Writing $(stat -c "%s" "$LOCAL_PATH") bytes" -cat "$LOCAL_PATH" > "$TGT" -#TODO: Add I2C command to write to PFRCPLD about BMC update intent. -else # guess based on fw_env which partition we booted from BOOTADDR=$(fw_printenv bootcmd | awk '{print $2}') diff --git a/meta-openbmc-mods/meta-common/recipes-core/fw-update/intel-fw-update.bb b/meta-openbmc-mods/meta-common/recipes-core/fw-update/intel-fw-update.bb index d7595696e..7c994053e 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/fw-update/intel-fw-update.bb +++ b/meta-openbmc-mods/meta-common/recipes-core/fw-update/intel-fw-update.bb @@ -7,7 +7,7 @@ RDEPENDS_intel-fw-update += "mtd-utils" # wget tftp scp RDEPENDS_intel-fw-update += "busybox dropbear" # mkfs.vfat, parted -RDEPENDS_intel-fw-update += "dosfstools parted" +RDEPENDS_intel-fw-update += "dosfstools" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" diff --git a/meta-openbmc-mods/meta-common/recipes-core/host-error-monitor/host-error-monitor_git.bb b/meta-openbmc-mods/meta-common/recipes-core/host-error-monitor/host-error-monitor_git.bb index 483a9bf12..8556f3310 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/host-error-monitor/host-error-monitor_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-core/host-error-monitor/host-error-monitor_git.bb @@ -2,13 +2,20 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" inherit cmake systemd -SRC_URI = "git://git@github.com/Intel-BMC/at-scale-debug;protocol=ssh" +SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh" -DEPENDS = "boost sdbusplus libgpiod" +DEPENDS = "boost sdbusplus libgpiod libpeci" PV = "0.1+git${SRCPV}" -SRCREV = "6ed87657134c7379da1febcccd5d87617c702347" +SRCREV = "30110fe5b18999bddc5721dc5611f542f6feeabd" S = "${WORKDIR}/git/host_error_monitor" SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.HostErrorMonitor.service" + +# linux-libc-headers guides this way to include custom uapi headers +CFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include/uapi" +CFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include" +CXXFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include/uapi" +CXXFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include" +do_configure[depends] += "virtual/kernel:do_shared_workdir" diff --git a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Add-smbus-support-to-Cmake-Lists.patch b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Add-smbus-support-to-Cmake-Lists.patch deleted file mode 100644 index 8bb9ce485..000000000 --- a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Add-smbus-support-to-Cmake-Lists.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 21f2f29129a7eba8aecdf07875004bafc6a74269 Mon Sep 17 00:00:00 2001 -From: James Feist <james.feist@linux.intel.com> -Date: Thu, 20 Jun 2019 08:58:44 -0700 -Subject: [PATCH] Add smbus support to Cmake Lists - -This adds smbus changes needed for libmctp. - -Change-Id: I06fc950337e6f3d5b1cef0fb445be2d448d49e44 -Signed-off-by: James Feist <james.feist@linux.intel.com> ---- - CMakeLists.txt | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a5b1042..04c4bdf 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -3,7 +3,7 @@ cmake_minimum_required (VERSION 3.5 FATAL_ERROR) - add_definitions (-DMCTP_LOG_STDERR) - add_definitions (-DMCTP_FILEIO) - --add_library (libmctp STATIC alloc.c core.c log.c libmctp.h serial.c) -+add_library (libmctp STATIC alloc.c core.c log.c libmctp.h serial.c smbus.c) - - target_include_directories (libmctp PUBLIC - $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> -@@ -18,5 +18,5 @@ add_executable (test_seq tests/test_seq.c tests/test-utils.c) - target_link_libraries (test_seq libmctp) - - install (TARGETS libmctp DESTINATION lib) --install (FILES libmctp.h DESTINATION include) -+install (FILES libmctp.h libmctp-smbus.h libmctp-serial.h DESTINATION include) - --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Smbus-changes-for-libmctp.patch b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Smbus-changes-for-libmctp.patch new file mode 100644 index 000000000..e456c10ad --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/0001-Smbus-changes-for-libmctp.patch @@ -0,0 +1,148 @@ +From cb330f4bf1f519032ee50d60f473c28df7b772d8 Mon Sep 17 00:00:00 2001 +From: Nikhil Potade <nikhil.potade@linux.intel.com> +Date: Tue, 19 Feb 2019 14:16:20 +0800 +Subject: [PATCH] Smbus changes for libmctp + +--- + CMakeLists.txt | 6 ++++-- + core.c | 2 ++ + libmctp.h | 40 ++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 46 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a5b1042..249b12b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,8 +2,9 @@ cmake_minimum_required (VERSION 3.5 FATAL_ERROR) + + add_definitions (-DMCTP_LOG_STDERR) + add_definitions (-DMCTP_FILEIO) ++add_definitions (-DMCTP_DEFAULT_ALLOC) + +-add_library (libmctp STATIC alloc.c core.c log.c libmctp.h serial.c) ++add_library (libmctp STATIC alloc.c core.c log.c libmctp.h serial.c smbus.c crc32c.c) + + target_include_directories (libmctp PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> +@@ -18,5 +19,6 @@ add_executable (test_seq tests/test_seq.c tests/test-utils.c) + target_link_libraries (test_seq libmctp) + + install (TARGETS libmctp DESTINATION lib) +-install (FILES libmctp.h DESTINATION include) ++install (FILES libmctp.h libmctp-smbus.h libmctp-serial.h crc32c.h DESTINATION ++ include) + +diff --git a/core.c b/core.c +index b855ced..8be7407 100644 +--- a/core.c ++++ b/core.c +@@ -17,6 +17,7 @@ + + /* Internal data structures */ + ++/* clang-format off */ + struct mctp_bus { + mctp_eid_t eid; + struct mctp_binding *binding; +@@ -50,6 +51,7 @@ struct mctp { + */ + struct mctp_msg_ctx msg_ctxs[16]; + }; ++/* clang-format on */ + + #ifndef BUILD_ASSERT + #define BUILD_ASSERT(x) \ +diff --git a/libmctp.h b/libmctp.h +index f0633e3..cec7c00 100644 +--- a/libmctp.h ++++ b/libmctp.h +@@ -15,6 +15,7 @@ extern "C" { + typedef uint8_t mctp_eid_t; + + /* MCTP packet definitions */ ++/* clang-format off */ + struct mctp_hdr { + uint8_t ver; + uint8_t dest; +@@ -30,12 +31,47 @@ struct mctp_hdr { + #define MCTP_HDR_SEQ_MASK (0x3) + #define MCTP_HDR_TAG_SHIFT (0) + #define MCTP_HDR_TAG_MASK (0x7) ++/* clang-format on */ + + /* Maximum size of *payload* data in a MCTP packet + * @todo: dynamic sixing based on channel implementation. + */ + #define MCTP_MTU 64 + ++#define MCTP_CONTROL_MESSAGE_TYPE 0x00 ++ ++enum MCTP_COMMAND_CODE { ++ MCTP_COMMAND_CODE_SET_EID = 0x01, ++ MCTP_COMMAND_CODE_GET_EID = 0x02, ++ MCTP_COMMAND_CODE_GET_ENDPOINT_UUID = 0x03, ++ MCTP_COMMAND_CODE_GET_MCTP_VERSION_SUPPORT = 0x04, ++ MCTP_COMMAND_CODE_GET_MESSAGE_TYPE_SUPPORT = 0x05, ++ MCTP_COMMAND_CODE_GET_VENDOR_DEFINED_MSG_SUPPORT= 0x06, ++ MCTP_COMMAND_CODE_RESOLVE_ENDPOINT_ID = 0x07, ++ MCTP_COMMAND_CODE_ALLOCATE_ENDPOINT_IDS = 0x08, ++ MCTP_COMMAND_CODE_ROUTING_INFORMATION_UPDATE = 0x09, ++ MCTP_COMMAND_CODE_GET_ROUTING_TABLE_ENTRIES = 0x0A, ++ MCTP_COMMAND_CODE_PREPARE_FOR_ENDPOINT_DISCOVERY= 0x0B, ++ MCTP_COMMAND_CODE_ENDPOINT_DISCOVERY = 0x0C, ++ MCTP_COMMAND_CODE_DISCOVERY_NOTIFY = 0x0D, ++ MCTP_COMMAND_CODE_GET_NETWORK_ID = 0x0E, ++ MCTP_COMMAND_CODE_QUERY_HOP = 0x0F, ++ MCTP_COMMAND_CODE_RESOLVE_UUID = 0x10, ++ MCTP_COMMAND_CODE_QUERY_RATE_LIMIT = 0x11, ++ MCTP_COMMAND_CODE_REQUEST_TX_RATE_LIMIT = 0x12, ++ MCTP_COMMAND_CODE_UPDATE_RATE_LIMIT = 0x13, ++ MCTP_COMMAND_CODE_QUERY_SUPPORTED_INTERFACES = 0x14 ++}; ++ ++enum MCTP_CONTROL_MSG_COMPLETION_CODE { ++ MCTP_CONTROL_MSG_STATUS_SUCCESS = 0x00, ++ MCTP_CONTROL_MSG_STATUS_ERROR = 0x01, ++ MCTP_CONTROL_MSG_STATUS_ERROR_INVALID_DATA = 0x02, ++ MCTP_CONTROL_MSG_STATUS_ERROR_INVALID_LENGTH = 0x03, ++ MCTP_CONTROL_MSG_STATUS_ERROR_NOT_READY = 0x04, ++ MCTP_CONTROL_MSG_STATUS_ERROR_UNSUPPORTED_CMD = 0x05 ++}; ++ + /* packet buffers */ + + /* Allow a little space before the MCTP header in the packet, for bindings that +@@ -46,12 +82,14 @@ struct mctp_hdr { + #define MCTP_PKTBUF_SIZE (MCTP_PKTBUF_BINDING_PAD + \ + (sizeof(struct mctp_hdr) + MCTP_MTU)) + ++/* clang-format off */ + struct mctp_pktbuf { + unsigned char data[MCTP_PKTBUF_SIZE]; + uint8_t start, end; + uint8_t mctp_hdr_off; + struct mctp_pktbuf *next; + }; ++/* clang-format on */ + + struct mctp_pktbuf *mctp_pktbuf_alloc(uint8_t len); + void mctp_pktbuf_free(struct mctp_pktbuf *pkt); +@@ -85,6 +123,7 @@ int mctp_message_tx(struct mctp *mctp, mctp_eid_t eid, + void *msg, size_t msg_len); + + /* hardware bindings */ ++/* clang-format off */ + struct mctp_binding { + const char *name; + uint8_t version; +@@ -93,6 +132,7 @@ struct mctp_binding { + int (*tx)(struct mctp_binding *binding, + struct mctp_pktbuf *pkt); + }; ++/* clang-format on */ + + void mctp_binding_set_tx_enabled(struct mctp_binding *binding, bool enable); + +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/crc32c.h b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/crc32c.h index d6b1d11e2..4586547e6 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/crc32c.h +++ b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/crc32c.h @@ -1,9 +1,16 @@ #ifndef CRC32C_H #define CRC32C_H +#ifdef __cplusplus +extern "C" { +#endif + #include <stdint.h> #include <stdlib.h> uint32_t crc32c(uint8_t *buf, int len); +#ifdef __cplusplus +} +#endif #endif /* CRC32C_H */ diff --git a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/libmctp-smbus.h b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/libmctp-smbus.h index b3beadb0c..5ecaa6b74 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/libmctp-smbus.h +++ b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/libmctp-smbus.h @@ -3,6 +3,10 @@ #ifndef _LIBMCTP_SMBUS_H #define _LIBMCTP_SMBUS_H +#ifdef __cplusplus +extern "C" { +#endif + #include "libmctp.h" struct mctp_binding_smbus; @@ -15,4 +19,9 @@ void mctp_smbus_register_bus(struct mctp_binding_smbus *smbus, int mctp_smbus_read(struct mctp_binding_smbus *smbus); int mctp_smbus_open_bus(struct mctp_binding_smbus *smbus, int out_bus_num, int root_bus_num); +void mctp_smbus_free(struct mctp_binding_smbus *smbus); + +#ifdef __cplusplus +} +#endif #endif /* _LIBMCTP_SMBUS_H */ diff --git a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/smbus.c b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/smbus.c index 8679a5185..d7c396444 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/smbus.c +++ b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp/smbus.c @@ -2,6 +2,7 @@ #include <assert.h> #include <stdbool.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> @@ -24,7 +25,6 @@ struct mctp_binding_smbus { struct mctp_binding binding; - struct mctp *mctp; int out_fd; int in_fd; @@ -50,6 +50,8 @@ struct mctp_binding_smbus { #define MCTP_SOURCE_SLAVE_ADDRESS 0x21 #define SMBUS_PEC_BYTE_SIZE 1 +#define SMBUS_COMMAND_CODE_SIZE 1 +#define SMBUS_LENGTH_FIELD_SIZE 1 struct mctp_smbus_header_tx { uint8_t source_slave_address; @@ -62,54 +64,133 @@ struct mctp_smbus_header_rx { uint8_t source_slave_address; }; +#define POLYCHECK (0x1070U << 3) +static uint8_t crc8_calculate(uint16_t d) +{ + int i; + + for (i = 0; i < 8; i++) { + if (d & 0x8000) { + d = d ^ POLYCHECK; + } + d = d << 1; + } + + return (uint8_t)(d >> 8); +} + +/* Incremental CRC8 over count bytes in the array pointed to by p */ +static uint8_t pec_calculate(uint8_t crc, uint8_t *p, size_t count) +{ + int i; + + for (i = 0; i < count; i++) { + crc = crc8_calculate((crc ^ p[i]) << 8); + } + + return crc; +} + +static uint8_t calculate_pec_byte(uint8_t *buf, size_t len, uint8_t address, + uint16_t flags) +{ + uint8_t addr = (address << 1) | (flags & I2C_M_RD ? 1 : 0); + uint8_t pec = pec_calculate(0, &addr, 1); + pec = pec_calculate(pec, buf, len); + + return pec; +} + +static int mctp_smbus_tx(struct mctp_binding_smbus *smbus, uint8_t len) +{ + +#ifdef I2C_M_HOLD + /* Hold message */ + static uint16_t holdtimeout = 1000; // timeout in ms. + struct i2c_msg msg[2] = +#else // !I2C_M_HOLD + struct i2c_msg msg[1] = +#endif // I2C_M_HOLD + {{.addr = MCTP_SLAVE_ADDRESS, + .flags = 0, + .len = len, + .buf = (__uint8_t *)smbus->txbuf} +#ifdef I2C_M_HOLD + , + {.addr = 0, + .flags = I2C_M_HOLD, + .len = sizeof(holdtimeout), + .buf = (__uint8_t *)&holdtimeout} +#endif // I2C_M_HOLD + }; + +#ifdef I2C_M_HOLD + struct i2c_rdwr_ioctl_data msgrdwr = {&msg, 2}; +#else // !I2C_M_HOLD + struct i2c_rdwr_ioctl_data msgrdwr = {&msg, 1}; +#endif // I2C_M_HOLD + + return ioctl(smbus->out_fd, I2C_RDWR, &msgrdwr); +} + +#ifdef I2C_M_HOLD +static int mctp_smbus_unhold_bus(struct mctp_binding_smbus *smbus) +{ + /* Unhold message */ + static uint16_t holdtimeout = 0; // unhold + struct i2c_msg holdmsg = {0, I2C_M_HOLD, sizeof(holdtimeout), + (__uint8_t *)&holdtimeout}; + + struct i2c_rdwr_ioctl_data msgrdwr = {&holdmsg, 1}; + + return ioctl(smbus->out_fd, I2C_RDWR, &msgrdwr); +} +#endif // I2C_M_HOLD + static int mctp_binding_smbus_tx(struct mctp_binding *b, struct mctp_pktbuf *pkt) { struct mctp_binding_smbus *smbus = binding_to_smbus(b); struct mctp_smbus_header_tx *hdr; - uint8_t *buf; - size_t len; - int r; - struct i2c_msg msg; - struct i2c_rdwr_ioctl_data data; + size_t pkt_length; - data.msgs = &msg; - data.nmsgs = 1; + uint8_t i2c_message_buf[256]; + uint8_t *buf_ptr; + uint8_t i2c_message_len; uint16_t timeout = 1000; - int i; /* the length field in the header excludes smbus framing * and escape sequences */ - len = mctp_pktbuf_size(pkt); + pkt_length = mctp_pktbuf_size(pkt); - hdr = (void *)smbus->txbuf; + buf_ptr = (void *)smbus->txbuf; + *buf_ptr = MCTP_COMMAND_CODE; + buf_ptr++; + *buf_ptr = pkt_length + sizeof(*hdr); + buf_ptr++; - // hdr->len = len + 1; // +1 for PET byte + hdr = (void *)buf_ptr; hdr->source_slave_address = MCTP_SOURCE_SLAVE_ADDRESS; + buf_ptr = (buf_ptr + sizeof(*hdr)); + memcpy(buf_ptr, &pkt->data[pkt->start], pkt_length); + buf_ptr = buf_ptr + pkt_length; - buf = (void *)(hdr + sizeof(*hdr)); + uint8_t pec_byte = calculate_pec_byte( + smbus->txbuf, + SMBUS_COMMAND_CODE_SIZE + SMBUS_LENGTH_FIELD_SIZE + sizeof(*hdr) + + pkt_length, + MCTP_SLAVE_ADDRESS, 0); - if (len + sizeof(*hdr) > sizeof(smbus->txbuf)) - return -1; - - memcpy(buf, &pkt->data[pkt->start], len); + *buf_ptr = pec_byte; - buf += len; + i2c_message_len = SMBUS_COMMAND_CODE_SIZE + SMBUS_LENGTH_FIELD_SIZE + + sizeof(*hdr) + pkt_length + + SMBUS_PEC_BYTE_SIZE; // command code, length, + // header, data, pec byte - if (ioctl(smbus->out_fd, I2C_SLAVE, MCTP_SLAVE_ADDRESS) < 0) { - mctp_prerr("Can't set slave"); - return -1; - } - if (ioctl(smbus->out_fd, I2C_PEC, 1) < 0) { - mctp_prerr("Cant set PEC byte"); - return -1; - } - - if (i2c_smbus_write_block_data(smbus->out_fd, MCTP_COMMAND_CODE, - sizeof(*hdr) + len, (void *)smbus->txbuf) - < 0) { - mctp_prerr("Failed to send"); + if (mctp_smbus_tx(smbus, i2c_message_len)) { + mctp_prerr("Can't hold mux"); return -1; } @@ -119,64 +200,83 @@ static int mctp_binding_smbus_tx(struct mctp_binding *b, #ifdef MCTP_FILEIO int mctp_smbus_read(struct mctp_binding_smbus *smbus) { - ssize_t len; - int r; + ssize_t len = 0; struct mctp_smbus_header_rx *hdr; + int ret = 0; - r = lseek(smbus->in_fd, 0, SEEK_SET); - if (r < 0) { - mctp_prerr("Failed to seek"); - return -1; - } - len = read(smbus->in_fd, smbus->rxbuf, sizeof(smbus->rxbuf)); - if (len < sizeof(*hdr)) { - // TODO Don't return an error here, as it seems to happen from - // time to time, even with a properly written poll loop, - // although it's not clear why. - return 0; - } + do { + ret = lseek(smbus->in_fd, 0, SEEK_SET); + if (ret < 0) { + mctp_prerr("Failed to seek"); + ret = -1; + } - hdr = (void *)smbus->rxbuf; - if (hdr->destination_slave_address - != (MCTP_SOURCE_SLAVE_ADDRESS & ~1)) { - mctp_prerr("Got bad slave address %d", - hdr->destination_slave_address); - return 0; - } - if (hdr->command_code != MCTP_COMMAND_CODE) { - mctp_prerr("Got bad command code %d", hdr->command_code); - // Not a payload intended for us - return 0; - } + len = read(smbus->in_fd, smbus->rxbuf, sizeof(smbus->rxbuf)); + if (len < sizeof(*hdr)) { + // This condition hits from from time to time, even with + // a properly written poll loop, although it's not clear + // why. Return an error so that the upper layer can + // retry. + ret = 0; + break; + } - if (hdr->byte_count != (len - sizeof(*hdr))) { - // Got an incorrectly sized payload - mctp_prerr("Got smbus payload sized %d, expecting %d", - hdr->byte_count, len - sizeof(*hdr)); - return 0; - } + hdr = (void *)smbus->rxbuf; + if (hdr->destination_slave_address + != (MCTP_SOURCE_SLAVE_ADDRESS & ~1)) { + mctp_prerr("Got bad slave address %d", + hdr->destination_slave_address); + ret = 0; + break; + } + if (hdr->command_code != MCTP_COMMAND_CODE) { + mctp_prerr("Got bad command code %d", + hdr->command_code); + // Not a payload intended for us + ret = 0; + break; + } - if (len < 0) { - mctp_prerr("can't read from smbus device: %m"); - return -1; - } + if (hdr->byte_count != (len - sizeof(*hdr))) { + // Got an incorrectly sized payload + mctp_prerr("Got smbus payload sized %d, expecting %d", + hdr->byte_count, len - sizeof(*hdr)); + ret = 0; + break; + } - smbus->rx_pkt = mctp_pktbuf_alloc(0); - assert(smbus->rx_pkt); + if (len < 0) { + mctp_prerr("can't read from smbus device: %m"); + ret = -1; + break; + } - if (mctp_pktbuf_push(smbus->rx_pkt, &smbus->rxbuf[sizeof(*hdr)], - len - sizeof(*hdr) - SMBUS_PEC_BYTE_SIZE) - != 0) { - mctp_prerr("Can't push tok pktbuf: %m"); - return -1; - } + smbus->rx_pkt = mctp_pktbuf_alloc(0); + assert(smbus->rx_pkt); + + if (mctp_pktbuf_push(smbus->rx_pkt, &smbus->rxbuf[sizeof(*hdr)], + len - sizeof(*hdr) - SMBUS_PEC_BYTE_SIZE) + != 0) { + mctp_prerr("Can't push tok pktbuf: %m"); + ret = -1; + break; + } - mctp_bus_rx(&(smbus->binding), smbus->rx_pkt); + mctp_bus_rx(&(smbus->binding), smbus->rx_pkt); - mctp_pktbuf_free(smbus->rx_pkt); - smbus->rx_pkt = NULL; + mctp_pktbuf_free(smbus->rx_pkt); + smbus->rx_pkt = NULL; - return 0; + } while (0); + +#ifdef I2C_M_HOLD + if (mctp_smbus_unhold_bus(smbus)) { + mctp_prerr("Can't hold mux"); + ret = -1; + } +#endif // I2C_M_HOLD + + return ret; } int mctp_smbus_get_in_fd(struct mctp_binding_smbus *smbus) @@ -193,17 +293,13 @@ int mctp_smbus_open_bus(struct mctp_binding_smbus *smbus, int out_bus_num, int root_bus_num) { char filename[60]; - size_t filename_size; + size_t filename_size = 0; char slave_mqueue[20]; - size_t mqueue_size; - - int fd; - - size_t size; - int address_7_bit; + size_t mqueue_size = 0; + int fd = 0; + size_t size = sizeof(filename); + int address_7_bit = MCTP_SOURCE_SLAVE_ADDRESS >> 1; - address_7_bit = MCTP_SOURCE_SLAVE_ADDRESS >> 1; - size = sizeof(filename); snprintf(filename, size, "/sys/bus/i2c/devices/i2c-%d/%d-%04x/slave-mqueue", root_bus_num, root_bus_num, @@ -263,7 +359,6 @@ int mctp_smbus_open_bus(struct mctp_binding_smbus *smbus, int out_bus_num, return 0; } - #endif void mctp_smbus_register_bus(struct mctp_binding_smbus *smbus, @@ -271,8 +366,8 @@ void mctp_smbus_register_bus(struct mctp_binding_smbus *smbus, { assert(smbus->out_fd >= 0); assert(smbus->in_fd >= 0); - smbus->mctp = mctp; smbus->bus_id = mctp_register_bus(mctp, &smbus->binding, eid); + mctp_binding_set_tx_enabled(&smbus->binding, true); } struct mctp_binding_smbus *mctp_smbus_init(void) @@ -291,3 +386,8 @@ struct mctp_binding_smbus *mctp_smbus_init(void) return smbus; } + +void mctp_smbus_free(struct mctp_binding_smbus *smbus) +{ + __mctp_free(smbus); +}
\ No newline at end of file diff --git a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp_git.bb b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp_git.bb index d9359cfeb..a678fe72f 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-core/interfaces/libmctp_git.bb @@ -13,11 +13,14 @@ inherit cmake S = "${WORKDIR}/git" -DEPENDS = "i2c-tools" +DEPENDS += "i2c-tools" + +CFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include/uapi" +CFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -SRC_URI += "file://0001-Add-smbus-support-to-Cmake-Lists.patch \ +SRC_URI += "file://0001-Smbus-changes-for-libmctp.patch \ file://crc32c.c \ file://crc32c.h \ file://libmctp-smbus.h \ @@ -28,3 +31,10 @@ do_configure_prepend() { cp -f ${WORKDIR}/*.h ${S} } +# linux-libc-headers guides this way to include custom uapi headers +CFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include/uapi" +CFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include" +CXXFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include/uapi" +CXXFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include" + +do_configure[depends] += "virtual/kernel:do_shared_workdir"
\ No newline at end of file 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 53fc218c6..19f2980c9 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 @@ -1,2 +1,3 @@ +EXTRA_OECMAKE += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', '-DINTEL_PFR_ENABLED=ON', '', d)}" SRC_URI = "git://github.com/openbmc/intel-ipmi-oem.git" -SRCREV = "773703a58db91f69f2ecb32d3c69d9984fba504e" +SRCREV = "ca99ef5912b9296e09c8f9cb246ce291f9970750" diff --git a/meta-openbmc-mods/meta-common/recipes-core/kernel-panic-check/kernel-panic-check.bb b/meta-openbmc-mods/meta-common/recipes-core/kernel-panic-check/kernel-panic-check.bb new file mode 100644 index 000000000..955ed1921 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/kernel-panic-check/kernel-panic-check.bb @@ -0,0 +1,26 @@ +SUMMARY = "Kernel panic Check" +DESCRIPTION = "script tool to check if the reboot is caused by kernel panic \ + log the kernel panic to systemd journal, and also log to redfish \ + " + +S = "${WORKDIR}" +SRC_URI = "file://kernel-panic-check.sh \ + file://kernel-panic-check.service \ +" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" +RDEPENDS_${PN} += "bash logger-systemd" + +inherit systemd + +FILES_${PN} += "${systemd_system_unitdir}/kernel-panic-check.service" + +do_install() { + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/kernel-panic-check.service ${D}${systemd_system_unitdir} + install -d ${D}${bindir} + install -m 0755 ${S}/kernel-panic-check.sh ${D}/${bindir}/kernel-panic-check.sh +} + +SYSTEMD_SERVICE_${PN} += " kernel-panic-check.service" diff --git a/meta-openbmc-mods/meta-common/recipes-core/kernel-panic-check/kernel-panic-check/kernel-panic-check.service b/meta-openbmc-mods/meta-common/recipes-core/kernel-panic-check/kernel-panic-check/kernel-panic-check.service new file mode 100644 index 000000000..afe017baf --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/kernel-panic-check/kernel-panic-check/kernel-panic-check.service @@ -0,0 +1,9 @@ +[Unit] +Description=Check for kernel panic + +[Service] +Type=oneshot +ExecStart=/usr/bin/kernel-panic-check.sh + +[Install] +WantedBy=multi-user.target diff --git a/meta-openbmc-mods/meta-common/recipes-core/kernel-panic-check/kernel-panic-check/kernel-panic-check.sh b/meta-openbmc-mods/meta-common/recipes-core/kernel-panic-check/kernel-panic-check/kernel-panic-check.sh new file mode 100755 index 000000000..815f50b71 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/kernel-panic-check/kernel-panic-check/kernel-panic-check.sh @@ -0,0 +1,16 @@ +#!/bin/sh +panicFile="/sys/fs/pstore/dmesg-ramoops-0" +if [ -f $panicFile ] +then + # log the detailed last kernel panic messages + logger -t kernel-panic-check "Reboot from kernel panic! Log as following:" + cat $panicFile | logger + # Also log it to redfish + cat <<EOF | logger-systemd --journald +REDFISH_MESSAGE_ID=OpenBMC.0.1.BMCKernelPanic +PRIORITY=4 +MESSAGE=BMC rebooted due to kernel panic +EOF + + rm -rf $panicFile +fi diff --git a/meta-openbmc-mods/meta-common/recipes-core/libpeci/libpeci_git.bb b/meta-openbmc-mods/meta-common/recipes-core/libpeci/libpeci_git.bb new file mode 100644 index 000000000..22a5058c2 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/libpeci/libpeci_git.bb @@ -0,0 +1,17 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${INTELBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" +inherit cmake + +SRC_URI = "git://git@github.com/Intel-BMC/provingground.git;protocol=ssh" + +PV = "0.1+git${SRCPV}" +SRCREV = "30110fe5b18999bddc5721dc5611f542f6feeabd" + +S = "${WORKDIR}/git/libpeci" + +# linux-libc-headers guides this way to include custom uapi headers +CFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include/uapi" +CFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include" +CXXFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include/uapi" +CXXFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include" +do_configure[depends] += "virtual/kernel:do_shared_workdir" diff --git a/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd.inc b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd.inc new file mode 100644 index 000000000..abad9d12d --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd.inc @@ -0,0 +1,43 @@ +SUMMARY = "logger tool in util-linux with systemd support" +HOMEPAGE = "http://userweb.kernel.org/~kzak/util-linux/" +DESCRIPTION = "logger tool with systemd support, used to add log to systemd journald." + +SECTION = "base" + +LICENSE = "GPLv2+ & LGPLv2.1+ & BSD-3-Clause & BSD-4-Clause" + +LIC_FILES_CHKSUM = "file://README.licensing;md5=972a134f1e14b2b060e365df2fab0099 \ + file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://Documentation/licenses/COPYING.GPL-2.0-or-later;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://Documentation/licenses/COPYING.LGPL-2.1-or-later;md5=4fbd65380cdd255951079008b364516c \ + file://Documentation/licenses/COPYING.BSD-3-Clause;md5=58dcd8452651fc8b07d1f65ce07ca8af \ + file://Documentation/licenses/COPYING.BSD-4-Clause-UC;md5=263860f8968d8bafa5392cab74285262 \ + file://libuuid/COPYING;md5=6d2cafc999feb2c2de84d4d24b23290c \ + file://libmount/COPYING;md5=7c7e39fb7d70ffe5d693a643e29987c2 \ + file://libblkid/COPYING;md5=693bcbbe16d3a4a4b37bc906bc01cc04" + +inherit autotools gettext pkgconfig +DEPENDS = "libcap-ng ncurses virtual/crypt zlib systemd " +#DEPENDS_intel-ast2500 += " systemd " +#RDEPENDS_${PN} += " libsystemd" + +MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}" +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-linux-${MAJOR_VERSION}.tar.xz \ + " + +S = "${WORKDIR}/util-linux-${MAJOR_VERSION}" + +EXTRA_OECONF = " --disable-nls --disable-all-programs \ + --disable-libuuid --disable-libblkid --disable-libmount \ + --disable-libsmartcols --disable-libfdisk --disable-pylibmount \ + --with-systemd \ + --enable-logger \ + " + +do_install_append () { + mv ${D}${bindir}/logger ${D}${bindir}/logger-systemd + rm -rf ${D}${sbindir} + rm -rf ${D}${base_libdir} + rm -rf ${D}${libdir} + rm -rf ${D}${datadir} +} diff --git a/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/avoid_parallel_tests.patch b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/avoid_parallel_tests.patch new file mode 100644 index 000000000..748b6ef09 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/avoid_parallel_tests.patch @@ -0,0 +1,20 @@ +Ptest needs buildtest-TESTS and runtest-TESTS targets. +serial-tests is required to generate those targets. +Revert run.sh script accordingly to serialize running tests + +Signed-off-by: Tudor Florea <tudor.florea@enea.com> +Upstream-Status: Inappropriate + +Index: util-linux-2.32/configure.ac +=================================================================== +--- util-linux-2.32.orig/configure.ac ++++ util-linux-2.32/configure.ac +@@ -11,7 +11,7 @@ AC_CONFIG_MACRO_DIR([m4]) + dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run + dnl the compiler (like AC_PROG_LIBTOOL) to avoid autoconf errors. + AC_USE_SYSTEM_EXTENSIONS +-AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects]) ++AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects serial-tests]) + + m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], + [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) diff --git a/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/configure-sbindir.patch b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/configure-sbindir.patch new file mode 100644 index 000000000..e475289f6 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/configure-sbindir.patch @@ -0,0 +1,23 @@ +util-linux: take ${sbindir} from the environment if it is set there +fix the test, the [ ] syntax was getting eaten by autoconf + +Signed-off-by: Phil Blundell <pb@pbcl.net> +Signed-off-by: Saul Wold <sgw@linux.intel.com +Upstream-Status: Inappropriate [configuration] + +Index: util-linux-2.31/configure.ac +=================================================================== +--- util-linux-2.31.orig/configure.ac ++++ util-linux-2.31/configure.ac +@@ -89,7 +89,10 @@ AC_SUBST([runstatedir]) + usrbin_execdir='${exec_prefix}/bin' + AC_SUBST([usrbin_execdir]) + +-usrsbin_execdir='${exec_prefix}/sbin' ++if test -z "$usrsbin_execdir" ; ++then ++ usrsbin_execdir='${exec_prefix}/sbin' ++fi + AC_SUBST([usrsbin_execdir]) + + AS_CASE([$libdir], diff --git a/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/display_testname_for_subtest.patch b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/display_testname_for_subtest.patch new file mode 100644 index 000000000..417ca1d98 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/display_testname_for_subtest.patch @@ -0,0 +1,25 @@ +Display testname for subtest + +Signed-off-by: Tudor Florea <tudor.florea@enea.com> +Upstream-Status: Pending + +--- + tests/functions.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/functions.sh b/tests/functions.sh +index 5246605..b24dc15 100644 +--- a/tests/functions.sh ++++ b/tests/functions.sh +@@ -320,7 +320,7 @@ function ts_init_subtest { + + if [ "$TS_PARSABLE" != "yes" ]; then + [ $TS_NSUBTESTS -eq 1 ] && echo +- printf "%16s: %-27s ..." "" "$TS_SUBNAME" ++ printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_SUBNAME" + fi + } + +-- +2.8.3 + diff --git a/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/ptest.patch b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/ptest.patch new file mode 100644 index 000000000..0537f7d85 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/ptest.patch @@ -0,0 +1,23 @@ +Define TESTS variable + +Signed-off-by: Tudor Florea <tudor.florea@enea.com> +Upstream-Status: Pending +--- + Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile.am b/Makefile.am +index bbaccb1..7d5a6bb 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -48,6 +48,7 @@ systemdsystemunit_DATA = + dist_bashcompletion_DATA = + check_PROGRAMS = + dist_check_SCRIPTS = ++TESTS = $(check_PROGRAMS) + + PATHFILES = + +-- +2.8.3 + diff --git a/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/run-ptest b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/run-ptest new file mode 100644 index 000000000..e135ee583 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/run-ptest @@ -0,0 +1,43 @@ +#!/bin/sh + + +# When udevd (from eudev) is running most eject/mount tests will fail because +# of automount. We need to stop udevd before executing util-linux's tests. +# The systemd-udevd daemon doesn't change the outcome of util-linux's tests. +UDEV_PID="`pidof "@base_sbindir@/udevd"`" +if [ "x$UDEV_PID" != "x" ]; then + /etc/init.d/udev stop +fi + +current_path=$(readlink -f $0) +export bindir=$(dirname $current_path) +export PATH=$bindir/bin:$PATH + +cd tests || exit 1 + +comps=$(find ts/ -type f -perm -111 -regex ".*/[^\.~]*" | sort) + + +echo +echo "-------------------- util-linux regression tests --------------------" +echo +echo " For development purpose only. " +echo " Don't execute on production system! " +echo + +res=0 +count=0 +for ts in $comps; +do + $ts | sed -u '{ + s/^\(.*\):\(.*\) \.\.\. OK$/PASS: \1:\2/ + s/^\(.*\):\(.*\) \.\.\. FAILED \(.*\)$/FAIL: \1:\2 \3/ + s/^\(.*\):\(.*\) \.\.\. SKIPPED \(.*\)$/SKIP: \1:\2 \3/ + }' +done + + +if [ "x$UDEV_PID" != "x" ]; then + /etc/init.d/udev start +fi + diff --git a/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/runuser-l.pamd b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/runuser-l.pamd new file mode 100644 index 000000000..4b368ccf5 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/runuser-l.pamd @@ -0,0 +1,3 @@ +auth include runuser +session optional pam_keyinit.so force revoke +session include runuser diff --git a/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/runuser.pamd b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/runuser.pamd new file mode 100644 index 000000000..48d133b9e --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd/runuser.pamd @@ -0,0 +1,4 @@ +auth sufficient pam_rootok.so +session optional pam_keyinit.so revoke +session required pam_limits.so +session required pam_unix.so diff --git a/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd_2.34.bb b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd_2.34.bb new file mode 100644 index 000000000..b58628667 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/logger-systemd/logger-systemd_2.34.bb @@ -0,0 +1,12 @@ +require logger-systemd.inc + +SRC_URI += "file://configure-sbindir.patch \ + file://runuser.pamd \ + file://runuser-l.pamd \ + file://ptest.patch \ + file://run-ptest \ + file://display_testname_for_subtest.patch \ + file://avoid_parallel_tests.patch \ +" +SRC_URI[md5sum] = "a78cbeaed9c39094b96a48ba8f891d50" +SRC_URI[sha256sum] = "743f9d0c7252b6db246b659c1e1ce0bd45d8d4508b4dfa427bbb4a3e9b9f62b5"
\ No newline at end of file diff --git a/meta-openbmc-mods/meta-common/recipes-core/microsoft-gsl/microsoft-gsl.bb b/meta-openbmc-mods/meta-common/recipes-core/microsoft-gsl/microsoft-gsl.bb index 8cb593bce..f8e5505ef 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/microsoft-gsl/microsoft-gsl.bb +++ b/meta-openbmc-mods/meta-common/recipes-core/microsoft-gsl/microsoft-gsl.bb @@ -4,7 +4,7 @@ LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=363055e71e77071107ba2bb9a54bd9a7" -SRC_URI = "git://github.com/Microsoft/GSL.git;protocol=https" +SRC_URI = "git://github.com/Microsoft/GSL.git;protocol=https;nobranch=1" # Modify these as desired PV = "1.0+git${SRCPV}" diff --git a/meta-openbmc-mods/meta-common/recipes-core/os-release/version-vars.inc b/meta-openbmc-mods/meta-common/recipes-core/os-release/version-vars.inc index b6a2504a2..0c8f3be56 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/os-release/version-vars.inc +++ b/meta-openbmc-mods/meta-common/recipes-core/os-release/version-vars.inc @@ -67,7 +67,7 @@ python() { d.setVar('VERSION', version) d.setVar('IPMI_MAJOR', versionList[1]) d.setVar('IPMI_MINOR', versionList[2]) - d.setVar('IPMI_AUX13', hex(int(versionList[3]))) + d.setVar('IPMI_AUX13', hex(min(int(versionList[3]), 0xff))) d.setVar('IPMI_AUX14', '0x{}'.format(meta_hash[0:2])) d.setVar('IPMI_AUX15', '0x{}'.format(meta_hash[2:4])) d.setVar('IPMI_AUX16', '0x{}'.format(meta_hash[4:6])) diff --git a/meta-openbmc-mods/meta-common/recipes-core/peci-pcie/peci-pcie_git.bb b/meta-openbmc-mods/meta-common/recipes-core/peci-pcie/peci-pcie_git.bb index e19e5fc93..10b34354c 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/peci-pcie/peci-pcie_git.bb +++ b/meta-openbmc-mods/meta-common/recipes-core/peci-pcie/peci-pcie_git.bb @@ -7,10 +7,10 @@ inherit cmake systemd SRC_URI = "git://git@github.com/Intel-BMC/at-scale-debug;protocol=ssh" -DEPENDS = "boost sdbusplus crashdump" +DEPENDS = "boost sdbusplus libpeci" PV = "0.1+git${SRCPV}" -SRCREV = "6ed87657134c7379da1febcccd5d87617c702347" +SRCREV = "20016caebaac78c3290462ffa8df10c2efd61261" S = "${WORKDIR}/git/peci_pcie" 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 a6d94fc51..646d9612f 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 = "f1708afcbba69f75e80920b75aa3d7baee3f611d" +SRCREV = "5d92be815bf35137eb31fb653e435321a511311c" 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-core/systemd/systemd/000-ro-rootfs-tmpfile-defaults.patch b/meta-openbmc-mods/meta-common/recipes-core/systemd/systemd/000-ro-rootfs-tmpfile-defaults.patch deleted file mode 100644 index d16f3a2dc..000000000 --- a/meta-openbmc-mods/meta-common/recipes-core/systemd/systemd/000-ro-rootfs-tmpfile-defaults.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 05e1b853abfd54d117dad25185c602d1791d83f6 Mon Sep 17 00:00:00 2001 -From: David Cobbley <david.j.cobbley@linux.intel.com> -Date: Tue, 26 Jun 2018 16:10:14 -0700 -Subject: [PATCH] ro-rootfs-tmpfile-defaults - ---- - tmpfiles.d/home.conf | 1 - - tmpfiles.d/tmp.conf | 1 - - tmpfiles.d/var.conf.m4 | 5 ++++- - 3 files changed, 4 insertions(+), 3 deletions(-) - -diff --git a/tmpfiles.d/home.conf b/tmpfiles.d/home.conf -index 9f25b83..5c7513a 100644 ---- a/tmpfiles.d/home.conf -+++ b/tmpfiles.d/home.conf -@@ -8,4 +8,3 @@ - # See tmpfiles.d(5) for details - - Q /home 0755 - - - --q /srv 0755 - - - -diff --git a/tmpfiles.d/tmp.conf b/tmpfiles.d/tmp.conf -index 22555a0..aad1b98 100644 ---- a/tmpfiles.d/tmp.conf -+++ b/tmpfiles.d/tmp.conf -@@ -9,7 +9,6 @@ - - # Clear tmp directories separately, to make them easier to override - q /tmp 1777 root root 10d --q /var/tmp 1777 root root 30d - - # Exclude namespace mountpoints created with PrivateTmp=yes - x /tmp/systemd-private-%b-* -diff --git a/tmpfiles.d/var.conf.m4 b/tmpfiles.d/var.conf.m4 -index 0e2c509..fa288b8 100644 ---- a/tmpfiles.d/var.conf.m4 -+++ b/tmpfiles.d/var.conf.m4 -@@ -11,7 +11,10 @@ q /var 0755 - - - - - L /var/run - - - - ../run - --d /var/log 0755 - - - -+# now /var/log and /var/tmp really live in volatile -+L /var/log - - - - volatile/log -+L /var/tmp - - - - volatile/tmp -+ - m4_ifdef(`ENABLE_UTMP', - f /var/log/wtmp 0664 root utmp - - f /var/log/btmp 0660 root utmp - --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-core/systemd/systemd/0001-Modfiy-system.conf-DefaultTimeoutStopSec.patch b/meta-openbmc-mods/meta-common/recipes-core/systemd/systemd/0001-Modfiy-system.conf-DefaultTimeoutStopSec.patch index f72052e0c..5b9f17006 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/systemd/systemd/0001-Modfiy-system.conf-DefaultTimeoutStopSec.patch +++ b/meta-openbmc-mods/meta-common/recipes-core/systemd/systemd/0001-Modfiy-system.conf-DefaultTimeoutStopSec.patch @@ -1,4 +1,4 @@ -From 3016898f4300fdd8db74f821cd6ea54dbf39fdc8 Mon Sep 17 00:00:00 2001 +From e02932693f92d6230b5520f431e127f7b6e2183e Mon Sep 17 00:00:00 2001 From: James Feist <james.feist@linux.intel.com> Date: Tue, 6 Mar 2018 16:06:33 -0800 Subject: [PATCH 1/1] Modfiy system.conf DefaultTimeoutStopSec @@ -7,22 +7,22 @@ Current time is 5 minutes, change it to 10 seconds. Signed-off-by: James Feist <james.feist@linux.intel.com> --- - src/core/system.conf | 2 +- + src/core/system.conf.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/system.conf.in b/src/core/system.conf.in -index 746572b..ba2a265 100644 +index 8112125468..f7a35a56bb 100644 --- a/src/core/system.conf.in +++ b/src/core/system.conf.in -@@ -33,7 +33,7 @@ +@@ -39,7 +39,7 @@ #DefaultStandardOutput=journal #DefaultStandardError=inherit #DefaultTimeoutStartSec=90s -#DefaultTimeoutStopSec=90s +DefaultTimeoutStopSec=10s + #DefaultTimeoutAbortSec= #DefaultRestartSec=100ms #DefaultStartLimitIntervalSec=10s - #DefaultStartLimitBurst=5 -- -2.7.4 +2.17.1 diff --git a/meta-openbmc-mods/meta-common/recipes-core/systemd/systemd/systemd-timesyncd.service b/meta-openbmc-mods/meta-common/recipes-core/systemd/systemd/systemd-timesyncd.service deleted file mode 100644 index 9a5fffbb3..000000000 --- a/meta-openbmc-mods/meta-common/recipes-core/systemd/systemd/systemd-timesyncd.service +++ /dev/null @@ -1,53 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1+ -# -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=Network Time Synchronization -Documentation=man:systemd-timesyncd.service(8) -ConditionCapability=CAP_SYS_TIME -ConditionVirtualization=!container -DefaultDependencies=no -After=systemd-remount-fs.service systemd-sysusers.service var.mount -Before=time-set.target sysinit.target shutdown.target -Conflicts=shutdown.target -Wants=time-set.target time-sync.target - -[Service] -AmbientCapabilities=CAP_SYS_TIME -CapabilityBoundingSet=CAP_SYS_TIME -ExecStart=!!/lib/systemd/systemd-timesyncd -LockPersonality=yes -MemoryDenyWriteExecute=yes -NoNewPrivileges=yes -PrivateDevices=yes -PrivateTmp=yes -ProtectControlGroups=yes -ProtectHome=yes -ProtectHostname=yes -ProtectKernelModules=yes -ProtectKernelTunables=yes -ProtectSystem=strict -Restart=always -RestartSec=0 -RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 -RestrictNamespaces=yes -RestrictRealtime=yes -RestrictSUIDSGID=yes -RuntimeDirectory=systemd/timesync -StateDirectory=systemd/timesync -SystemCallArchitectures=native -SystemCallErrorNumber=EPERM -SystemCallFilter=@system-service @clock -Type=notify -User=systemd-timesync -WatchdogSec=3min - -[Install] -WantedBy=sysinit.target -Alias=dbus-org.freedesktop.timesync1.service diff --git a/meta-openbmc-mods/meta-common/recipes-core/systemd/systemd_%.bbappend b/meta-openbmc-mods/meta-common/recipes-core/systemd/systemd_%.bbappend index 3e5adf7ce..d80714589 100644 --- a/meta-openbmc-mods/meta-common/recipes-core/systemd/systemd_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-core/systemd/systemd_%.bbappend @@ -4,8 +4,7 @@ LICENSE = "GPL-2.0" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -SRC_URI += "file://000-ro-rootfs-tmpfile-defaults.patch \ - file://0001-Modfiy-system.conf-DefaultTimeoutStopSec.patch \ +SRC_URI += "file://0001-Modfiy-system.conf-DefaultTimeoutStopSec.patch \ file://systemd-time-wait-sync.service \ " |