mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-11 19:17:22 +00:00
Added firmware auxilliary bytes to hpm outputs
This commit is contained in:
parent
5348236e65
commit
cf63a9d593
@ -60,6 +60,7 @@
|
|||||||
* Frederic.Lelievre@ca.kontron.com
|
* Frederic.Lelievre@ca.kontron.com
|
||||||
* Francois.Isabelle@ca.kontron.com
|
* Francois.Isabelle@ca.kontron.com
|
||||||
* Jean-Michel.Audet@ca.kontron.com
|
* Jean-Michel.Audet@ca.kontron.com
|
||||||
|
* MarieJosee.Blais@ca.kontron.com
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
*
|
*
|
||||||
@ -1006,16 +1007,19 @@ typedef enum eHpmfwupgActionType
|
|||||||
|
|
||||||
typedef struct _VERSIONINFO
|
typedef struct _VERSIONINFO
|
||||||
{
|
{
|
||||||
int componentId;
|
unsigned char componentId;
|
||||||
int targetMajor;
|
unsigned char targetMajor;
|
||||||
int targetMinor;
|
unsigned char targetMinor;
|
||||||
int rollbackMajor;
|
unsigned char targetAux[4];
|
||||||
int rollbackMinor;
|
unsigned char rollbackMajor;
|
||||||
int imageMajor;
|
unsigned char rollbackMinor;
|
||||||
int imageMinor;
|
unsigned char rollbackAux[4];
|
||||||
int coldResetRequired;
|
unsigned char imageMajor;
|
||||||
int rollbackSupported;
|
unsigned char imageMinor;
|
||||||
int skipUpgrade;
|
unsigned char imageAux[4];
|
||||||
|
unsigned char coldResetRequired;
|
||||||
|
unsigned char rollbackSupported;
|
||||||
|
unsigned char skipUpgrade;
|
||||||
char descString[15];
|
char descString[15];
|
||||||
}VERSIONINFO, *PVERSIONINFO;
|
}VERSIONINFO, *PVERSIONINFO;
|
||||||
|
|
||||||
@ -1130,10 +1134,10 @@ void HpmDisplayLine(char *s, int n)
|
|||||||
void HpmDisplayUpgradeHeader(int option)
|
void HpmDisplayUpgradeHeader(int option)
|
||||||
{
|
{
|
||||||
printf("\n");
|
printf("\n");
|
||||||
HpmDisplayLine("-",79 );
|
HpmDisplayLine("-",78 );
|
||||||
printf("|ID | Name | Versions | Upload Progress | Upload| Image |\n");
|
printf("|ID | Name | Versions | %% |\n");
|
||||||
printf("| | | Active| Backup| File |0%% 50%% 100%%| Time | Size |\n");
|
printf("| | | Active | Backup | File | |\n");
|
||||||
printf("|---|-----------|-------|-------|-------||----+----+----+----||-------|-------|\n");
|
printf("|---|-----------|-----------------|-----------------|-----------------|------|\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -1151,27 +1155,25 @@ void HpmDisplayUpgrade( int skip, unsigned int totalSent,
|
|||||||
static int old_percent=1;
|
static int old_percent=1;
|
||||||
if (skip)
|
if (skip)
|
||||||
{
|
{
|
||||||
printf("| Skip || --.-- | ----- |\n");
|
printf(" Skip |\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
percent = ((float)totalSent/displayFWLength)*100;
|
percent = ((float)totalSent/displayFWLength)*100;
|
||||||
if (((percent % 5) == 0))
|
if (percent != old_percent)
|
||||||
{
|
{
|
||||||
if (percent != old_percent)
|
if ( percent == 0 ) printf(" 0 %% |");
|
||||||
{
|
else if (percent == 100) printf("\b\b\b\b\b\b\b100 %% |\n");
|
||||||
if ( percent == 0 ) printf("|");
|
else printf("\b\b\b\b\b\b\b%3d %% |", percent);
|
||||||
else if (percent == 100) printf("|");
|
old_percent = percent;
|
||||||
else printf(".");
|
|
||||||
old_percent = percent;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (totalSent== displayFWLength)
|
if (totalSent== displayFWLength)
|
||||||
{
|
{
|
||||||
/* Display the time taken to complete the upgrade */
|
/* Display the time taken to complete the upgrade */
|
||||||
printf("| %02d.%02d | %05x |\n",timeElapsed/60,timeElapsed%60,totalSent);
|
printf("| | Upload Time: %02d.%02d | Image Size: %05x |\n",
|
||||||
|
timeElapsed/60,timeElapsed%60,totalSent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1184,20 +1186,19 @@ void HpmDisplayUpgrade( int skip, unsigned int totalSent,
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
int HpmDisplayVersionHeader(int mode)
|
int HpmDisplayVersionHeader(int mode)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( mode & IMAGE_VER)
|
if ( mode & IMAGE_VER)
|
||||||
{
|
{
|
||||||
HpmDisplayLine("-",41 );
|
HpmDisplayLine("-",71 );
|
||||||
printf("|ID | Name | Versions |\n");
|
printf("|ID | Name | Versions |\n");
|
||||||
printf("| | | Active| Backup| File |\n");
|
printf("| | | Active | Backup | File |\n");
|
||||||
HpmDisplayLine("-",41 );
|
HpmDisplayLine("-",71 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HpmDisplayLine("-",33 );
|
HpmDisplayLine("-",53 );
|
||||||
printf("|ID | Name | Versions |\n");
|
printf("|ID | Name | Versions |\n");
|
||||||
printf("| | | Active| Backup|\n");
|
printf("| | | Active | Backup |\n");
|
||||||
HpmDisplayLine("-",33 );
|
HpmDisplayLine("-",53 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1227,29 +1228,48 @@ int HpmDisplayVersion(int mode,VERSIONINFO *pVersion)
|
|||||||
if (mode & TARGET_VER)
|
if (mode & TARGET_VER)
|
||||||
{
|
{
|
||||||
if (pVersion->targetMajor == 0xFF && pVersion->targetMinor == 0xFF)
|
if (pVersion->targetMajor == 0xFF && pVersion->targetMinor == 0xFF)
|
||||||
printf(" --.-- |");
|
printf(" ---.-- -------- |");
|
||||||
else
|
else
|
||||||
printf("%3d.%02x |",pVersion->targetMajor,pVersion->targetMinor);
|
printf(" %3d.%02x %02X%02X%02X%02X |",
|
||||||
|
pVersion->targetMajor,
|
||||||
|
pVersion->targetMinor,
|
||||||
|
pVersion->targetAux[0],
|
||||||
|
pVersion->targetAux[1],
|
||||||
|
pVersion->targetAux[2],
|
||||||
|
pVersion->targetAux[3]
|
||||||
|
);
|
||||||
|
|
||||||
if (mode & ROLLBACK_VER)
|
if (mode & ROLLBACK_VER)
|
||||||
{
|
{
|
||||||
if (pVersion->rollbackMajor == 0xFF && pVersion->rollbackMinor == 0xFF)
|
if (pVersion->rollbackMajor == 0xFF && pVersion->rollbackMinor == 0xFF)
|
||||||
printf(" --.-- |");
|
printf(" ---.-- -------- |");
|
||||||
else
|
else
|
||||||
printf("%3d.%02x |",pVersion->rollbackMajor,pVersion->rollbackMinor);
|
printf(" %3d.%02x %02X%02X%02X%02X |",
|
||||||
|
pVersion->rollbackMajor,
|
||||||
|
pVersion->rollbackMinor,
|
||||||
|
pVersion->rollbackAux[0],
|
||||||
|
pVersion->rollbackAux[1],
|
||||||
|
pVersion->rollbackAux[2],
|
||||||
|
pVersion->rollbackAux[3]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf(" --.-- |");
|
printf(" ---.-- -------- |");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode & IMAGE_VER)
|
if (mode & IMAGE_VER)
|
||||||
{
|
{
|
||||||
if (pVersion->imageMajor == 0xFF && pVersion->imageMinor == 0xFF)
|
if (pVersion->imageMajor == 0xFF && pVersion->imageMinor == 0xFF)
|
||||||
printf(" --.-- |");
|
printf(" ---.-- |");
|
||||||
else
|
else
|
||||||
printf("%3d.%02x |",pVersion->imageMajor,pVersion->imageMinor);
|
printf(" %3d.%02x %02X%02X%02X%02X |",
|
||||||
|
pVersion->imageMajor,
|
||||||
|
pVersion->imageMinor,
|
||||||
|
pVersion->imageAux[0],
|
||||||
|
pVersion->imageAux[1],
|
||||||
|
pVersion->imageAux[2],
|
||||||
|
pVersion->imageAux[3]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1348,6 +1368,14 @@ int HpmfwupgTargetCheck(struct ipmi_intf * intf, int option)
|
|||||||
currentVersionResp.currentVersion[0];
|
currentVersionResp.currentVersion[0];
|
||||||
gVersionInfo[componentId].targetMinor = getCompProp.resp.Response.
|
gVersionInfo[componentId].targetMinor = getCompProp.resp.Response.
|
||||||
currentVersionResp.currentVersion[1];
|
currentVersionResp.currentVersion[1];
|
||||||
|
gVersionInfo[componentId].targetAux[0] = getCompProp.resp.Response.
|
||||||
|
currentVersionResp.currentVersion[2];
|
||||||
|
gVersionInfo[componentId].targetAux[1] = getCompProp.resp.Response.
|
||||||
|
currentVersionResp.currentVersion[3];
|
||||||
|
gVersionInfo[componentId].targetAux[2] = getCompProp.resp.Response.
|
||||||
|
currentVersionResp.currentVersion[4];
|
||||||
|
gVersionInfo[componentId].targetAux[3] = getCompProp.resp.Response.
|
||||||
|
currentVersionResp.currentVersion[5];
|
||||||
mode = TARGET_VER;
|
mode = TARGET_VER;
|
||||||
|
|
||||||
if (gVersionInfo[componentId].rollbackSupported)
|
if (gVersionInfo[componentId].rollbackSupported)
|
||||||
@ -1362,6 +1390,14 @@ int HpmfwupgTargetCheck(struct ipmi_intf * intf, int option)
|
|||||||
.Response.rollbackFwVersionResp.rollbackFwVersion[0];
|
.Response.rollbackFwVersionResp.rollbackFwVersion[0];
|
||||||
gVersionInfo[componentId].rollbackMinor = getCompProp.resp
|
gVersionInfo[componentId].rollbackMinor = getCompProp.resp
|
||||||
.Response.rollbackFwVersionResp.rollbackFwVersion[1];
|
.Response.rollbackFwVersionResp.rollbackFwVersion[1];
|
||||||
|
gVersionInfo[componentId].rollbackAux[0] = getCompProp.resp.Response.
|
||||||
|
rollbackFwVersionResp.rollbackFwVersion[2];
|
||||||
|
gVersionInfo[componentId].rollbackAux[1] = getCompProp.resp.Response.
|
||||||
|
rollbackFwVersionResp.rollbackFwVersion[3];
|
||||||
|
gVersionInfo[componentId].rollbackAux[2] = getCompProp.resp.Response.
|
||||||
|
rollbackFwVersionResp.rollbackFwVersion[4];
|
||||||
|
gVersionInfo[componentId].rollbackAux[3] = getCompProp.resp.Response.
|
||||||
|
rollbackFwVersionResp.rollbackFwVersion[5];
|
||||||
}
|
}
|
||||||
mode |= ROLLBACK_VER;
|
mode |= ROLLBACK_VER;
|
||||||
}
|
}
|
||||||
@ -1384,7 +1420,7 @@ int HpmfwupgTargetCheck(struct ipmi_intf * intf, int option)
|
|||||||
|
|
||||||
if (option & VIEW_MODE)
|
if (option & VIEW_MODE)
|
||||||
{
|
{
|
||||||
HpmDisplayLine("-",33 );
|
HpmDisplayLine("-",53 );
|
||||||
if (flagColdReset)
|
if (flagColdReset)
|
||||||
{
|
{
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
@ -1918,8 +1954,12 @@ int HpmfwupgPreUpgradeCheck(struct ipmi_intf *intf, struct HpmfwupgUpgradeCtx* p
|
|||||||
|
|
||||||
pVersionInfo = &gVersionInfo[componentId];
|
pVersionInfo = &gVersionInfo[componentId];
|
||||||
|
|
||||||
pVersionInfo->imageMajor = pFwImage->version[0];
|
pVersionInfo->imageMajor = pFwImage->version[0];
|
||||||
pVersionInfo->imageMinor = pFwImage->version[1];
|
pVersionInfo->imageMinor = pFwImage->version[1];
|
||||||
|
pVersionInfo->imageAux[0] = pFwImage->version[2];
|
||||||
|
pVersionInfo->imageAux[1] = pFwImage->version[3];
|
||||||
|
pVersionInfo->imageAux[2] = pFwImage->version[4];
|
||||||
|
pVersionInfo->imageAux[3] = pFwImage->version[5];
|
||||||
|
|
||||||
mode = TARGET_VER | IMAGE_VER;
|
mode = TARGET_VER | IMAGE_VER;
|
||||||
|
|
||||||
@ -2007,7 +2047,7 @@ int HpmfwupgPreUpgradeCheck(struct ipmi_intf *intf, struct HpmfwupgUpgradeCtx* p
|
|||||||
}
|
}
|
||||||
if (option & VIEW_MODE)
|
if (option & VIEW_MODE)
|
||||||
{
|
{
|
||||||
HpmDisplayLine("-",41);
|
HpmDisplayLine("-",71);
|
||||||
if (flagColdReset)
|
if (flagColdReset)
|
||||||
{
|
{
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
@ -2148,7 +2188,7 @@ int HpmfwupgUpgradeStage(struct ipmi_intf *intf, struct HpmfwupgUpgradeCtx* pFwu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HpmDisplayLine("-",79);
|
HpmDisplayLine("-",78);
|
||||||
|
|
||||||
if (flagColdReset)
|
if (flagColdReset)
|
||||||
{
|
{
|
||||||
@ -2241,7 +2281,7 @@ static int HpmFwupgActionUploadFirmware
|
|||||||
}
|
}
|
||||||
skip = FALSE;
|
skip = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!skip)
|
if(!skip)
|
||||||
{
|
{
|
||||||
/* Initialize parameters */
|
/* Initialize parameters */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user