SHA256
1
0
forked from pool/ipmiutil

Accepting request 110809 from systemsmanagement

license update: BSD-3-Clause
SPDX format (forwarded request 110715 from babelworx)

OBS-URL: https://build.opensuse.org/request/show/110809
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ipmiutil?expand=0&rev=5
This commit is contained in:
Stephan Kulow 2012-03-29 05:42:45 +00:00 committed by Git OBS Bridge
parent b9b5b94708
commit e5951676a3
5 changed files with 167 additions and 93 deletions

View File

@ -1,64 +0,0 @@
#
# This fixes a compiler warning, and a lint error.
#
# Signed-off-by: Andy Cress <arcress@users.sourceforge.net>
#
# Index: ipmiutil-2.7.2/util/iekanalyzer.c
# ===================================================================
--- a/ipmiutil-2.7.2/util/iekanalyzer.c
+++ b/ipmiutil-2.7.2/util/iekanalyzer.c
@@ -2661,7 +2661,7 @@ ipmi_ek_display_board_info_area( FILE * input_file, char * board_type,
if (size_board > 0){
if ( strncmp( board_type, "Custom", 6 ) == 0 ){
#define NO_MORE_INFO_FIELD 0xc1
- while ( !feof(input_file) && (board_length > 0) ){
+ while ( !feof(input_file) && (*board_length > 0) ){
if (len != NO_MORE_INFO_FIELD){
printf("Additional Custom Mfg. length: 0x%02x\n", len);
if ( (size_board > 0) && (size_board < (*board_length)) ){
@@ -3057,9 +3057,10 @@ ipmi_ek_display_address_table_record( struct ipmi_ek_multi_header * record )
for ( i = 0; i < entries; i++ ){
printf("\tHWAddr: 0x%02x - SiteNum: 0x%02x - SiteType: 0x%02x \n",
- record->data[offset++],
- record->data[offset++],
- record->data[offset++]);
+ record->data[offset+0],
+ record->data[offset+1],
+ record->data[offset+2]);
+ offset += 3;
}
}
@@ -3180,21 +3181,21 @@ ipmi_ek_display_shelf_ip_connection_record(
int offset = START_DATA_OFFSET;
if (offset > record->header.len){
printf(" Shelf Manager IP Address: %d.%d.%d.%d\n",
- record->data[offset++], record->data[offset++],
- record->data[offset++], record->data[offset++]
- );
+ record->data[offset+0], record->data[offset+1],
+ record->data[offset+2], record->data[offset+3]);
+ offset += 4;
}
if (offset > record->header.len){
printf(" Default Gateway Address: %d.%d.%d.%d\n",
- record->data[offset++], record->data[offset++],
- record->data[offset++], record->data[offset++]
- );
+ record->data[offset+0], record->data[offset+1],
+ record->data[offset+2], record->data[offset+3]);
+ offset += 4;
}
if (offset > record->header.len){
- printf(" Subnet Mask: %d.%d.%d.%d\n", record->data[offset++],
- record->data[offset++], record->data[offset++],
- record->data[offset++]
- );
+ printf(" Subnet Mask: %d.%d.%d.%d\n",
+ record->data[offset+0], record->data[offset+1],
+ record->data[offset+2], record->data[offset+3]);
+ offset += 4;
}
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7d2d346492298e05feec23ed38e5b85bb3796deeeab771153c77236386031555
size 1488164

3
ipmiutil-2.8.2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:16f2181745030ae1e7110bf0c780760d4b2de0a47f9945c9a52314e4ef520988
size 1591876

View File

@ -1,3 +1,26 @@
-------------------------------------------------------------------
Fri Mar 23 08:37:43 UTC 2012 - cfarrell@suse.com
- license update: BSD-3-Clause
SPDX format
-------------------------------------------------------------------
Wed Mar 21 19:09:00 UTC 2012 - arcress@users.sourceforge.net
- added Copyright comment (osc service localrun format_spec_file)
-------------------------------------------------------------------
Mon Mar 12 21:34:50 UTC 2012 - arcress@users.sourceforge.net
- update to upstream ipmiutil-2.8.2
-------------------------------------------------------------------
Sat Dec 24 03:47:50 UTC 2011 - trenn@suse.de
- Update to 2.8.0
- Systemd support
- Details are in the Changelog file in the %doc dir
-------------------------------------------------------------------
Thu Nov 18 14:45:17 UTC 2010 - arcress@users.sourceforge.net

View File

@ -1,7 +1,8 @@
#
# spec file for package ipmiutil (Version 2.7.2)
# spec file for package ipmiutil
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012 Andy Cress
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -18,47 +19,76 @@
Name: ipmiutil
Version: 2.7.2
Release: 1
Summary: A package that provides easy-to-use IPMI server management utilities
License: BSD
Version: 2.8.2
Release: 1%{?dist}
Summary: Easy-to-use IPMI server management utilities
License: BSD-3-Clause
Group: System/Management
Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Url: http://ipmiutil.sourceforge.net
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gcc gcc-c++ openssl-devel
Patch: iekanalyzer_warning.patch
%if 0%{?suse_version} >= 1210
%define req_systemd 1
%endif
%if 0%{?req_systemd}
BuildRequires: gcc gcc-c++ libtool openssl-devel systemd
%define systemd_fls %{_unitdir}
# Requires: %{?systemd_requires}
%else
BuildRequires: gcc gcc-c++ libtool openssl-devel
%define systemd_fls %{_datadir}/%{name}
%endif
# Suggests: cron or vixie-cron or cronie or similar
%define init_dir %{_initrddir}
%description
The ipmiutil package provides easy-to-use utilities to view the SEL,
perform an IPMI chassis reset, set up the IPMI LAN and Platform Event Filter
entries to allow SNMP alerts, and other IPMI tasks.
These can be invoked with the metacommand ipmiutil, or via subcommand
shortcuts as well. Man pages are provided.
The ipmiutil package provides easy-to-use utilities to view the SEL,
perform an IPMI chassis reset, set up the IPMI LAN and Platform Event Filter
entries to allow SNMP alerts, Serial-Over-LAN console, event daemon, and
other IPMI tasks.
These can be invoked with the metacommand ipmiutil, or via subcommand
shortcuts as well. IPMIUTIL can also write sensor thresholds, FRU asset tags,
and has a full IPMI configuration save/restore.
An IPMI driver can be provided by either the OpenIPMI driver (/dev/ipmi0)
or the Intel IPMI driver (/dev/imb), etc. If used locally and no driver is
detected, ipmiutil will use user-space direct I/Os instead.
%package devel
Group: Development/Libraries/C and C++
Summary: The includes headers and static libraries from the ipmiutil package
Requires: ipmiutil
%description devel
The ipmiutil-devel package contains headers and libraries which are
useful for building custom IPMI applications.
%prep
%setup -q
%patch -p2
%build
autoreconf -fiv
%if 0%{?req_systemd}
%configure --enable-systemd
%else
%configure
%endif
make
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
%clean
rm -rf %{buildroot}
%files
%defattr(-, root, root, -)
%dir %{_datadir}/%{name}
%dir %{_var}/lib/%{name}
%{_sbindir}/ipmiutil
%{_sbindir}/idiscover
%{_sbindir}/ievents
%{_bindir}/ipmiutil
%{_bindir}/idiscover
%{_bindir}/ievents
%{_sbindir}/ipmi_port
%{_sbindir}/ialarms
%{_sbindir}/iconfig
@ -77,11 +107,18 @@ make install DESTDIR=%{buildroot}
%{_sbindir}/ifirewall
%{_sbindir}/ifwum
%{_sbindir}/ihpm
%{_initrddir}/ipmiutil_wdt
%{_initrddir}/ipmiutil_asy
%{_initrddir}/ipmiutil_evt
%{_initrddir}/ipmi_port
%{_sysconfdir}/cron.daily/checksel
%{_datadir}/%{name}/ipmiutil_evt
%{_datadir}/%{name}/ipmiutil_asy
%{_datadir}/%{name}/ipmiutil_wdt
%{_datadir}/%{name}/ipmi_port
%{_datadir}/%{name}/checksel
%{systemd_fls}/ipmiutil_evt.service
%{systemd_fls}/ipmiutil_asy.service
%{systemd_fls}/ipmiutil_wdt.service
%{systemd_fls}/ipmi_port.service
%{_datadir}/%{name}/ipmiutil.env
%{_datadir}/%{name}/ipmiutil.pre
%{_datadir}/%{name}/ipmiutil.setup
%{_datadir}/%{name}/ipmi_if.sh
%{_datadir}/%{name}/evt.sh
%{_datadir}/%{name}/bmclanpet.mib
@ -107,12 +144,27 @@ make install DESTDIR=%{buildroot}
%{_mandir}/man8/ifwum.8*
%{_mandir}/man8/ihpm.8*
%{_mandir}/man8/isunoem.8*
%{_mandir}/man8/idelloem.8*
%{_mandir}/man8/iekanalyzer.8*
%{_mandir}/man8/itsol.8*
%{_mandir}/man8/idcmi.8*
%doc AUTHORS ChangeLog COPYING NEWS README TODO
%doc doc/UserGuide
%clean
rm -rf %{buildroot}
%files devel
%defattr(-,root,root)
%{_datadir}/%{name}/ipmicmd.h
%{_datadir}/%{name}/ipmi_sample.c
%{_datadir}/%{name}/Makefile
%{_libdir}/libipmiutil.a
%post devel
/sbin/ldconfig
%pre
%if 0%{?req_systemd}
%service_add_pre ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
%endif
%post
# POST_INSTALL, $1 = 1 if rpm -i, $1 = 2 if rpm -U
@ -121,13 +173,37 @@ if [ "$1" = "1" ]
then
# doing rpm -i, first time
vardir=%{_var}/lib/%{name}
scr_dir=%{_datadir}/%{name}
%if 0%{?req_systemd}
%service_add_post ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
%else
if [ -x /bin/systemctl ]; then
systemd_dir=%{_unitdir}
echo "IINITDIR=%{init_dir}" >>%{_datadir}/%{name}/ipmiutil.env
cp -f ${scr_dir}/ipmiutil_evt.service ${systemd_dir}
cp -f ${scr_dir}/ipmiutil_asy.service ${systemd_dir}
cp -f ${scr_dir}/ipmiutil_wdt.service ${systemd_dir}
cp -f ${scr_dir}/ipmi_port.service ${systemd_dir}
# systemctl enable ipmi_port.service >/dev/null 2>&1 || :
else
cp -f ${scr_dir}/ipmiutil_wdt %{init_dir}
cp -f ${scr_dir}/ipmiutil_asy %{init_dir}
cp -f ${scr_dir}/ipmiutil_evt %{init_dir}
cp -f ${scr_dir}/ipmi_port %{init_dir}
fi
%endif
# Run some ipmiutil command to see if any IPMI interface works.
%{_sbindir}/ipmiutil wdt >/dev/null 2>&1
%{_bindir}/ipmiutil sel -v >/dev/null 2>&1
IPMIret=$?
# If IPMIret==0, the IPMI cmd was successful, and IPMI is enabled locally.
if [ $IPMIret -eq 0 ]; then
# If IPMI is enabled, automate managing the IPMI SEL
if [ -d %{_sysconfdir}/cron.daily ]; then
cp -f %{_datadir}/%{name}/checksel %{_sysconfdir}/cron.daily
fi
# IPMI_IS_ENABLED, so enable services, but only if Red Hat
if [ -f /etc/redhat-release ]; then
if [ -x /sbin/chkconfig ]; then
@ -141,7 +217,7 @@ then
# Capture a snapshot of IPMI sensor data once now for later reuse.
sensorout=$vardir/sensor_out.txt
if [ ! -f $sensorout ]; then
%{_sbindir}/ipmiutil sensor >$sensorout
%{_bindir}/ipmiutil sensor -q >$sensorout
fi
fi
fi
@ -150,6 +226,9 @@ fi
# before uninstall, $1 = 1 if rpm -U, $1 = 0 if rpm -e
if [ "$1" = "0" ]
then
%if 0%{?req_systemd}
%service_del_preun ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
%else
if [ -x /sbin/service ]; then
/sbin/service ipmi_port stop >/dev/null 2>&1
/sbin/service ipmiutil_wdt stop >/dev/null 2>&1
@ -162,6 +241,42 @@ then
/sbin/chkconfig --del ipmiutil_asy >/dev/null 2>&1
/sbin/chkconfig --del ipmiutil_evt >/dev/null 2>&1
fi
if [ -x /bin/systemctl ]; then
systemd_dir=%{_unitdir}
if [ -f ${systemd_dir}/ipmiutil_evt.service ]; then
systemctl disable ipmi_port.service >/dev/null 2>&1 || :
systemctl stop ipmiutil_evt.service >/dev/null 2>&1 || :
systemctl stop ipmiutil_asy.service >/dev/null 2>&1 || :
systemctl stop ipmiutil_wdt.service >/dev/null 2>&1 || :
systemctl stop ipmi_port.service >/dev/null 2>&1 || :
rm -f ${systemd_dir}/ipmiutil_evt.service
rm -f ${systemd_dir}/ipmiutil_asy.service
rm -f ${systemd_dir}/ipmiutil_wdt.service
rm -f ${systemd_dir}/ipmi_port.service
fi
else
rm -f %{init_dir}/ipmiutil_wdt 2>/dev/null
rm -f %{init_dir}/ipmiutil_asy 2>/dev/null
rm -f %{init_dir}/ipmiutil_evt 2>/dev/null
rm -f %{init_dir}/ipmi_port 2>/dev/null
fi
%endif
if [ -f %{_sysconfdir}/cron.daily/checksel ]; then
rm -f %{_sysconfdir}/cron.daily/checksel
fi
fi
%postun
%if 0%{?req_systemd}
%service_del_postun ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service
%else
if [ -x /bin/systemctl ]; then
systemctl daemon-reload || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
systemctl try-restart ipmi_port.service || :
fi
fi
%endif
%changelog