diff -Nru ipmitool-1.8.18/debian/changelog ipmitool-1.8.18/debian/changelog --- ipmitool-1.8.18/debian/changelog 2019-12-22 19:55:43.000000000 +0000 +++ ipmitool-1.8.18/debian/changelog 2022-08-03 01:13:13.000000000 +0000 @@ -1,3 +1,34 @@ +ipmitool (1.8.18-9ubuntu1~focal1) focal; urgency=medium + + * Build for PPA + + -- Bryce Harrington Wed, 03 Aug 2022 01:13:13 +0000 + +ipmitool (1.8.18-9ubuntu1) focal; urgency=medium + + * d/p/add_basic_support_for_quanta.patch: Add basic support for Quanta + - Enables support for IPMI events on Quanta Server hardware + (LP: #1864612) + + -- Bryce Harrington Tue, 02 Aug 2022 17:59:13 -0700 + +ipmitool (1.8.18-9) unstable; urgency=medium + + * d/p/add_basic_support_for_quanta.patch: Add basic support for Quanta + - Enables support for IPMI events on Quanta Server hardware + (LP: #1864612) + + -- Bryce Harrington Tue, 02 Aug 2022 17:57:42 -0700 + +ipmitool (1.8.18-8.1) unstable; urgency=medium + + * Non-maintainer upload. + * d/p/add_basic_support_for_quanta.patch: Add basic support for Quanta + - Enables support for IPMI events on Quanta Server hardware + (LP: #1864612) + + -- Bryce Harrington Tue, 02 Aug 2022 17:57:33 -0700 + ipmitool (1.8.18-8) unstable; urgency=medium * New debian/patches/0130-Correct_lanplus_segment_violation.patch: diff -Nru ipmitool-1.8.18/debian/control ipmitool-1.8.18/debian/control --- ipmitool-1.8.18/debian/control 2019-12-22 19:42:11.000000000 +0000 +++ ipmitool-1.8.18/debian/control 2022-08-03 01:06:44.000000000 +0000 @@ -1,7 +1,8 @@ Source: ipmitool Section: utils Priority: optional -Maintainer: Jörg Frings-Fürst +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Jörg Frings-Fürst Build-Depends: debhelper-compat (= 12), init-system-helpers (>> 1.50), diff -Nru ipmitool-1.8.18/debian/patches/add_basic_support_for_quanta.patch ipmitool-1.8.18/debian/patches/add_basic_support_for_quanta.patch --- ipmitool-1.8.18/debian/patches/add_basic_support_for_quanta.patch 1970-01-01 00:00:00.000000000 +0000 +++ ipmitool-1.8.18/debian/patches/add_basic_support_for_quanta.patch 2022-08-03 00:55:42.000000000 +0000 @@ -0,0 +1,404 @@ +From 5c033c06abb45bc183f42cd758c61807ce953726 Mon Sep 17 00:00:00 2001 +From: qctbmc +Date: Tue, 10 Jul 2018 11:21:55 +0800 +Subject: [PATCH] oem: Add basic support for Quanta + +--- + include/ipmitool/Makefile.am | 2 +- + include/ipmitool/ipmi_quantaoem.h | 55 +++++++++ + lib/Makefile.am | 2 +- + lib/ipmi_main.c | 1 + + lib/ipmi_oem.c | 14 +++ + lib/ipmi_quantaoem.c | 184 ++++++++++++++++++++++++++++++ + lib/ipmi_sel.c | 21 +++- + src/ipmitool.c | 1 + + 8 files changed, 274 insertions(+), 6 deletions(-) + create mode 100644 include/ipmitool/ipmi_quantaoem.h + create mode 100644 lib/ipmi_quantaoem.c + +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ipmitool/+bug/1864612 +Origin: upstream, https://github.com/ipmitool/ipmitool/commit/5c033c06abb45bc183f42cd758c61807ce953726 +Applied-Upstream: 1.8.19, commit:5c033c06abb45bc183f42cd758c61807ce953726 +Reviewed-By: Bryce Harrington + +--- a/include/ipmitool/Makefile.am ++++ b/include/ipmitool/Makefile.am +@@ -39,4 +39,4 @@ + ipmi_fwum.h ipmi_main.h ipmi_tsol.h ipmi_firewall.h \ + ipmi_kontronoem.h ipmi_ekanalyzer.h ipmi_gendev.h ipmi_ime.h \ + ipmi_delloem.h ipmi_dcmi.h ipmi_vita.h ipmi_sel_supermicro.h \ +- ipmi_cfgp.h ipmi_lanp6.h ++ ipmi_cfgp.h ipmi_lanp6.h ipmi_quantaoem.h +--- /dev/null ++++ b/include/ipmitool/ipmi_quantaoem.h +@@ -0,0 +1,55 @@ ++/* ++ * Copyright (c) 2018 Quanta Computer Inc. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * ++ * Redistribution of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * ++ * Redistribution in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * Neither the name of Quanta Computer Inc. or the names of ++ * contributors may be used to endorse or promote products derived ++ * from this software without specific prior written permission. ++ * ++ * This software is provided "AS IS," without a warranty of any kind. ++ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, ++ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A ++ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. ++ * Quanta Computer Inc. AND ITS LICENSORS SHALL NOT BE LIABLE ++ * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING ++ * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL ++ * Quanta Computer Inc. OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, ++ * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR ++ * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF ++ * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, ++ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ++ */ ++ ++#ifndef IPMI_QUANTAOEM_H ++#define IPMI_QUANTAOEM_H ++ ++#if HAVE_CONFIG_H ++# include ++#endif ++#include ++#include ++ ++#define OEM_QCT_NETFN 0x36 ++#define OEM_QCT_GET_INFO 0x65 ++ ++typedef enum ++{ ++ OEM_QCT_PLATFORM_UNKNOWN = 0, ++ OEM_QCT_PLATFORM_GRANTLEY, ++ OEM_QCT_PLATFORM_PURLEY ++} qct_platform_t; ++ ++qct_platform_t oem_qct_get_platform_id(struct ipmi_intf *intf); ++char *oem_qct_get_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec); ++ ++#endif /*IPMI_QUANTAOEM_H*/ +--- a/lib/Makefile.am ++++ b/lib/Makefile.am +@@ -41,7 +41,7 @@ + ipmi_main.c ipmi_tsol.c ipmi_firewall.c ipmi_kontronoem.c \ + ipmi_hpmfwupg.c ipmi_sdradd.c ipmi_ekanalyzer.c ipmi_gendev.c \ + ipmi_ime.c ipmi_delloem.c ipmi_dcmi.c hpm2.c ipmi_vita.c \ +- ipmi_lanp6.c ipmi_cfgp.c \ ++ ipmi_lanp6.c ipmi_cfgp.c ipmi_quantaoem.c \ + ../src/plugins/lan/md5.c ../src/plugins/lan/md5.h + + libipmitool_la_LDFLAGS = -export-dynamic +--- a/lib/ipmi_main.c ++++ b/lib/ipmi_main.c +@@ -76,6 +76,7 @@ + #include + #include + #include ++#include + + #ifdef HAVE_CONFIG_H + # include +--- a/lib/ipmi_oem.c ++++ b/lib/ipmi_oem.c +@@ -39,6 +39,7 @@ + + static int ipmi_oem_supermicro(struct ipmi_intf * intf); + static int ipmi_oem_ibm(struct ipmi_intf * intf); ++static int ipmi_oem_quanta(struct ipmi_intf * intf); + + static struct ipmi_oem_handle ipmi_oem_list[] = { + { +@@ -71,6 +72,11 @@ + .name = "kontron", + .desc = "Kontron OEM big buffer support" + }, ++ { ++ .name = "quanta", ++ .desc = "Quanta IPMIv1.5 BMC with OEM LAN authentication support", ++ .setup = ipmi_oem_quanta, ++ }, + { 0 } + }; + +@@ -93,6 +99,14 @@ + return ipmi_sel_oem_init((const char *)filename); + } + ++/* Quanta IPMIv2 BMCs use OEM authtype */ ++static int ++ipmi_oem_quanta(struct ipmi_intf * intf) ++{ ++ ipmi_intf_session_set_authtype(intf, IPMI_SESSION_AUTHTYPE_OEM); ++ return 0; ++} ++ + /* ipmi_oem_print - print list of OEM handles + */ + void +--- /dev/null ++++ b/lib/ipmi_quantaoem.c +@@ -0,0 +1,184 @@ ++/* ++ * Copyright (c) 2018 Quanta Computer Inc. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * ++ * Redistribution of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * ++ * Redistribution in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * Neither the name of Quanta Computer Inc. or the names of ++ * contributors may be used to endorse or promote products derived ++ * from this software without specific prior written permission. ++ * ++ * This software is provided "AS IS," without a warranty of any kind. ++ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, ++ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A ++ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. ++ * Quanta Computer Inc. AND ITS LICENSORS SHALL NOT BE LIABLE ++ * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING ++ * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL ++ * Quanta Computer Inc. OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, ++ * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR ++ * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF ++ * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, ++ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ++ */ ++#define _XOPEN_SOURCE ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Max Size of the description String to be displyed for the Each sel entry */ ++#define SIZE_OF_DESC 128 ++ ++#define CPU_SHIFT 6 ++#define CPU_MASK 0X03 ++#define CPU_NUM(x) (((x) >> CPU_SHIFT) & CPU_MASK) ++ ++#define CHANNEL_BASE 0x41 ++#define CHANNEL_SHIFT 3 ++#define CHANNEL_MASK 0x07 ++#define CHANNEL_OFFSET(x) (((x) >> CHANNEL_SHIFT) & CHANNEL_MASK) ++#define CHANNEL_NUM(x) (CHANNEL_BASE + CHANNEL_OFFSET(x)) ++ ++#define DIMM_MASK 0x07 ++#define DIMM_NUM(x) ((x) & DIMM_MASK) ++ ++#define GET_PLATFORM_ID_DATA_SIZE 4 ++ ++// Magic code to check if it's valid command ++#define QCT_MAGIC_1 0x4C ++#define QCT_MAGIC_2 0x1C ++#define QCT_MAGIC_3 0x00 ++#define QCT_MAGIC_4 0x02 ++ ++qct_platform_t ++oem_qct_get_platform_id(struct ipmi_intf *intf) ++{ ++ /* Execute a Get platform ID command to determine the board */ ++ struct ipmi_rs *rsp; ++ struct ipmi_rq req; ++ qct_platform_t platform_id; ++ uint8_t msg_data[GET_PLATFORM_ID_DATA_SIZE]; ++ ++ /* Ask for IPMI v2 data as well */ ++ msg_data[0] = QCT_MAGIC_1; ++ msg_data[1] = QCT_MAGIC_2; ++ msg_data[2] = QCT_MAGIC_3; ++ msg_data[3] = QCT_MAGIC_4; ++ ++ memset(&req, 0, sizeof(req)); ++ req.msg.netfn = OEM_QCT_NETFN; ++ req.msg.cmd = OEM_QCT_GET_INFO; ++ req.msg.data = msg_data; ++ req.msg.data_len = sizeof(msg_data); ++ ++ rsp = intf->sendrecv(intf, &req); ++ if (rsp == NULL) { ++ lprintf(LOG_ERR, "Get Platform ID command failed"); ++ return 0; ++ } ++ if (rsp->ccode) { ++ lprintf(LOG_ERR, "Get Platform ID command failed: %#x %s", ++ rsp->ccode, val2str(rsp->ccode, completion_code_vals)); ++ return 0; ++ } ++ platform_id = rsp->data[0]; ++ lprintf(LOG_DEBUG,"Platform ID: %hhx", rsp->data[0]); ++ return platform_id; ++} ++ ++char * ++oem_qct_get_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec) ++{ ++ struct ipmi_rs *rsp; ++ struct ipmi_rq req; ++ char *desc = NULL; ++ int data; ++ int sensor_type; ++ qct_platform_t platform_id; ++ ++ /* Get the OEM event Bytes of the SEL Records byte 15 to data */ ++ data = rec->sel_type.standard_type.event_data[2]; ++ /* Check for the Standard Event type == 0x6F */ ++ if (rec->sel_type.standard_type.event_type != 0x6F) { ++ goto out; ++ } ++ /* Allocate mem for te Description string */ ++ desc = malloc(SIZE_OF_DESC); ++ if (desc == NULL) { ++ lprintf(LOG_ERR, "ipmitool: malloc failure"); ++ goto out; ++ } ++ memset(desc, 0, SIZE_OF_DESC); ++ sensor_type = rec->sel_type.standard_type.sensor_type; ++ switch (sensor_type) { ++ case SENSOR_TYPE_MEMORY: ++ memset(&req, 0, sizeof (req)); ++ req.msg.netfn = IPMI_NETFN_APP; ++ req.msg.lun = 0; ++ req.msg.cmd = BMC_GET_DEVICE_ID; ++ req.msg.data = NULL; ++ req.msg.data_len = 0; ++ ++ rsp = intf->sendrecv(intf, &req); ++ if (rsp == NULL) { ++ lprintf(LOG_ERR, " Error getting system info"); ++ goto out; ++ } else if (rsp->ccode) { ++ lprintf(LOG_ERR, " Error getting system info: %s", ++ val2str(rsp->ccode, completion_code_vals)); ++ goto out; ++ } ++ /* check the platform type */ ++ platform_id = oem_qct_get_platform_id(intf); ++ if (OEM_QCT_PLATFORM_PURLEY == platform_id) { ++ snprintf(desc, SIZE_OF_DESC, "CPU%d_%c%d", ++ CPU_NUM(data), ++ CHANNEL_NUM(data), ++ DIMM_NUM(data)); ++ } ++ break; ++ default: ++ goto out; ++ } ++ return desc; ++out: ++ if (desc) { ++ free(desc); ++ desc = NULL; ++ } ++ return desc; ++} +--- a/lib/ipmi_sel.c ++++ b/lib/ipmi_sel.c +@@ -50,6 +50,7 @@ + #include + #include + #include ++#include + + extern int verbose; + static int sel_extended = 0; +@@ -1244,6 +1245,9 @@ + case IPMI_OEM_SUPERMICRO_47488: + desc = get_supermicro_evt_desc(intf, rec); + break; ++ case IPMI_OEM_QUANTA: ++ desc = oem_qct_get_evt_desc(intf, rec); ++ break; + case IPMI_OEM_UNKNOWN: + default: + break; +@@ -1349,6 +1353,9 @@ + sfx = ipmi_get_oem_desc(intf, rec); + break; + /* add your oem sensor assignation here */ ++ case IPMI_OEM_QUANTA: ++ sfx = ipmi_get_oem_desc(intf, rec); ++ break; + default: + lprintf(LOG_DEBUG, "oem sensor type %x using standard type supplied description", + rec->sel_type.standard_type.sensor_type ); +@@ -1359,9 +1366,12 @@ + case IPMI_OEM_SUPERMICRO: + case IPMI_OEM_SUPERMICRO_47488: + sfx = ipmi_get_oem_desc(intf, rec); +- break; ++ break; ++ case IPMI_OEM_QUANTA: ++ sfx = ipmi_get_oem_desc(intf, rec); ++ break; + default: +- break; ++ break; + } + } + /* +@@ -1986,9 +1996,12 @@ + case IPMI_OEM_SUPERMICRO: + case IPMI_OEM_SUPERMICRO_47488: + print_sensor = 0; +- break; ++ break; ++ case IPMI_OEM_QUANTA: ++ print_sensor = 0; ++ break; + default: +- break; ++ break; + } + /* + * Sensor-Specific Discrete +--- a/src/ipmitool.c ++++ b/src/ipmitool.c +@@ -66,6 +66,7 @@ + #include + #include + #include ++#include + + #ifdef HAVE_CONFIG_H + # include diff -Nru ipmitool-1.8.18/debian/patches/series ipmitool-1.8.18/debian/patches/series --- ipmitool-1.8.18/debian/patches/series 2019-12-22 18:25:06.000000000 +0000 +++ ipmitool-1.8.18/debian/patches/series 2022-08-03 00:55:42.000000000 +0000 @@ -11,3 +11,4 @@ 0125-nvidia-iana.patch 0615-manpage_typo.patch 0130-Correct_lanplus_segment_violation.patch +add_basic_support_for_quanta.patch