Merge ~bryce/ubuntu/+source/ipmitool:merge-v1.8.18-11-impish into ubuntu/+source/ipmitool:debian/sid
- Git
- lp:~bryce/ubuntu/+source/ipmitool
- merge-v1.8.18-11-impish
- Merge into debian/sid
Status: | Merged |
---|---|
Approved by: | Utkarsh Gupta |
Approved revision: | bd4b8bd9b19e7b751320bc99a4c64e5f6668a226 |
Merge reported by: | Bryce Harrington |
Merged at revision: | bd4b8bd9b19e7b751320bc99a4c64e5f6668a226 |
Proposed branch: | ~bryce/ubuntu/+source/ipmitool:merge-v1.8.18-11-impish |
Merge into: | ubuntu/+source/ipmitool:debian/sid |
Diff against target: |
464 lines (+423/-1) 4 files modified
debian/changelog (+16/-0) debian/control (+2/-1) debian/patches/add_basic_support_for_quanta.patch (+404/-0) debian/patches/series (+1/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Utkarsh Gupta (community) | Approve | ||
Canonical Server packageset reviewers | Pending | ||
Canonical Server | Pending | ||
Review via email: mp+408249@code.launchpad.net |
Commit message
Description of the change
Bryce Harrington (bryce) wrote : | # |
Utkarsh Gupta (utkarsh) wrote : | # |
+1, looks good. Thanks! \o/
Bryce Harrington (bryce) wrote : | # |
Thanks for the review! Pushed:
$ debuild -S $(git ubuntu push-for-upload)
Everything up-to-date
dpkg-buildpackage -us -uc -ui -i -I.bzr -I.svn -I.git -S --changes-
...
fixup_buildinfo ipmitool_
signfile buildinfo ipmitool_
fixup_changes dsc ipmitool_
fixup_changes buildinfo ipmitool_
signfile changes ipmitool_
Successfully signed dsc, buildinfo, changes files
$ dput ubuntu ipmitool_
D: Setting host argument.
Checking signature on .changes
gpg: /home/bryce/
Checking signature on .dsc
gpg: /home/bryce/
Uploading to ubuntu (via ftp to upload.ubuntu.com):
Uploading ipmitool_
Uploading ipmitool_
Uploading ipmitool_
Uploading ipmitool_
Successfully uploaded packages.
On Wed, Sep 08, 2021 at 03:30:28AM -0000, Utkarsh Gupta wrote:
> The proposal to merge ~bryce/
>
> Status: Needs review => Approved
>
> For more details, see:
> https:/
> --
> You are the owner of ~bryce/
Bryce Harrington (bryce) wrote : | # |
This has migrated successfully.
- Source Package: ipmitool
- Current Version: 1.8.18-11ubuntu1
- New Version: 1.8.18-11ubuntu1
- Migrated: True
- Requester: Bryce Harrington
Preview Diff
1 | diff --git a/debian/changelog b/debian/changelog | |||
2 | index c08965e..88e3b8a 100644 | |||
3 | --- a/debian/changelog | |||
4 | +++ b/debian/changelog | |||
5 | @@ -1,3 +1,11 @@ | |||
6 | 1 | ipmitool (1.8.18-11ubuntu1) impish; urgency=medium | ||
7 | 2 | |||
8 | 3 | * Merge with Debian unstable. Remaining changes: | ||
9 | 4 | - d/p/add_basic_support_for_quanta.patch: Add basic support for Quanta | ||
10 | 5 | (LP #1864612) | ||
11 | 6 | |||
12 | 7 | -- Bryce Harrington <bryce@canonical.com> Tue, 07 Sep 2021 16:37:41 -0700 | ||
13 | 8 | |||
14 | 1 | ipmitool (1.8.18-11) unstable; urgency=medium | 9 | ipmitool (1.8.18-11) unstable; urgency=medium |
15 | 2 | 10 | ||
16 | 3 | * Remove useless debian/ipmitool.lintian-overrides. | 11 | * Remove useless debian/ipmitool.lintian-overrides. |
17 | @@ -12,6 +20,14 @@ ipmitool (1.8.18-11) unstable; urgency=medium | |||
18 | 12 | 20 | ||
19 | 13 | -- Jörg Frings-Fürst <debian@jff.email> Sun, 22 Aug 2021 21:15:52 +0200 | 21 | -- Jörg Frings-Fürst <debian@jff.email> Sun, 22 Aug 2021 21:15:52 +0200 |
20 | 14 | 22 | ||
21 | 23 | ipmitool (1.8.18-10.1ubuntu1) impish; urgency=medium | ||
22 | 24 | |||
23 | 25 | * d/p/add_basic_support_for_quanta.patch: Add basic support for Quanta | ||
24 | 26 | - Enables support for IPMI events on Quanta Server hardware | ||
25 | 27 | (LP: #1864612) | ||
26 | 28 | |||
27 | 29 | -- Bryce Harrington <bryce@canonical.com> Wed, 30 Jun 2021 17:19:24 -0700 | ||
28 | 30 | |||
29 | 15 | ipmitool (1.8.18-10.1) unstable; urgency=high | 31 | ipmitool (1.8.18-10.1) unstable; urgency=high |
30 | 16 | 32 | ||
31 | 17 | * Non-maintainer upload. | 33 | * Non-maintainer upload. |
32 | diff --git a/debian/control b/debian/control | |||
33 | index 06e676a..a601e19 100644 | |||
34 | --- a/debian/control | |||
35 | +++ b/debian/control | |||
36 | @@ -1,7 +1,8 @@ | |||
37 | 1 | Source: ipmitool | 1 | Source: ipmitool |
38 | 2 | Section: utils | 2 | Section: utils |
39 | 3 | Priority: optional | 3 | Priority: optional |
41 | 4 | Maintainer: Jörg Frings-Fürst <debian@jff.email> | 4 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
42 | 5 | XSBC-Original-Maintainer: Jörg Frings-Fürst <debian@jff.email> | ||
43 | 5 | Build-Depends: | 6 | Build-Depends: |
44 | 6 | debhelper-compat (= 13), | 7 | debhelper-compat (= 13), |
45 | 7 | init-system-helpers (>= 1.58), | 8 | init-system-helpers (>= 1.58), |
46 | diff --git a/debian/patches/add_basic_support_for_quanta.patch b/debian/patches/add_basic_support_for_quanta.patch | |||
47 | 8 | new file mode 100644 | 9 | new file mode 100644 |
48 | index 0000000..345b39a | |||
49 | --- /dev/null | |||
50 | +++ b/debian/patches/add_basic_support_for_quanta.patch | |||
51 | @@ -0,0 +1,404 @@ | |||
52 | 1 | From 5c033c06abb45bc183f42cd758c61807ce953726 Mon Sep 17 00:00:00 2001 | ||
53 | 2 | From: qctbmc <qct.bmc@gmail.com> | ||
54 | 3 | Date: Tue, 10 Jul 2018 11:21:55 +0800 | ||
55 | 4 | Subject: [PATCH] oem: Add basic support for Quanta | ||
56 | 5 | |||
57 | 6 | --- | ||
58 | 7 | include/ipmitool/Makefile.am | 2 +- | ||
59 | 8 | include/ipmitool/ipmi_quantaoem.h | 55 +++++++++ | ||
60 | 9 | lib/Makefile.am | 2 +- | ||
61 | 10 | lib/ipmi_main.c | 1 + | ||
62 | 11 | lib/ipmi_oem.c | 14 +++ | ||
63 | 12 | lib/ipmi_quantaoem.c | 184 ++++++++++++++++++++++++++++++ | ||
64 | 13 | lib/ipmi_sel.c | 21 +++- | ||
65 | 14 | src/ipmitool.c | 1 + | ||
66 | 15 | 8 files changed, 274 insertions(+), 6 deletions(-) | ||
67 | 16 | create mode 100644 include/ipmitool/ipmi_quantaoem.h | ||
68 | 17 | create mode 100644 lib/ipmi_quantaoem.c | ||
69 | 18 | |||
70 | 19 | Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ipmitool/+bug/1864612 | ||
71 | 20 | Origin: upstream, https://github.com/ipmitool/ipmitool/commit/5c033c06abb45bc183f42cd758c61807ce953726 | ||
72 | 21 | Applied-Upstream: 1.8.19, commit:5c033c06abb45bc183f42cd758c61807ce953726 | ||
73 | 22 | Reviewed-By: Bryce Harrington <bryce@canonical.com> | ||
74 | 23 | |||
75 | 24 | --- a/include/ipmitool/Makefile.am | ||
76 | 25 | +++ b/include/ipmitool/Makefile.am | ||
77 | 26 | @@ -39,4 +39,4 @@ | ||
78 | 27 | ipmi_fwum.h ipmi_main.h ipmi_tsol.h ipmi_firewall.h \ | ||
79 | 28 | ipmi_kontronoem.h ipmi_ekanalyzer.h ipmi_gendev.h ipmi_ime.h \ | ||
80 | 29 | ipmi_delloem.h ipmi_dcmi.h ipmi_vita.h ipmi_sel_supermicro.h \ | ||
81 | 30 | - ipmi_cfgp.h ipmi_lanp6.h | ||
82 | 31 | + ipmi_cfgp.h ipmi_lanp6.h ipmi_quantaoem.h | ||
83 | 32 | --- /dev/null | ||
84 | 33 | +++ b/include/ipmitool/ipmi_quantaoem.h | ||
85 | 34 | @@ -0,0 +1,55 @@ | ||
86 | 35 | +/* | ||
87 | 36 | + * Copyright (c) 2018 Quanta Computer Inc. All rights reserved. | ||
88 | 37 | + * | ||
89 | 38 | + * Redistribution and use in source and binary forms, with or without | ||
90 | 39 | + * modification, are permitted provided that the following conditions | ||
91 | 40 | + * are met: | ||
92 | 41 | + * | ||
93 | 42 | + * Redistribution of source code must retain the above copyright | ||
94 | 43 | + * notice, this list of conditions and the following disclaimer. | ||
95 | 44 | + * | ||
96 | 45 | + * Redistribution in binary form must reproduce the above copyright | ||
97 | 46 | + * notice, this list of conditions and the following disclaimer in the | ||
98 | 47 | + * documentation and/or other materials provided with the distribution. | ||
99 | 48 | + * | ||
100 | 49 | + * Neither the name of Quanta Computer Inc. or the names of | ||
101 | 50 | + * contributors may be used to endorse or promote products derived | ||
102 | 51 | + * from this software without specific prior written permission. | ||
103 | 52 | + * | ||
104 | 53 | + * This software is provided "AS IS," without a warranty of any kind. | ||
105 | 54 | + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, | ||
106 | 55 | + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A | ||
107 | 56 | + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. | ||
108 | 57 | + * Quanta Computer Inc. AND ITS LICENSORS SHALL NOT BE LIABLE | ||
109 | 58 | + * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING | ||
110 | 59 | + * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL | ||
111 | 60 | + * Quanta Computer Inc. OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, | ||
112 | 61 | + * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR | ||
113 | 62 | + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF | ||
114 | 63 | + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, | ||
115 | 64 | + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | ||
116 | 65 | + */ | ||
117 | 66 | + | ||
118 | 67 | +#ifndef IPMI_QUANTAOEM_H | ||
119 | 68 | +#define IPMI_QUANTAOEM_H | ||
120 | 69 | + | ||
121 | 70 | +#if HAVE_CONFIG_H | ||
122 | 71 | +# include <config.h> | ||
123 | 72 | +#endif | ||
124 | 73 | +#include <ipmitool/ipmi.h> | ||
125 | 74 | +#include <ipmitool/ipmi_sdr.h> | ||
126 | 75 | + | ||
127 | 76 | +#define OEM_QCT_NETFN 0x36 | ||
128 | 77 | +#define OEM_QCT_GET_INFO 0x65 | ||
129 | 78 | + | ||
130 | 79 | +typedef enum | ||
131 | 80 | +{ | ||
132 | 81 | + OEM_QCT_PLATFORM_UNKNOWN = 0, | ||
133 | 82 | + OEM_QCT_PLATFORM_GRANTLEY, | ||
134 | 83 | + OEM_QCT_PLATFORM_PURLEY | ||
135 | 84 | +} qct_platform_t; | ||
136 | 85 | + | ||
137 | 86 | +qct_platform_t oem_qct_get_platform_id(struct ipmi_intf *intf); | ||
138 | 87 | +char *oem_qct_get_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec); | ||
139 | 88 | + | ||
140 | 89 | +#endif /*IPMI_QUANTAOEM_H*/ | ||
141 | 90 | --- a/lib/Makefile.am | ||
142 | 91 | +++ b/lib/Makefile.am | ||
143 | 92 | @@ -41,7 +41,7 @@ | ||
144 | 93 | ipmi_main.c ipmi_tsol.c ipmi_firewall.c ipmi_kontronoem.c \ | ||
145 | 94 | ipmi_hpmfwupg.c ipmi_sdradd.c ipmi_ekanalyzer.c ipmi_gendev.c \ | ||
146 | 95 | ipmi_ime.c ipmi_delloem.c ipmi_dcmi.c hpm2.c ipmi_vita.c \ | ||
147 | 96 | - ipmi_lanp6.c ipmi_cfgp.c \ | ||
148 | 97 | + ipmi_lanp6.c ipmi_cfgp.c ipmi_quantaoem.c \ | ||
149 | 98 | ../src/plugins/lan/md5.c ../src/plugins/lan/md5.h | ||
150 | 99 | |||
151 | 100 | libipmitool_la_LDFLAGS = -export-dynamic | ||
152 | 101 | --- a/lib/ipmi_main.c | ||
153 | 102 | +++ b/lib/ipmi_main.c | ||
154 | 103 | @@ -76,6 +76,7 @@ | ||
155 | 104 | #include <ipmitool/ipmi_picmg.h> | ||
156 | 105 | #include <ipmitool/ipmi_kontronoem.h> | ||
157 | 106 | #include <ipmitool/ipmi_vita.h> | ||
158 | 107 | +#include <ipmitool/ipmi_quantaoem.h> | ||
159 | 108 | |||
160 | 109 | #ifdef HAVE_CONFIG_H | ||
161 | 110 | # include <config.h> | ||
162 | 111 | --- a/lib/ipmi_oem.c | ||
163 | 112 | +++ b/lib/ipmi_oem.c | ||
164 | 113 | @@ -39,6 +39,7 @@ | ||
165 | 114 | |||
166 | 115 | static int ipmi_oem_supermicro(struct ipmi_intf * intf); | ||
167 | 116 | static int ipmi_oem_ibm(struct ipmi_intf * intf); | ||
168 | 117 | +static int ipmi_oem_quanta(struct ipmi_intf * intf); | ||
169 | 118 | |||
170 | 119 | static struct ipmi_oem_handle ipmi_oem_list[] = { | ||
171 | 120 | { | ||
172 | 121 | @@ -71,6 +72,11 @@ | ||
173 | 122 | .name = "kontron", | ||
174 | 123 | .desc = "Kontron OEM big buffer support" | ||
175 | 124 | }, | ||
176 | 125 | + { | ||
177 | 126 | + .name = "quanta", | ||
178 | 127 | + .desc = "Quanta IPMIv1.5 BMC with OEM LAN authentication support", | ||
179 | 128 | + .setup = ipmi_oem_quanta, | ||
180 | 129 | + }, | ||
181 | 130 | { 0 } | ||
182 | 131 | }; | ||
183 | 132 | |||
184 | 133 | @@ -93,6 +99,14 @@ | ||
185 | 134 | return ipmi_sel_oem_init((const char *)filename); | ||
186 | 135 | } | ||
187 | 136 | |||
188 | 137 | +/* Quanta IPMIv2 BMCs use OEM authtype */ | ||
189 | 138 | +static int | ||
190 | 139 | +ipmi_oem_quanta(struct ipmi_intf * intf) | ||
191 | 140 | +{ | ||
192 | 141 | + ipmi_intf_session_set_authtype(intf, IPMI_SESSION_AUTHTYPE_OEM); | ||
193 | 142 | + return 0; | ||
194 | 143 | +} | ||
195 | 144 | + | ||
196 | 145 | /* ipmi_oem_print - print list of OEM handles | ||
197 | 146 | */ | ||
198 | 147 | void | ||
199 | 148 | --- /dev/null | ||
200 | 149 | +++ b/lib/ipmi_quantaoem.c | ||
201 | 150 | @@ -0,0 +1,184 @@ | ||
202 | 151 | +/* | ||
203 | 152 | + * Copyright (c) 2018 Quanta Computer Inc. All rights reserved. | ||
204 | 153 | + * | ||
205 | 154 | + * Redistribution and use in source and binary forms, with or without | ||
206 | 155 | + * modification, are permitted provided that the following conditions | ||
207 | 156 | + * are met: | ||
208 | 157 | + * | ||
209 | 158 | + * Redistribution of source code must retain the above copyright | ||
210 | 159 | + * notice, this list of conditions and the following disclaimer. | ||
211 | 160 | + * | ||
212 | 161 | + * Redistribution in binary form must reproduce the above copyright | ||
213 | 162 | + * notice, this list of conditions and the following disclaimer in the | ||
214 | 163 | + * documentation and/or other materials provided with the distribution. | ||
215 | 164 | + * | ||
216 | 165 | + * Neither the name of Quanta Computer Inc. or the names of | ||
217 | 166 | + * contributors may be used to endorse or promote products derived | ||
218 | 167 | + * from this software without specific prior written permission. | ||
219 | 168 | + * | ||
220 | 169 | + * This software is provided "AS IS," without a warranty of any kind. | ||
221 | 170 | + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, | ||
222 | 171 | + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A | ||
223 | 172 | + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. | ||
224 | 173 | + * Quanta Computer Inc. AND ITS LICENSORS SHALL NOT BE LIABLE | ||
225 | 174 | + * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING | ||
226 | 175 | + * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL | ||
227 | 176 | + * Quanta Computer Inc. OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, | ||
228 | 177 | + * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR | ||
229 | 178 | + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF | ||
230 | 179 | + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, | ||
231 | 180 | + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | ||
232 | 181 | + */ | ||
233 | 182 | +#define _XOPEN_SOURCE | ||
234 | 183 | + | ||
235 | 184 | +#include <stdlib.h> | ||
236 | 185 | +#include <stdio.h> | ||
237 | 186 | +#include <string.h> | ||
238 | 187 | +#include <strings.h> | ||
239 | 188 | +#include <sys/socket.h> | ||
240 | 189 | +#include <netinet/in.h> | ||
241 | 190 | +#include <arpa/inet.h> | ||
242 | 191 | +#include <errno.h> | ||
243 | 192 | +#include <time.h> | ||
244 | 193 | +#include <unistd.h> | ||
245 | 194 | +#include <signal.h> | ||
246 | 195 | +#include <ctype.h> | ||
247 | 196 | +#include <sys/time.h> | ||
248 | 197 | +#include <limits.h> | ||
249 | 198 | +#include <fcntl.h> | ||
250 | 199 | +#include <sys/select.h> | ||
251 | 200 | +#include <termios.h> | ||
252 | 201 | +#include <ipmitool/ipmi.h> | ||
253 | 202 | +#include <ipmitool/ipmi_mc.h> | ||
254 | 203 | +#include <ipmitool/ipmi_intf.h> | ||
255 | 204 | +#include <ipmitool/helper.h> | ||
256 | 205 | +#include <ipmitool/log.h> | ||
257 | 206 | +#include <ipmitool/ipmi_sel.h> | ||
258 | 207 | +#include <ipmitool/ipmi_sdr.h> | ||
259 | 208 | +#include <ipmitool/ipmi_strings.h> | ||
260 | 209 | +#include <ipmitool/ipmi_channel.h> | ||
261 | 210 | +#include <ipmitool/ipmi_quantaoem.h> | ||
262 | 211 | +#include <ipmitool/ipmi_raw.h> | ||
263 | 212 | + | ||
264 | 213 | +/* Max Size of the description String to be displyed for the Each sel entry */ | ||
265 | 214 | +#define SIZE_OF_DESC 128 | ||
266 | 215 | + | ||
267 | 216 | +#define CPU_SHIFT 6 | ||
268 | 217 | +#define CPU_MASK 0X03 | ||
269 | 218 | +#define CPU_NUM(x) (((x) >> CPU_SHIFT) & CPU_MASK) | ||
270 | 219 | + | ||
271 | 220 | +#define CHANNEL_BASE 0x41 | ||
272 | 221 | +#define CHANNEL_SHIFT 3 | ||
273 | 222 | +#define CHANNEL_MASK 0x07 | ||
274 | 223 | +#define CHANNEL_OFFSET(x) (((x) >> CHANNEL_SHIFT) & CHANNEL_MASK) | ||
275 | 224 | +#define CHANNEL_NUM(x) (CHANNEL_BASE + CHANNEL_OFFSET(x)) | ||
276 | 225 | + | ||
277 | 226 | +#define DIMM_MASK 0x07 | ||
278 | 227 | +#define DIMM_NUM(x) ((x) & DIMM_MASK) | ||
279 | 228 | + | ||
280 | 229 | +#define GET_PLATFORM_ID_DATA_SIZE 4 | ||
281 | 230 | + | ||
282 | 231 | +// Magic code to check if it's valid command | ||
283 | 232 | +#define QCT_MAGIC_1 0x4C | ||
284 | 233 | +#define QCT_MAGIC_2 0x1C | ||
285 | 234 | +#define QCT_MAGIC_3 0x00 | ||
286 | 235 | +#define QCT_MAGIC_4 0x02 | ||
287 | 236 | + | ||
288 | 237 | +qct_platform_t | ||
289 | 238 | +oem_qct_get_platform_id(struct ipmi_intf *intf) | ||
290 | 239 | +{ | ||
291 | 240 | + /* Execute a Get platform ID command to determine the board */ | ||
292 | 241 | + struct ipmi_rs *rsp; | ||
293 | 242 | + struct ipmi_rq req; | ||
294 | 243 | + qct_platform_t platform_id; | ||
295 | 244 | + uint8_t msg_data[GET_PLATFORM_ID_DATA_SIZE]; | ||
296 | 245 | + | ||
297 | 246 | + /* Ask for IPMI v2 data as well */ | ||
298 | 247 | + msg_data[0] = QCT_MAGIC_1; | ||
299 | 248 | + msg_data[1] = QCT_MAGIC_2; | ||
300 | 249 | + msg_data[2] = QCT_MAGIC_3; | ||
301 | 250 | + msg_data[3] = QCT_MAGIC_4; | ||
302 | 251 | + | ||
303 | 252 | + memset(&req, 0, sizeof(req)); | ||
304 | 253 | + req.msg.netfn = OEM_QCT_NETFN; | ||
305 | 254 | + req.msg.cmd = OEM_QCT_GET_INFO; | ||
306 | 255 | + req.msg.data = msg_data; | ||
307 | 256 | + req.msg.data_len = sizeof(msg_data); | ||
308 | 257 | + | ||
309 | 258 | + rsp = intf->sendrecv(intf, &req); | ||
310 | 259 | + if (rsp == NULL) { | ||
311 | 260 | + lprintf(LOG_ERR, "Get Platform ID command failed"); | ||
312 | 261 | + return 0; | ||
313 | 262 | + } | ||
314 | 263 | + if (rsp->ccode) { | ||
315 | 264 | + lprintf(LOG_ERR, "Get Platform ID command failed: %#x %s", | ||
316 | 265 | + rsp->ccode, val2str(rsp->ccode, completion_code_vals)); | ||
317 | 266 | + return 0; | ||
318 | 267 | + } | ||
319 | 268 | + platform_id = rsp->data[0]; | ||
320 | 269 | + lprintf(LOG_DEBUG,"Platform ID: %hhx", rsp->data[0]); | ||
321 | 270 | + return platform_id; | ||
322 | 271 | +} | ||
323 | 272 | + | ||
324 | 273 | +char * | ||
325 | 274 | +oem_qct_get_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec) | ||
326 | 275 | +{ | ||
327 | 276 | + struct ipmi_rs *rsp; | ||
328 | 277 | + struct ipmi_rq req; | ||
329 | 278 | + char *desc = NULL; | ||
330 | 279 | + int data; | ||
331 | 280 | + int sensor_type; | ||
332 | 281 | + qct_platform_t platform_id; | ||
333 | 282 | + | ||
334 | 283 | + /* Get the OEM event Bytes of the SEL Records byte 15 to data */ | ||
335 | 284 | + data = rec->sel_type.standard_type.event_data[2]; | ||
336 | 285 | + /* Check for the Standard Event type == 0x6F */ | ||
337 | 286 | + if (rec->sel_type.standard_type.event_type != 0x6F) { | ||
338 | 287 | + goto out; | ||
339 | 288 | + } | ||
340 | 289 | + /* Allocate mem for te Description string */ | ||
341 | 290 | + desc = malloc(SIZE_OF_DESC); | ||
342 | 291 | + if (desc == NULL) { | ||
343 | 292 | + lprintf(LOG_ERR, "ipmitool: malloc failure"); | ||
344 | 293 | + goto out; | ||
345 | 294 | + } | ||
346 | 295 | + memset(desc, 0, SIZE_OF_DESC); | ||
347 | 296 | + sensor_type = rec->sel_type.standard_type.sensor_type; | ||
348 | 297 | + switch (sensor_type) { | ||
349 | 298 | + case SENSOR_TYPE_MEMORY: | ||
350 | 299 | + memset(&req, 0, sizeof (req)); | ||
351 | 300 | + req.msg.netfn = IPMI_NETFN_APP; | ||
352 | 301 | + req.msg.lun = 0; | ||
353 | 302 | + req.msg.cmd = BMC_GET_DEVICE_ID; | ||
354 | 303 | + req.msg.data = NULL; | ||
355 | 304 | + req.msg.data_len = 0; | ||
356 | 305 | + | ||
357 | 306 | + rsp = intf->sendrecv(intf, &req); | ||
358 | 307 | + if (rsp == NULL) { | ||
359 | 308 | + lprintf(LOG_ERR, " Error getting system info"); | ||
360 | 309 | + goto out; | ||
361 | 310 | + } else if (rsp->ccode) { | ||
362 | 311 | + lprintf(LOG_ERR, " Error getting system info: %s", | ||
363 | 312 | + val2str(rsp->ccode, completion_code_vals)); | ||
364 | 313 | + goto out; | ||
365 | 314 | + } | ||
366 | 315 | + /* check the platform type */ | ||
367 | 316 | + platform_id = oem_qct_get_platform_id(intf); | ||
368 | 317 | + if (OEM_QCT_PLATFORM_PURLEY == platform_id) { | ||
369 | 318 | + snprintf(desc, SIZE_OF_DESC, "CPU%d_%c%d", | ||
370 | 319 | + CPU_NUM(data), | ||
371 | 320 | + CHANNEL_NUM(data), | ||
372 | 321 | + DIMM_NUM(data)); | ||
373 | 322 | + } | ||
374 | 323 | + break; | ||
375 | 324 | + default: | ||
376 | 325 | + goto out; | ||
377 | 326 | + } | ||
378 | 327 | + return desc; | ||
379 | 328 | +out: | ||
380 | 329 | + if (desc) { | ||
381 | 330 | + free(desc); | ||
382 | 331 | + desc = NULL; | ||
383 | 332 | + } | ||
384 | 333 | + return desc; | ||
385 | 334 | +} | ||
386 | 335 | --- a/lib/ipmi_sel.c | ||
387 | 336 | +++ b/lib/ipmi_sel.c | ||
388 | 337 | @@ -50,6 +50,7 @@ | ||
389 | 338 | #include <ipmitool/ipmi_fru.h> | ||
390 | 339 | #include <ipmitool/ipmi_sensor.h> | ||
391 | 340 | #include <ipmitool/ipmi_strings.h> | ||
392 | 341 | +#include <ipmitool/ipmi_quantaoem.h> | ||
393 | 342 | |||
394 | 343 | extern int verbose; | ||
395 | 344 | static int sel_extended = 0; | ||
396 | 345 | @@ -1244,6 +1245,9 @@ | ||
397 | 346 | case IPMI_OEM_SUPERMICRO_47488: | ||
398 | 347 | desc = get_supermicro_evt_desc(intf, rec); | ||
399 | 348 | break; | ||
400 | 349 | + case IPMI_OEM_QUANTA: | ||
401 | 350 | + desc = oem_qct_get_evt_desc(intf, rec); | ||
402 | 351 | + break; | ||
403 | 352 | case IPMI_OEM_UNKNOWN: | ||
404 | 353 | default: | ||
405 | 354 | break; | ||
406 | 355 | @@ -1349,6 +1353,9 @@ | ||
407 | 356 | sfx = ipmi_get_oem_desc(intf, rec); | ||
408 | 357 | break; | ||
409 | 358 | /* add your oem sensor assignation here */ | ||
410 | 359 | + case IPMI_OEM_QUANTA: | ||
411 | 360 | + sfx = ipmi_get_oem_desc(intf, rec); | ||
412 | 361 | + break; | ||
413 | 362 | default: | ||
414 | 363 | lprintf(LOG_DEBUG, "oem sensor type %x using standard type supplied description", | ||
415 | 364 | rec->sel_type.standard_type.sensor_type ); | ||
416 | 365 | @@ -1359,9 +1366,12 @@ | ||
417 | 366 | case IPMI_OEM_SUPERMICRO: | ||
418 | 367 | case IPMI_OEM_SUPERMICRO_47488: | ||
419 | 368 | sfx = ipmi_get_oem_desc(intf, rec); | ||
420 | 369 | - break; | ||
421 | 370 | + break; | ||
422 | 371 | + case IPMI_OEM_QUANTA: | ||
423 | 372 | + sfx = ipmi_get_oem_desc(intf, rec); | ||
424 | 373 | + break; | ||
425 | 374 | default: | ||
426 | 375 | - break; | ||
427 | 376 | + break; | ||
428 | 377 | } | ||
429 | 378 | } | ||
430 | 379 | /* | ||
431 | 380 | @@ -1986,9 +1996,12 @@ | ||
432 | 381 | case IPMI_OEM_SUPERMICRO: | ||
433 | 382 | case IPMI_OEM_SUPERMICRO_47488: | ||
434 | 383 | print_sensor = 0; | ||
435 | 384 | - break; | ||
436 | 385 | + break; | ||
437 | 386 | + case IPMI_OEM_QUANTA: | ||
438 | 387 | + print_sensor = 0; | ||
439 | 388 | + break; | ||
440 | 389 | default: | ||
441 | 390 | - break; | ||
442 | 391 | + break; | ||
443 | 392 | } | ||
444 | 393 | /* | ||
445 | 394 | * Sensor-Specific Discrete | ||
446 | 395 | --- a/src/ipmitool.c | ||
447 | 396 | +++ b/src/ipmitool.c | ||
448 | 397 | @@ -66,6 +66,7 @@ | ||
449 | 398 | #include <ipmitool/ipmi_ime.h> | ||
450 | 399 | #include <ipmitool/ipmi_dcmi.h> | ||
451 | 400 | #include <ipmitool/ipmi_vita.h> | ||
452 | 401 | +#include <ipmitool/ipmi_quantaoem.h> | ||
453 | 402 | |||
454 | 403 | #ifdef HAVE_CONFIG_H | ||
455 | 404 | # include <config.h> | ||
456 | diff --git a/debian/patches/series b/debian/patches/series | |||
457 | index 771ac8f..e610f2d 100644 | |||
458 | --- a/debian/patches/series | |||
459 | +++ b/debian/patches/series | |||
460 | @@ -16,3 +16,4 @@ CVE-2020-5208_3-session-Fix-buffer-overflow-in-ipmi_get_session_info.patch | |||
461 | 16 | CVE-2020-5208_4-channel-Fix-buffer-overflow.patch | 16 | CVE-2020-5208_4-channel-Fix-buffer-overflow.patch |
462 | 17 | CVE-2020-5208_5_lanp-Fix-buffer-overflows-in-get_lan_param_select.patch | 17 | CVE-2020-5208_5_lanp-Fix-buffer-overflows-in-get_lan_param_select.patch |
463 | 18 | CVE-2020-5208_6-fru-sdr-Fix-id_string-buffer-overflows.patch | 18 | CVE-2020-5208_6-fru-sdr-Fix-id_string-buffer-overflows.patch |
464 | 19 | add_basic_support_for_quanta.patch |
Straightforward merge that just copies the quanta support patch forward. The debian changes are a single bugfix and some (safe) packaging cleanup changes, no new features.
The quanta patch comes from upstream and we'll get it eventually, so I don't think it's worth trying to push it into Debian.
PPA: https:/ /launchpad. net/~bryce/ +archive/ ubuntu/ ipmitool- merge-v1. 8.18-11