diff --git a/0005-sensor-id-length.patch b/0005-sensor-id-length.patch deleted file mode 100644 index 0cb8313d6c5e5fdf93933b9e97ab3462d97c9f0a..0000000000000000000000000000000000000000 --- a/0005-sensor-id-length.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/include/ipmitool/ipmi_sdr.h b/include/ipmitool/ipmi_sdr.h -index ccf0cf0..47d3949 100644 ---- a/include/ipmitool/ipmi_sdr.h -+++ b/include/ipmitool/ipmi_sdr.h -@@ -819,7 +819,7 @@ static const char *sensor_type_desc[] __attribute__ ((unused)) = { - "Version Change", "FRU State" }; - - struct sensor_reading { -- char s_id[17]; /* name of the sensor */ -+ char s_id[33]; /* name of the sensor */ - struct sdr_record_full_sensor *full; - struct sdr_record_compact_sensor *compact; - uint8_t s_reading_valid; /* read value valididity */ --- -2.1.0 - diff --git a/0006-enable-usb.patch b/0006-enable-usb.patch deleted file mode 100644 index d3bfba5a4d647268751d22987fec05b8a60caeac..0000000000000000000000000000000000000000 --- a/0006-enable-usb.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -urNp old/configure.ac new/configure.ac ---- old/configure.ac 2017-02-02 14:20:33.230784269 +0100 -+++ new/configure.ac 2017-02-02 14:22:53.528510336 +0100 -@@ -63,7 +63,7 @@ xenable_intf_imb=yes - xenable_intf_lipmi=yes - xenable_intf_open=yes - #xenable_intf_serial=yes --xenable_intf_usb=no -+xenable_intf_usb=yes - xenable_ipmishell=yes - - dnl set some things so we build with GNU tools on Solaris -@@ -209,7 +209,7 @@ fi - dnl enable IPMI USB interface - AC_ARG_ENABLE([intf-usb], - [AC_HELP_STRING([--enable-intf-usb], -- [enable IPMI USB interface [default=auto]])], -+ [enable IPMI USB interface [default=yes]])], - [xenable_intf_usb=$enableval], - [xenable_intf_usb=$xenable_intf_usb]) - if test "x$xenable_intf_usb" = "xstatic" || test "x$xenable_intf_usb" = "xplugin"; then diff --git a/0007-check-input.patch b/0007-check-input.patch deleted file mode 100644 index 030fd2a40c8fb4029f8cfd8c17c3c7f731b5f7f1..0000000000000000000000000000000000000000 --- a/0007-check-input.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff -urNp old/doc/ipmitool.1 new/doc/ipmitool.1 ---- old/doc/ipmitool.1 2017-10-03 16:10:50.446539988 +0200 -+++ new/doc/ipmitool.1 2017-10-03 16:16:37.039673239 +0200 -@@ -3170,13 +3170,14 @@ SOL configuration data for the currently - - Enable, disable or show status of SOL payload for the user on the specified channel. - .TP --\fIset\fP <\fBparameter\fR> <\fBvalue\fR> [<\fBchannel\fR>] -+\fIset\fP <\fBparameter\fR> <\fBvalue\fR> [<\fBchannel\fR>] [\fBnoguard\fR] - .br - - Configure parameters for Serial Over Lan. If no channel is given, - it will display SOL configuration data for the currently used - channel. Configuration parameter updates are automatically guarded --with the updates to the set\-in\-progress parameter. -+with the updates to the set\-in\-progress parameter, unless \fInoguard\fR -+parameter is present. - .RS - .TP - Valid parameters and values are: -diff -urNp old/lib/ipmi_sol.c new/lib/ipmi_sol.c ---- old/lib/ipmi_sol.c 2017-10-03 16:10:50.447539996 +0200 -+++ new/lib/ipmi_sol.c 2017-10-03 16:18:37.079006949 +0200 -@@ -1875,7 +1875,7 @@ static void - print_sol_usage(void) - { - lprintf(LOG_NOTICE, "SOL Commands: info []"); -- lprintf(LOG_NOTICE, " set [channel]"); -+ lprintf(LOG_NOTICE, " set [channel] [noguard]"); - lprintf(LOG_NOTICE, " payload [channel] [userid]"); - lprintf(LOG_NOTICE, " activate [] [instance=]"); - lprintf(LOG_NOTICE, " deactivate [instance=]"); -@@ -1890,6 +1890,8 @@ print_sol_usage(void) - static void - print_sol_set_usage(void) - { -+ lprintf(LOG_NOTICE, "\nSOL set usage: \n"); -+ lprintf(LOG_NOTICE, " sol set [channel] [noguard]\n"); - lprintf(LOG_NOTICE, "\nSOL set parameters and values: \n"); - lprintf(LOG_NOTICE, " set-in-progress set-complete | " - "set-in-progress | commit-write"); diff --git a/exchange-bmc-os-info b/exchange-bmc-os-info deleted file mode 100644 index c23b507a3cd52da0018a99616348e30c3b262145..0000000000000000000000000000000000000000 --- a/exchange-bmc-os-info +++ /dev/null @@ -1,326 +0,0 @@ -#!/bin/sh -############################################################################# -# -# exchange-bmc-os-info: Set OS and BMC (Baseboard Management Controller) -# parameters during system startup. -# -# version: 0.72 -# -# Authors: Charles Rose -# Jordan Hargrave -# -# Description: Script to set OS information in the BMC; fetch BMC IP/URL -# and set in the OS for use by other scripts/user. -# -# BMC IP and URL are made available in /var/run/bmc-info -# -# Example to launch BMC web-interface: -# # . /var/run/bmc-info -# # xdg-open $BMC_URL -# -# See here for details: -# https://fedoraproject.org/wiki/Features/AgentFreeManagement -# -# OEM Specific: OEM specific ipmi commands go in: -# 'oem_set_os_version' and 'oem_get_bmc_url' -############################################################################# -# -# chkconfig: 345 99 00 -# description: Set OS name, hostname in BMC; make BMC IP/URL available in OS -# processname: exchange-bmc-os-info -# config: /etc/sysconfig/exchange-bmc-os-info -# -### BEGIN INIT INFO -# Provides: exchange-bmc-os-info -# Required-Start: ipmi -# Default-Start: 3 4 5 -# Default-Stop: 0 1 2 6 - - -############################################################################# -# GLOBALS -############################################################################# -CONFIGFILE=/etc/sysconfig/exchange-bmc-os-info -IPMI_TOOL=/usr/bin/ipmitool -BMC_INFO=/var/run/bmc-info - -# BMC Manufacturer ID used in 'oem_set_os_version' and 'oem_get_bmc_url' -DELL="674" -#OTHER_OEM="123" - -# Defaults for ${CONFIGFILE} -SET_OS_INFO="yes" -RESET_OS_INFO="no" -SET_BMC_INFO="yes" - -# getsysinfo and setsysinfo commands -IPMI_SET_SYSINFO="${IPMI_TOOL} mc setsysinfo" -IPMI_GET_SYSINFO="${IPMI_TOOL} mc getsysinfo" -############################################################################# -SCRIPT_NAME=$(basename $0) - -# source config -[ -r ${CONFIGFILE} ] && . ${CONFIGFILE} - -RETVAL=0 - -if [ -f /bin/gettext.sh ]; then - GETTEXT=1 - . /bin/gettext.sh - OUTPUT="eval_gettext" -else - GETTEXT=0 - OUTPUT="echo" -fi - -############################################################################# -# Get Vendor ID of BMC for use in 'oem_set_os_version' and 'oem_get_bmc_url' -# -get_bmc_vendor_id() -{ - BMC_VENDOR=$(${IPMI_TOOL} mc info 2>/dev/null | \ - sed -n "s#^Manufacturer ID.*: ##p") - [ -z "${BMC_VENDOR}" ] && RETVAL=4 -} - -# set/getsysinfo support was added to ipmitool post v1.8.12 via this patch -# http://sourceforge.net/mailarchive/message.php?msg_id=29647222 -check_ipmitool() -{ - if [ -x ${IPMI_TOOL} ]; then - [ ! ${IPMI_GET_SYSINFO} >/dev/null 2>&1 ] && \ - RETVAL=3 - else - RETVAL=2 - fi -} - -bmc_exists() -{ - check_ipmitool - [ $RETVAL -eq 0 ] && get_bmc_vendor_id - return $RETVAL -} -############################################################################# - -get_os_info() -{ - OS_HOSTNAME=$(hostname) - KERNEL_VERSION=$(uname -r -m) - - if [ -e /etc/lsb-release ] ; then - . /etc/lsb-release - NAME=${DISTRIB_ID} - VERSION="${DISTRIB_RELEASE} ${DISTRIB_CODENAME}" - fi - - # we prefer systemd's /etc/os-release over other sources - [ -e /etc/os-release ] && . /etc/os-release - - OS_NAME=${NAME} - OS_VERSION="${VERSION} kernel ${KERNEL_VERSION}" -} - -oem_set_os_version() -{ - # OS Version setting is not standard yet - # we need per vendor oem commands - case "${BMC_VENDOR}" in - $DELL) ${IPMI_SET_SYSINFO} delloem_os_version \ - "${OS_VERSION}" > /dev/null 2>&1 - return $? - ;; -# Add OEM specific commands. -# Example: -# $OTHER_OEM) ${IPMI_SET_SYSINFO} otheroem_os_version \ -# "${OS_VERSION}" > /dev/null 2>&1 -# return $? -# ;; - *) return 0 - ;; - esac -} - -set_os_info() -{ - # Set and reset OS info in the BMC - if [ "$1" = "reset" ]; then - OS_NAME="" - OS_HOSTNAME="" - OS_VERSION="" - fi - - ${IPMI_SET_SYSINFO} os_name "${OS_NAME}" >/dev/null 2>&1 \ - || RETVAL=6 - ${IPMI_SET_SYSINFO} primary_os_name "${OS_NAME}" >/dev/null 2>&1 \ - || RETVAL=6 - ${IPMI_SET_SYSINFO} system_name "${OS_HOSTNAME}" >/dev/null 2>&1 \ - || RETVAL=6 - oem_set_os_version || RETVAL=6 -} - -############################################################################# -valid_url() -{ - url="(https?|http)://[a-z0-9-]+(\.[a-z0-9-]+)+([/?].*)?" - printf -- "%s" "${TMP_URL}"| grep -Eq "^${url}" - return $? -} - -oem_get_bmc_url() -{ - # BMC URL is not standard yet - # we need per vendor oem commands - case "$BMC_VENDOR" in - $DELL) TMP_URL=$(${IPMI_GET_SYSINFO} delloem_url 2> /dev/null) - ;; -# Add OEM specific commands -# Example: -# $OTHER_OEM) -# TMP_URL=$(${IPMI_GET_SYSINFO} otheroem_url 2> /dev/null) -# ;; - *) TMP_URL="" ;; - esac - - valid_url && BMC_URL=${TMP_URL} || BMC_URL="" -} - -valid_ip() -{ - #Thanks to mkyong.com - octet="([01]?[[:digit:]][[:digit:]]?|2[0-4][[:digit:]]|25[0-5])" - - printf -- "%s" "${TMP_IPv4}"| grep -Eq "^${octet}\\.${octet}\\.${octet}\\.${octet}$" - return $? -} - -get_bmc_ip() -{ - #Thanks to http://ingvar.blog.redpill-linpro.com - for CHANNEL in `seq 1 14` - do - [ $(${IPMI_TOOL} lan print ${CHANNEL} 2>/dev/null \ - | grep -q "^Set") ] || break - done - - # Get BMC_IPv4 and BMC_URL from BMC - TMP_IPv4=$(${IPMI_TOOL} lan print ${CHANNEL} 2>/dev/null \ - | sed -n "s#^IP Address .*: ##p") - - valid_ip && BMC_IPv4=${TMP_IPv4} || BMC_IPv4="" -} - -get_bmc_info() -{ - get_bmc_ip - if [ -z "${BMC_IPv4}" ] || [ "${BMC_IPv4}" = "0.0.0.0" ]; then - BMC_IPv4="" - RETVAL=5 - else - # URL makes sense only if there is an IP - oem_get_bmc_url - fi -} - -set_bmc_info() -{ - if [ ! $(touch "${BMC_INFO}" && chmod 600 "${BMC_INFO}") ]; then - printf "BMC_IPv4=%s\n" "${BMC_IPv4}" > "${BMC_INFO}" - [ -n "${BMC_URL}" ] && \ - printf "BMC_URL=%s\n" "${BMC_URL}" >> "${BMC_INFO}" - else - RETVAL=5 - fi -} - -unset_bmc_info() -{ - [ -f ${BMC_INFO} ] && rm -f ${BMC_INFO} > /dev/null 2>&1 -} - -############################################################################# -start() -{ - if bmc_exists; then - [ "${SET_OS_INFO}" = "yes" ] && \ - get_os_info && set_os_info - - if [ "${SET_BMC_INFO}" = "yes" ]; then - get_bmc_info - if [ ${RETVAL} -eq 0 ]; then - set_bmc_info - fi - fi - fi -} - -############################################################################# -stop() -{ - if bmc_exists; then - # reset OS info while system reboots - # aids with debugging OS boot-up issues - if [ "${RESET_OS_INFO}" = "yes" ]; then - set_os_info reset - fi - unset_bmc_info - fi -} - -############################################################################# -restart() -{ - stop - [ $RETVAL -eq 0 ] && start -} - -############################################################################# -status() -{ - [ -r ${BMC_INFO} ] && \ - grep -q "BMC_IPv4" "${BMC_INFO}" >/dev/null 1>&2 && \ - BMC_STATUS="ok" || BMC_STATUS="inactive" - ${OUTPUT} "${SCRIPT_NAME}: ${BMC_STATUS}" 1>&2 - [ ${GETTEXT} -eq 1 ] && echo -} - -############################################################################# -usage() -{ - ${OUTPUT} "Usage: ${SCRIPT_NAME} {start|stop|restart|status}" 1>&2 - [ ${GETTEXT} -eq 1 ] && echo - RETVAL=1 -} - -############################################################################# -# MAIN -############################################################################# -case "$1" in - start) start ;; - stop) stop ;; - restart) restart ;; - status) status ;; - *) usage ;; -esac - -case "$RETVAL" in - 0|1) ;; - 2) ${OUTPUT} "${SCRIPT_NAME}: ipmitool(1) not found." 1>&2 ;; - 3) ${OUTPUT} "${SCRIPT_NAME}: this version of ipmitool does not support getsysinfo." 1>&2 ;; - 4) ${OUTPUT} "${SCRIPT_NAME}: failed to communicate with BMC." 1>&2 ;; - 5) ${OUTPUT} "${SCRIPT_NAME}: failed to set OS information in BMC." 1>&2 ;; - 6) ${OUTPUT} "${SCRIPT_NAME}: failed to get BMC information." 1>&2 ;; - *) ${OUTPUT} "${SCRIPT_NAME}: unexpected error." 1>&2 ;; -esac - -if [ ${RETVAL} -gt 1 ]; then - ${OUTPUT} " Return code: ${RETVAL}" 1>&2 - [ ${GETTEXT} -eq 1 ] && echo -fi - - -exit ${RETVAL} - -############################################################################# -# end of file -############################################################################# diff --git a/exchange-bmc-os-info.service b/exchange-bmc-os-info.service deleted file mode 100644 index 100493b3b10487dc4733cc5d803f030f250ab250..0000000000000000000000000000000000000000 --- a/exchange-bmc-os-info.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Exchange Information between BMC and OS -After=ipmi.service network.target -Requires=ipmi.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/libexec/exchange-bmc-os-info start -ExecStop=/usr/libexec/exchange-bmc-os-info stop - -[Install] -WantedBy=multi-user.target diff --git a/exchange-bmc-os-info.sysconf b/exchange-bmc-os-info.sysconf deleted file mode 100644 index 2f0e675bfdb85904ab374b1749dceb901c6da1b2..0000000000000000000000000000000000000000 --- a/exchange-bmc-os-info.sysconf +++ /dev/null @@ -1,26 +0,0 @@ -# exchange-bmc-os-info -# -# Config file to control Exchange of information between -# the OS and Service Processor/Baseboard Management Controller (BMC) -# -# See here for details -# https://fedoraproject.org/wiki/Features/AgentFreeManagement - -### Set OS Info in BMC/Service Processor ### -# Name: SET_OS_INFO -# Description: Set OS Name, Version and Hostname in the Service Processor (BMC) -# Default: yes -SET_OS_INFO="yes" - -### Reset OS Info in BMC/Service Processor ### -# Name: RESET_OS_INFO -# Description: Reset OS Name, Version and Hostname in the Service Processor (BMC). -# Useful when the OS Name/Hostname should be empty on reboot -# Default: no -RESET_OS_INFO="no" - -### Set BMC/Service Processor Info in OS ### -# Name; SET_BMC_INFO -# Description: Set IP Address and URL of Service Processor/BMC in /run/bmc-info -# Default: yes -SET_BMC_INFO="yes" diff --git a/openipmi-ipmievd.sysconf b/ipmievd.sysconf similarity index 100% rename from openipmi-ipmievd.sysconf rename to ipmievd.sysconf diff --git a/ipmitool.spec b/ipmitool.spec index 3b35932e26b153cf4c531bd4bd9a064c1b414b21..f32a0666a652b5abbbe6c4f1c9c7a5ff28a22b40 100644 --- a/ipmitool.spec +++ b/ipmitool.spec @@ -1,25 +1,20 @@ Name: ipmitool Version: 1.8.18 -Release: 11 +Release: 12 Summary: Utility for IPMI control License: BSD URL: http://ipmitool.sourceforge.net/ Source0: http://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{version}.tar.bz2 -Source1: openipmi-ipmievd.sysconf +Source1: ipmievd.sysconf Source2: ipmievd.service -Source3: exchange-bmc-os-info.service -Source4: exchange-bmc-os-info.sysconf Source5: set-bmc-url.sh -Source6: exchange-bmc-os-info -# patch1 to patch 7 come from fedora +# patch1 to patch4 come from fedora Patch1: 0001-CVE-2011-4339-OpenIPMI.patch Patch2: 0002-openssl.patch Patch3: 0003-ipmitool-1.8.11-set-kg-key.patch Patch4: 0004-slowswid.patch -Patch5: 0005-sensor-id-length.patch -Patch6: 0006-enable-usb.patch -Patch7: 0007-check-input.patch + Patch6000: ID-477-fru-Fix-decoding-of-non-text-data-in-get_fru_.patch Patch6001: ID-480-ipmitool-coredumps-in-EVP_CIPHER_CTX_init.patch Patch6002: ID-480-Call-EVP_CIPHER_CTX_free-instead-of-EVP_CIPHE.patch @@ -44,7 +39,7 @@ Patch6019: open-checking-received-msg-id-against-expectation.patch BuildRequires: openssl-devel readline-devel ncurses-devel git %{?systemd_requires} BuildRequires: systemd -BuildRequires: automake autoconf libtool +BuildRequires: automake autoconf libtool Requires: net-snmp hostname Obsoletes: OpenIPMI-tools < 2.0.14-3 Provides: OpenIPMI-tools = 2.0.14-3 @@ -82,19 +77,21 @@ automake --foreign install -Dpm 644 %{SOURCE2} %{buildroot}%{_unitdir}/ipmievd.service install -Dpm 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/ipmievd -install -Dm 644 %{SOURCE3} %{buildroot}%{_unitdir}/exchange-bmc-os-info.service -install -Dm 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/exchange-bmc-os-info + +install -Dm 644 contrib/exchange-bmc-os-info.service.redhat %{buildroot}%{_unitdir}/exchange-bmc-os-info.service +install -Dm 644 contrib/exchange-bmc-os-info.sysconf %{buildroot}%{_sysconfdir}/sysconfig/exchange-bmc-os-info +install -Dm 755 contrib/exchange-bmc-os-info.init.redhat %{buildroot}%{_libexecdir}/exchange-bmc-os-info install -Dm 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/profile.d/set-bmc-url.sh -install -Dm 755 %{SOURCE6} %{buildroot}%{_libexecdir}/exchange-bmc-os-info + install -Dm 644 contrib/bmc-snmp-proxy.sysconf %{buildroot}%{_sysconfdir}/sysconfig/bmc-snmp-proxy install -Dm 644 contrib/bmc-snmp-proxy.service %{buildroot}%{_unitdir}/bmc-snmp-proxy.service install -Dm 755 contrib/bmc-snmp-proxy %{buildroot}%{_libexecdir}/bmc-snmp-proxy -%post +%post %systemd_post ipmievd.service %systemd_post exchange-bmc-os-info.service -%preun +%preun %systemd_preun ipmievd.service %systemd_preun exchange-bmc-os-info.service @@ -125,5 +122,8 @@ install -Dm 755 contrib/bmc-snmp-proxy %{buildroot}%{_libexecdir}/bmc-sn %{_mandir}/man8/ipmievd.8* %changelog +* Mon Jan 6 2020 openEuler Buildteam - 1.8.18-12 +- update software package + * Sat Sep 21 2019 openEuler Buildteam - 1.8.18-11 - Package init