The choice of > or < when printing the threshold inequality currently
only depends on whether it is an upper or lower threshold. This is
correct when the event is asserted, but when the event is deasserted the
inequality is reversed and therefore the current code can give confusing
results, e.g.:
```
Temperature ps1_inlet_temp |
Upper Non-critical going high |
Deasserted |
Reading 43.94 > Threshold 44.88 degrees C
```
This commit fixes that.
See ipmitool/ipmitool#349
Signed-off-by: Andy Clegg <andyc@graphcore.ai>
The default cipher suite has been changed earlier in commit
7772254b62826b894ca629df8c597030a98f4f72, and the manual has been
then updated by commit 50479484a2268d3c9d525ceed729c1faed7244b6,
but it turned out that the description of the -C option was
not affected by the update.
Also, a typo was found as the cipher suites are listed in IPMI v2.0
specification Table 22-20, not 22-19 as stated in the manual.
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
Add 'soft reset' and 'power-up by RTC wakeup' causes
from IPMI 2.0 spec.
Resolvesipmitool/ipmitool#329
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
There is no need to reserve SEL when doing "sel list" and "sel get"
since we don't do partial get in both commands, and we didn't even use
the reservation ID returned by "Reserve SEL".
Signed-off-by: Bing-Hua Wang <binghuawang@ami.com>
GitHub has removed support for ubuntu 16.04 virtual environment
since Sep 20, 2021. We just follow.
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
The IPM_DEV_FWREV1_MAJOR_MASK was incorrectly defined as 0x3F.
The spec indicates that the major firmware revision has 0~6 valid bits,
so the mask shall be 0x7F.
Tested: Verify a BMC that has a major version that is large than 0x3F,
and ipmitool shows the correct major version.
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Both 'Set/Get LAN Configuration Parameter' commands may return
command-specific codes that weren't properly parsed and were
reported as 'Unknown' before. This is fixed now.
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
Modify the documentation to reflect commit 7772254b ("lanplus: Auto-select
'best' cipher suite available") which changed the default cipher suite for
lanplus from 3 to 17
The length of internal use area printed by ekanalyzer
didn't take in account the version byte.
The data printed was also 1 byte longer than needed.
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
When there was no chassis and board areas, the internal use
are size was calculated incorrectly.
Additionally, it is possible that the internal area is actually
located after all other areas or that areas are arranged in
a different order than their offsets in the header. All those
cases weren't properly handled.
Now that is fixed.
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
There was a wrong offset for the "Power Supply Inactive" flag,
hence the trigger on this event type could not be set.
Resolvesipmitool/ipmitool#280
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
- Add ubuntu-20.04 target
- Disable building of Solaris-specific `bmc` interface on Ubuntu
- Rename `ubuntu` matrix to `linux`
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
GitHub machines sometimes aren't immediately updated after
Ubuntu repos update. That leads to failed CI builds due
to inability to install some packages.
Add a call to `apt update` to update the package database
before installing anything.
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
Move #ifdef from the inside to the outside of assert()'s
to get rid of this compiler warning:
warning: embedding a directive within macro arguments has undefined
behavior [-Wembedded-directive]
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
Refactor plugin ipmi_intf structure initialization for some
plugins to stop the compiler complaining like this:
warning: use of GNU old-style field designator
extension [-Wgnu-designator]
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
GitHub Actions macOS environment now has Xcode 12.0.1. [1]
Xcode 12 Clang enables -Werror=implicit-function-declaration by
default [2] and breaks the ipmitool build on macOS. [3]
[1] https://github.com/actions/virtual-environments/issues/1712
[2] https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes
"Clang now reports an error when you use a function without an
explicit declaration when building C or Objective-C code for macOS
(-Werror=implicit-function-declaration flag is on)."
[3] https://github.com/ipmitool/ipmitool/pull/252/checks?check_run_id=1389463134
"checking for ld used by gcc... /Applications/Xcode_12.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
<snip>
free.c:66:13: error: implicit declaration of function 'getuid' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (getuid() != 0) {
^
free.c:170:26: error: implicit declaration of function 'ipmi_get_oem' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
intf->manufacturer_id = ipmi_get_oem(intf);"
^
Signed-off-by: Bing-Hua Wang <binghuawang@ami.com>
Some of the header guard names in ipmitool duplicated with the ones in
freeipmi.
* ipmitool/ipmi_fru.h and freeipmi/fru/ipmi-fru.h both uses IPMI_FRU_H
* ipmitool/ipmi_sdr.h and freeipmi/sdr/ipmi-sdr.h both uses IPMI_SDR_H
* ipmitool/ipmi_sel.h and freeipmi/sel/ipmi-sel.h both uses IPMI_SEL_H
This is problematic as including the 1st will prevent the 2nd from being
included, leading to the loss of any declarations, inline definitions,
or other "#includes" in the 2nd header.
For example, including ipmitool/ipmi_sel.h and freeipmi/freeipmi.h fails
to build.
$ cat test.c
#include <ipmitool/ipmi_sel.h>
#include <freeipmi/freeipmi.h>
$ gcc test.c -I${HOME}/src/oss/ipmitool/include
In file included from /usr/include/freeipmi/freeipmi.h:90,
from test.c:2:
/usr/include/freeipmi/sdr/oem/ipmi-sdr-oem-intel-node-manager.h:48:44: error: unknown type name 'ipmi_sdr_ctx_t'; did you mean 'ipmi_fru_ctx_t'?
48 | int ipmi_sdr_oem_parse_intel_node_manager (ipmi_sdr_ctx_t ctx,
| ^~~~~~~~~~~~~~
| ipmi_fru_ctx_t
Remove header guards and use "#pragma once" instead. In this way, we
don't have to do manual management to avoid name clashes.
* src/plugins/lan/md5.h is left as is being an external header
originally.
* src/plugins/imb/imbapi.h is a convoluted header consisting of multiple
header guards. Let's just add "#pragma once" and leave header guards
as is for now.
Signed-off-by: Bing-Hua Wang <binghuawang@ami.com>
The following commands is used on Linux to convert line endings to LF.
git config core.autocrlf input
git add --renormalize .
git config --unset core.autocrlf
It turns out there was only ipmi_kontronoem.h not using LF.
Signed-off-by: Bing-Hua Wang <binghuawang@ami.com>
This patch has been added to fix "error: comparison between signed
and unsigned integer expressions [-Werror=sign-compare]"
Signed-off-by: Shitalkumar Gandhi <shitalkumar.gandhi@seagate.com>
When building an RPM, --with-kerneldir is passed to ./configure. This adds
the include path /lib/modules/<kversion>/build/include that may break the
build but is not present when building with "make" so useless.
For instance while building ipmi_sel.c with kernel 5.3.7-301.fc31.x86_64 :
/lib/modules/5.3.7-301.fc31.x86_64/build/include/linux/stddef.h:11:2: error:
expected identifier before numeric constant
11 | false = 0,
| ^~~~~
Signed-off-by: Gilles Buloz <gilles.buloz@kontron.com>
imbapi.c:1393:52: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
lprintf(LOG_DEBUG, "%s: munmap(0x%x,%d) success", __FUNCTION__,
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
- Drop a useless `extern` definition
- Remove static variable `errorCount` from header, move it to
the c file where it is actually used if needed
Related to ipmitool/ipmitool#220
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
Fix calculation of the buffer size for decoded 6-bit ASCII
strings. Previously the program could allocate too a short buffer
that caused buffer overflows and segmentation fault crashes on
certain FRU contents.
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
Restore using strncmp() for "options=" and similar
substrings.
Resolvesipmitool/ipmitool#223
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
- Initialize the log at the start of ipmi_main() to allow for proper
logging at the start;
- Remove the unused log_level_get() function;
- Update log_level_set() to take verbosity instead of log level
(default verbosity is 0, which is LOG_NOTICE log level),
use the function to update log level as `-v` is encountered
in command line;
- Move IANA PEN list debugging to verbosity 6. The list is too long
to see it in each debug output of verbosity 5 that is used for
debugging lan/lanplus packets;
- For verbosity >= 2 (that is `-vv`) add the ipmitool version
information at the start.
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
Simplified target "rpm" of Makefile, and removed rpmrc and rpmmacros to use
default settings and those from the spec file such as Distribution that has
been changed to "GitHub Build" instead of "Sourceforge Build".
Signed-off-by: Gilles Buloz <gilles.buloz@kontron.com>
The command "make rpm" was failing for the following reasons :
- setting the build directory to ./rpmbuild/ instead of default
~/rpmbuild/ was ignored.
- errors in the spec file : wrong dates and characters in the
changelog, and unpackaged files under misc/*
- debug package built even if unneeded but failing to build because
of missing requisites.
Using "rpmbuild -tb ipmitool-*.tar.gz" instead of 'make rpm" builds
under ~/rpmbuild/ but also fails because of the last two reasons.
Signed-off-by: Gilles Buloz <gilles.buloz@kontron.com>