Author: Jagpal Singh Gill paligill@gmail.com
Created: 4th August 2023
This section covers the limitations discoverd with phosphor-bmc-code-mgmt
sequenceDiagram; participant CL as Client participant BMCW as BMCWeb participant CU as <deviceX>CodeUpdater<br> ServiceName: xyz.openbmc_project.Software.<deviceX> % Bootstrap Action for CodeUpdater note over CU: Get device access info from<br> /xyz/openbmc_project/inventory/system/... path note over CU: VersionId = Version Read from <deviceX> + Salt CU ->> CU: Create Interface<br> xyz.openbmc_project.Software.Update<br> at /xyz/openbmc_project/Software/<deviceX>/<VersionId> CU ->> CU: Create Interface<br> xyz.openbmc_project.Software.Version<br> at /xyz/openbmc_project/Software/<deviceX>/<VersionId> CU ->> CU: Create Interface<br>xyz.openbmc_project.Software.Activation<br> at /xyz/openbmc_project/Software/<deviceX>/<VersionId> <br> with Status = Active CU ->> CU: Create functional association <br> from Version to Inventory Item CL ->> BMCW: HTTP POST: /redfish/v1/UpdateService/update <br> (Image, settings, RedfishTargetURIArray) loop For every RedfishTargetURI note over BMCW: Map RedfishTargetURI to<br> System Inventory Item note over BMCW: Get object path (i.e. /xyz/openbmc_project/Software/<deviceX>/<VersionId>)<br>for associated Version interface to System Inventory Item note over BMCW: Get serviceName corresponding to the object path <br>from mapper. BMCW ->> CU: StartUpdate(Image, ApplyTime) note over CU: Verify Image break Image Verification FAILED CU -->> BMCW: {NULL, Update.Error} BMCW -->> CL: Return Error end note over CU: VersionId = Version from Image + Salt note over CU: ObjectPath = /xyz/openbmc_project/Software/<deviceX>/<VersionId> CU ->> CU: Create Interface<br> xyz.openbmc_project.Software.Version<br> at ObjectPath CU -->> BMCW: {ObjectPath, Success} CU ->> CU: << Delegate Update for asynchronous processing >> par BMCWeb Processing BMCW ->> BMCW: Create Matcher<br>(PropertiesChanged,<br> xyz.openbmc_project.Software.Activation,<br> ObjectPath) BMCW ->> BMCW: Create Matcher<br>(PropertiesChanged,<br> xyz.openbmc_project.Software.ActivationProgress,<br> ObjectPath) BMCW ->> BMCW: Create Task<br> to handle matcher notifications BMCW -->> CL: <TaskNum> loop BMCW --) BMCW: Process notifications<br> and update Task attributes CL ->> BMCW: /redfish/v1/TaskMonitor/<TaskNum> BMCW -->>CL: TaskStatus end and << Asynchronous Update in Progress >> CU ->> CU: Create Interface<br>xyz.openbmc_project.Software.Activation<br> at ObjectPath with Status = Ready CU ->> CU: Create Interface<br>xyz.openbmc_project.Software.ActivationProgress<br> at ObjectPath CU ->> CU: Create Interface<br> xyz.openbmc_project.Software.ActivationBlocksTransition<br> at ObjectPath note over CU: Start Update loop CU --) BMCW: Notify ActivationProgress.Progress change end note over CU: Finish Update CU ->> CU: Activation.Status = Active CU --) BMCW: Notify Activation.Status change CU ->> CU: Delete Interface<br> xyz.openbmc_project.Software.ActivationBlocksTransition CU ->> CU: Delete Interface<br> xyz.openbmc_project.Software.ActivationProgress alt ApplyTime == Immediate note over CU: Reset Device and<br> update functional association to System Inventory Item else note over CU: Create active association to System Inventory Item end end end
The DBus Interface for code update will consist of following -
Interface Name | Existing/New | Purpose |
---|---|---|
xyz.openbmc_project.Software.Update | New | Provides update method |
xyz.openbmc_project.Software.Version | Existing | Provides version info |
xyz.openbmc_project.Software.Activation | Existing | Provides activation status |
xyz.openbmc_project.Software.ActivationProgress | Existing | Provides activation progress percentage |
xyz.openbmc_project.Software.ActivationBlocksTransition | Existing | Signifies barrier for state transitions while update is in progress |
xyz.openbmc_project.Software.RedundancyPriority | Existing | Provides the redundancy priority for the version interface |
Introduction of xyz.openbmc_project.Software.Update interface streamlines the update invocation flow and hence addresses the Issue# 2 and Requirement# 1 & 2.
running
: A running
association from xyz.openbmc_project.Inventory.Item to xyz.openbmc_project.Software.Version represents the current functional or running software version for the associated inventory item. The ran_on
would be the corresponding reverse association.
activating
: An activating
association from xyz.openbmc_project.Inventory.Item to xyz.openbmc_project.Software.Version represents the activated (but not yet run) software version for the associated inventory item. There could be more than one active versions for an inventory item, for example, in case of A/B redundancy models there are 2 associated flash-banks and xyz.openbmc_project.Software.RedundancyPriority interface defines the priority for each one.
For A/B redundancy model with staging support, the xyz.openbmc_project.Software.Activation.Activations.Staged will help to define which software version is currently staged.
The activated_on
would be the corresponding reverse association.
Images will be kept in memory and passed to <deviceX>CodeUpdater using a file descriptor rather than file path. Implementation needs to monitor appropriate memory limits to prevent parallel updates from running BMC out of memory.
xyz.openbmc_project.Software.Update.StartUpdate return value will propagate any errors related to initial setup and image metadata/header parsing back to user. Any asynchronous errors which happen during the update process will be notified via failed activation status which maps to failed task associated with the update. Also, a phosphor-logging event will be created and sent back to client via Redfish Log Service.
Another alternative could be to use Redfish Event Services.
Image parsing will be performed in <deviceX>CodeUpdater and since <deviceX>CodeUpdater may be a device specific daemon, vendor may choose any image format for the firmware image. This fulfills the Requirement# 7.
A multi part image has multiple component images as part of one image package. PLDM image is one such example of multi part image format. Sometimes, for multi part devices there is no concrete physical firmware device but firmware device itself consists of multiple phsyical components, each of which may have its own component image. In such a scenario, <deviceX>CodeUpdater can create a logical inventory item for the firmware device. While performing the firmware device update, the client may target the logical firmware device which further knows how to update the corresponding child components for supplied component images. The user can also update the specific component by providing the image package with component as head node. The <deviceX>CodeUpdater can implement the required logic to verify if the supplied image is targeted for itself (and child components) or not.
This fulfills the Requirement# 9.
Different type hardware components:
Upgrade for different type hardware components can be handled either by different CodeUpdater daemons or by a single daemon for hardware components with common features, for example, PLDMd may handle update for devices using PLDM specification. Such updates can be invoked in parallel from BMCWeb and tracked via different tasks.
Similar type hardware component:
BMCWeb will trigger xyz.openbmc_project.Software.Update.StartUpdate on different D-Bus paths pertaining to each hardware instance. For more details on D-Bus paths refer to Update multiple devices of same type.
This fulfills the Requirement# 9.
ActivationBlocksTransitions
interface will be created on the specific D-Bus path for a version update which will help to block any interruptions from critical system actions such as reboots. This interface can in turn start and stop services such as Boot Guard Service to prevent such interruptions.
Moreover, when a device is being upgraded the sensor scanning for that device might need to be disabled. To achieve this, the sensor scanning flow can check for existence of ActivationBlocksTransitions
interface on associated Version
DBus path for the inventory item. If such interface exists, the sensor scanning for that device can be skipped by returning back relevant error (such as EBUSY
) to the client. Another alternative is to check for existence of ActivationBlocksTransitions
interface only if sensor scanning times out. This won't impact average case performance for sensor scanning but only the worst case scenario when device is busy, for example, due to update in progress.
Single SoftwareManager which communicates with the BCMWeb, hosts all the interfaces such as Version, Activation, Progress for all hardware components within the system on different DBus paths. Software Manager keeps list of various hardware update services within the system and start them based on update request. These on-demand services update the hardware and interfaces hosted by Software Manager and exits.
The proposed solution uses a push model where status and progress updates are asynchronously pushed to BMCWeb. Another alternative would be to use a pull model where Update interface can have get methods for status and progress (for example, getActivationStatus and getActivationProgress).
The introduction of new DBus API will temporarily create two invocation flows from Server. Servers (BMCWeb, IPMI, etc) can initially support both the code stacks. As all the code update daemons gets moved to the new flow, Servers would be changed to only support new API stack. No user-api impact as design adheres to Redfish UpdateService.
Yes. There will be a device transport level repositories and multiple <deviceX>CodeUpdater using similar transport layer can reside in same repository. For example, all devices using PMBus could have a common repository.
Meta will propose repositories for following devices and Jagpal Singh Gill
& Patrick Williams
will be the maintainer for them.
Requires changes in following repositories to incorporate the new interface for update invocation -
Repository | Modification Owner |
---|---|
phosphor-bmc-code-mgmt | Jagpal Singh Gill |
BMCWeb | Jagpal Singh Gill |
phosphor-host-ipmid | Jagpal Singh Gill |
pldm | Jagpal Singh Gill |
openpower-pnor-code-mgmt | Adriana Kobylak |
openbmc-test-automation | Adriana Kobylak |
NOTE: For phosphor-psu-code-mgmt code seems unused, so not tracking for change.
All the functional testing of the reference implementation will be performed using GTest.
The end to end integration testing involving Servers (for example BMCWeb) will be covered using openbmc-test-automation.