2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2024-11-22 01:21:44 +00:00

Merge pull request #20 from whowutwut/ipmitool-1.8.18

Update the files required to build ipmitool 1.8.18
This commit is contained in:
chenglch 2017-05-31 11:06:29 +08:00 committed by GitHub
commit bb5c1f920d
12 changed files with 229 additions and 11 deletions

View File

@ -1,5 +1,8 @@
#! /usr/bin/perl
my $version = "1.8.18";
my $release = "0";
#check the distro
$cmd = "cat /etc/*release";
@output = `$cmd`;
@ -37,7 +40,6 @@ if ( ! grep /openssl-devel|libopenssl/, @output ) {
# check the source files
my $pwd = `pwd`;
my $version = "1.8.17";
chomp($pwd);
if ( (! -f "$pwd/ipmitool-$version.tar.gz")
|| (! -f "$pwd/ipmitool.spec")
@ -94,7 +96,7 @@ if (! grep /libcrypto.so/, @output) {
exit 1;
}
my $objrpm = "$blddir/RPMS/$arch/ipmitool-xcat-$version-1.$arch.rpm";
my $objrpm = "$blddir/RPMS/$arch/ipmitool-xcat-$version-$release.$arch.rpm";
my $dstdir = "/tmp/build/$os/$arch";
# check the build result

View File

@ -1,3 +1,8 @@
ipmitool-xcat (1.8.18) unstable; urgency=low
* Upgrade to 1.8.18 version
-- Victor Hu <vhu@us.ibm.com> Tue, May 30, 2017 14:41:01 -0400
ipmitool-xcat (1.8.17-1) unstable; urgency=low
* Make ipmitool exit gracefully when receiving `INT`, `TERM` or `HUP` signal.
* Close the intf(lanplus) session when the sol session at BMC side is closed.

View File

@ -0,0 +1 @@
../../ipmitool-1.8.18-rflash.patch

View File

@ -0,0 +1 @@
../../ipmitool-1.8.18-saneretry.patch

View File

@ -0,0 +1 @@
../../ipmitool-1.8.18-signal.patch

View File

@ -1,3 +1,3 @@
ipmitool-1.8.17-saneretry.patch
ipmitool-1.8.17-rflash.patch
ipmitool-1.8.17-signal.patch
ipmitool-1.8.18-saneretry.patch
ipmitool-1.8.18-rflash.patch
ipmitool-1.8.18-signal.patch

View File

@ -0,0 +1,21 @@
--- ipmitool-1.8.18/lib/ipmi_hpmfwupg.c 2016-06-29 14:01:49.000000000 -0400
+++ ipmitool-1.8.18-rflash/lib/ipmi_hpmfwupg.c 2017-05-30 13:32:44.751054806 -0400
@@ -730,18 +730,6 @@
lprintf(LOG_NOTICE, "\n Upgrade undesirable at this moment");
return HPMFWUPG_ERROR;
}
- /* Get confimation from the user if he wants to continue when
- * service affected during upgrade
- */
- if (!(option & COMPARE_MODE)
- && (pFwupgCtx->targetCap.GlobalCapabilities.bitField.servAffectDuringUpg == 1
- || pImageHeader->imageCapabilities.bitField.servAffected == 1)) {
- if (HpmGetUserInput("\nServices may be affected during upgrade. Do you wish to continue? (y/n): ")) {
- rc = HPMFWUPG_SUCCESS;
- } else {
- return HPMFWUPG_ERROR;
- }
- }
}
/* Get the general properties of each component present in image */
for (componentId = HPMFWUPG_COMPONENT_ID_0;

View File

@ -0,0 +1,50 @@
--- ipmitool-1.8.18/lib/ipmi_sol.c 2016-06-29 14:06:29.000000000 -0400
+++ ipmitool-1.8.18-saneretry/lib/ipmi_sol.c 2017-05-30 13:41:12.462969340 -0400
@@ -76,7 +76,6 @@
#define SOL_PARAMETER_SOL_PAYLOAD_CHANNEL 0x07
#define SOL_PARAMETER_SOL_PAYLOAD_PORT 0x08
-#define MAX_SOL_RETRY 6
const struct valstr sol_parameter_vals[] = {
{ SOL_PARAMETER_SET_IN_PROGRESS, "Set In Progress (0)" },
@@ -1535,7 +1534,6 @@
int retval;
int buffer_size = intf->session->sol_data.max_inbound_payload_size;
int keepAliveRet = 0;
- int retrySol = 0;
/* Subtract SOL header from max_inbound_payload_size */
if (buffer_size > 4)
@@ -1572,29 +1570,8 @@
if (keepAliveRet != 0)
{
- /*
- * Retrying the keep Alive before declaring a communication
- * lost state with the IPMC. Helpful when the payload is
- * reset and brings down the connection temporarily. Otherwise,
- * if we send getDevice Id to check the status of IPMC during
- * this down time when the connection is restarting, SOL will
- * exit even though the IPMC is available and the session is open.
- */
- if (retrySol == MAX_SOL_RETRY)
- {
- /* no response to Get Device ID keepalive message */
- bShouldExit = 1;
- continue;
- }
- else
- {
- retrySol++;
- }
- }
- else
- {
- /* if the keep Alive is successful reset retries to zero */
- retrySol = 0;
+ bShouldExit = 1;
+ continue;
}
} /* !oem="i82571spt" */
/* Wait up to half a second */

View File

@ -0,0 +1,135 @@
--- ipmitool-1.8.18/lib/ipmi_main.c 2016-07-31 02:56:33.000000000 -0400
+++ ipmitool-1.8.18-signal/lib/ipmi_main.c 2017-05-30 14:04:11.798264910 -0400
@@ -92,6 +92,7 @@
extern int verbose;
extern int csv_output;
+extern int sol_activated;
extern const struct valstr ipmi_privlvl_vals[];
extern const struct valstr ipmi_authtype_session_vals[];
@@ -271,24 +272,30 @@
if (cmdlist != NULL)
ipmi_cmd_print(cmdlist);
}
-/* ipmi_catch_sigint - Handle the interrupt signal (Ctrl-C), close the
- * interface, and exit ipmitool with error (-1)
+/* ipmi_catch_sig - Handle the interrupt signal (Ctrl-C),TERM signal,
+ * and HUP signal. Close the interface, and exit
+ * ipmitool with error (-1)
*
- * This insures that the IOL session gets freed
- * for other callers.
+ * This insures that the IOL session gets freed
+ * for other callers.
*
* returns -1
*/
-void ipmi_catch_sigint()
+void ipmi_catch_sig(const int sig)
{
- if (ipmi_main_intf != NULL) {
- printf("\nSIGN INT: Close Interface %s\n",ipmi_main_intf->desc);
- /* reduce retry count to a single retry */
- ipmi_main_intf->ssn_params.retry = 1;
- /* close interface */
- ipmi_main_intf->close(ipmi_main_intf);
+ if (sol_activated == 1) {
+ printf("\nSIGN %s: Deactivate sol session\r\n",strsignal(sig));
+ sol_activated = 0;
+ } else {
+ if (ipmi_main_intf != NULL) {
+ printf("\nSIGN %s: Close Interface %s\n",strsignal(sig), ipmi_main_intf->desc);
+ /* reduce retry count to a single retry */
+ ipmi_main_intf->ssn_params.retry = 1;
+ /* close interface */
+ ipmi_main_intf->close(ipmi_main_intf);
+ }
+ exit(-1);
}
- exit(-1);
}
static uint8_t
@@ -357,7 +364,9 @@
/* save program name */
progname = strrchr(argv[0], '/');
progname = ((progname == NULL) ? argv[0] : progname+1);
- signal(SIGINT, ipmi_catch_sigint);
+ signal(SIGINT, ipmi_catch_sig);
+ signal(SIGTERM, ipmi_catch_sig);
+ signal(SIGHUP, ipmi_catch_sig);
memset(kgkey, 0, sizeof(kgkey));
while ((argflag = getopt(argc, (char **)argv, OPTION_STRING)) != -1)
--- ipmitool-1.8.18/lib/ipmi_sol.c 2016-06-29 14:06:29.000000000 -0400
+++ ipmitool-1.8.18-signal/lib/ipmi_sol.c 2017-05-30 14:28:55.503571252 -0400
@@ -46,6 +46,7 @@
#include <time.h>
#include <signal.h>
#include <unistd.h>
+#include <errno.h>
#if defined(HAVE_CONFIG_H)
# include <config.h>
@@ -99,6 +100,7 @@
static int _use_sol_for_keepalive = 0;
extern int verbose;
+int sol_activated = 0;
/*
* ipmi_sol_payload_access
@@ -1558,6 +1560,12 @@
FD_SET(0, &read_fds);
FD_SET(intf->fd, &read_fds);
+ if (sol_activated == 0) {
+ bBmcClosedSession = 0;
+ keepAliveRet = 0;
+ break;
+ }
+
if (!ipmi_oem_active(intf,"i82571spt"))
{
/* Send periodic keepalive packet */
@@ -1668,22 +1676,24 @@
}
leave_raw_mode();
+ ipmi_sol_deactivate(intf, instance);
if (keepAliveRet != 0)
{
lprintf(LOG_ERR, "Error: No response to keepalive - Terminating session");
- /* attempt to clean up anyway */
- ipmi_sol_deactivate(intf, instance);
- exit(1);
+ return -1;
}
if (bBmcClosedSession)
{
lprintf(LOG_ERR, "SOL session closed by BMC");
- exit(1);
+ return -1;
+ }
+ else if (sol_activated == 0)
+ {
+ lprintf(LOG_ERR, "SOL session closed by signal");
+ return -1;
}
- else
- ipmi_sol_deactivate(intf, instance);
return 0;
}
@@ -1768,6 +1778,8 @@
data[4] = 0x00; /* reserved */
data[5] = 0x00; /* reserved */
+ /* Make sure deactivate code sent to BMC no matter what the status is */
+ sol_activated = 1;
rsp = intf->sendrecv(intf, &req);
if (NULL != rsp) {

Binary file not shown.

View File

@ -1,7 +1,7 @@
Name: ipmitool-xcat
Summary: ipmitool - Utility for IPMI control
Version: 1.8.17
Release: 1
Version: 1.8.18
Release: 0
License: BSD
Group: Utilities
Packager: IBM Corp.
@ -64,7 +64,9 @@ fi
%changelog
* Wed Nov 04 2016 <chenglch@cn.ibm.com> 1.8.17-1
* Tue May 30 2017 <vhu@us.im.com> 1.8.18
Added support for building ipmitool-xcat 1.8.18 and forward fit patches
* Fri Nov 04 2016 <chenglch@cn.ibm.com> 1.8.17-1
Make ipmitool exit gracefully when receiving `INT`, `TERM` or `HUP` signal.
Close the intf(lanplus) session when the sol session at BMC side is closed.
* Wed Nov 04 2015 <chenglch@cn.ibm.com> 1.8.15
@ -270,7 +272,7 @@ fi
- Make ipmievd generate pidfile
- Add initscripts for ipmievd
* Mon Jan 17 2006 <duncan@iceblink.org> 1.8.6-1
* Tue Jan 17 2006 <duncan@iceblink.org> 1.8.6-1
- Fix memory corruption when sending encrypted SOL traffic
- Add keepalive timer to IPMIv2 SOL sessions
@ -338,7 +340,7 @@ fi
- new "shell" and "exec" commands
- lots of other contributed patches
* Sat May 27 2004 <duncan@iceblink.org> 1.5.9-1
* Thu May 27 2004 <duncan@iceblink.org> 1.5.9-1
- Add ability to get a particular sensor by name
- Add ability to set a particular sensor threshold
- Add support for displaying V2 channel authentication levels

View File

@ -1,5 +1,5 @@
#!/bin/bash
VERSION=1.8.17
VERSION=1.8.18
tar xvfz ipmitool-$VERSION.tar.gz
cd ipmitool-$VERSION