1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
Description: do not abort if sensor command fails
Origin: upstream
Bug: https://github.com/arcress0/ipmiutil/issues/17
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040349
Forwarded: no
Last-Update: 2023-07-09
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: trunk/util/isensor.c
===================================================================
--- trunk.orig/util/isensor.c
+++ trunk/util/isensor.c
@@ -1332,13 +1332,14 @@ int GetSDR(int r_id, int *r_next, uchar
if (sresp < (thislen+2)) {
/* There are some SDRs that may report the wrong length, and
* return less bytes than they reported, so just truncate. */
+ fprintf(stderr,"SDR record %x is malformed, length %d is less than minimum %d\n",r_id,sresp,thislen+2);
if (fdebug) printf("sdr[%x] off=%d, expected %d, got %d\n",
r_id,off,thislen+2,sresp);
if (sresp >= 2) thislen = sresp - 2;
else thislen = 0;
reclen = off + thislen; /* truncate, stop reading */
- fprintf(stderr,"SDR record %x is malformed, length %d is less than minimum %d\n",r_id,sresp,thislen+2);
- rc = ERR_SDR_MALFORMED;
+ /* auto-corrected, so not a fatal error */
+ // rc = ERR_SDR_MALFORMED;
}
/* successful */
memcpy(&resp[off],&respchunk[2],thislen);
Index: trunk/doc/ipmiutil.spec
===================================================================
--- trunk.orig/doc/ipmiutil.spec
+++ trunk/doc/ipmiutil.spec
@@ -210,6 +210,10 @@ rm -rf %{buildroot}
vardir=%{_var}/lib/%{name}
scr_dir=%{_datadir}/%{name}
+if [ ! -f %{_datadir}/%{name}/ipmiutil.env ]; then
+ cp %{_datadir}/%{name}/ipmiutil.env.template %{_datadir}/%{name}/ipmiutil.env
+fi
+
# Install right scripts/service files no matter install or upgrade
%if 0%{?req_systemd}
%service_add_post ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
@@ -217,9 +221,6 @@ scr_dir=%{_datadir}/%{name}
if [ -x /bin/systemctl ] && [ -d %{unit_dir} ]; then
# Replace if exists, append if not.
# Use # as the sed delimiter to prevent handling slash in the path.
- if [ ! -f %{_datadir}/%{name}/ipmiutil.env ]; then
- cp %{_datadir}/%{name}/ipmiutil.env.template %{_datadir}/%{name}/ipmiutil.env
- fi
grep -q 'IINITDIR' %{_datadir}/%{name}/ipmiutil.env \
&& sed -i 's#^IINITDIR=.*#IINITDIR=%{init_dir}#' %{_datadir}/%{name}/ipmiutil.env \
|| echo "IINITDIR=%{init_dir}" >> %{_datadir}/%{name}/ipmiutil.env
@@ -274,8 +275,9 @@ then
# Capture a snapshot of IPMI sensor data once now for later reuse.
sensorout=$vardir/sensor_out.txt
if [ ! -f $sensorout ]; then
- %{_bindir}/ipmiutil sensor -q >$sensorout || :
- if [ $? -ne 0 ]; then
+ IPMIret=1
+ %{_bindir}/ipmiutil sensor -q >$sensorout && IPMIret=0
+ if [ $IPMIret -ne 0 ]; then
# remove file if error, try again in ipmi_port on reboot.
rm -f $sensorout
fi
|