From 8954fe454b7a3df09d5b3be9f8be47d720c7d9d1 Mon Sep 17 00:00:00 2001 From: Dmitry Frolov Date: Wed, 29 Aug 2007 06:03:23 +0000 Subject: [PATCH] Fix HPM.1 upgrade to apply to only given component when instructed to do so. Patch submitted by Harshad Prabhu (Harshad.Prabhu at radisys dot com). Quoting his email: "Initiate Upgrade Action (HPMFWUPG_UPGRADE_ACTION_UPGRADE) was called for all components even when single component was given on command line (hpm upgrade component ). So calling this command only after we decide whether the component is skipped." --- ipmitool/ChangeLog | 2 ++ ipmitool/lib/ipmi_hpmfwupg.c | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ipmitool/ChangeLog b/ipmitool/ChangeLog index cc56a33..60b1b60 100644 --- a/ipmitool/ChangeLog +++ b/ipmitool/ChangeLog @@ -6,6 +6,8 @@ version 1.8.10 * Fix bug in "chassis poh" command. * Added configure option to disable dual bridge support in open interface to help compiling on FreeBSD + * Fix HPM.1 upgrade to apply to only given component when instructed + to do so version 1.8.9 released 2007-03-06 * Added initial AMC ekey query operation support diff --git a/ipmitool/lib/ipmi_hpmfwupg.c b/ipmitool/lib/ipmi_hpmfwupg.c index 0bcfcd6..2d80a6d 100644 --- a/ipmitool/lib/ipmi_hpmfwupg.c +++ b/ipmitool/lib/ipmi_hpmfwupg.c @@ -1816,16 +1816,6 @@ int HpmfwupgUpgradeStage(struct ipmi_intf *intf, struct HpmfwupgUpgradeCtx* pFwu unsigned char componentIdByte = 0x00; - /* Send initiate command */ - initUpgActionCmd.req.componentsMask = pActionRecord->components; - /* Action is upgrade */ - initUpgActionCmd.req.upgradeAction = HPMFWUPG_UPGRADE_ACTION_UPGRADE; - rc = HpmfwupgInitiateUpgradeAction(intf, &initUpgActionCmd, pFwupgCtx); - - if (rc != HPMFWUPG_SUCCESS) - { - break; - } /* Save component ID on which the upload is done */ componentIdByte = pActionRecord->components.ComponentBits.byte; while ((componentIdByte>>=1)!=0) @@ -1897,6 +1887,17 @@ int HpmfwupgUpgradeStage(struct ipmi_intf *intf, struct HpmfwupgUpgradeCtx* pFwu pImagePtr = pDataInitial + firmwareLength; break; } + + /* Send initiate command */ + initUpgActionCmd.req.componentsMask = pActionRecord->components; + /* Action is upgrade */ + initUpgActionCmd.req.upgradeAction = HPMFWUPG_UPGRADE_ACTION_UPGRADE; + rc = HpmfwupgInitiateUpgradeAction(intf, &initUpgActionCmd, pFwupgCtx); + + if (rc != HPMFWUPG_SUCCESS) + { + break; + } pVersionInfo = (VERSIONINFO*) &gVersionInfo[componentId];